Show
Ignore:
Timestamp:
04/11/06 11:16:59 (3 years ago)
Author:
jordi
Message:

It's now possible to cancel the open file dialog :-)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/MainPterTest.cxx

    r24 r25  
    117117    CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    118118} 
     119 
     120/// 
     121/// @brief Tests a cancelled open file. 
     122/// 
     123/// When the user cancels the open dialog, then nothing should change. 
     124/// 
     125void 
     126MainPterTest::loadCancelled () 
     127{ 
     128    // returning a NULL file name is what will happen when cancel. 
     129    m_View->setOpenFileName (NULL); 
     130    m_MainPter->openFileActivated (); 
     131    CPPUNIT_ASSERT_EQUAL (0,  
     132            g_ascii_strcasecmp ("PDF Viewer", m_View->getTitle ())); 
     133    CPPUNIT_ASSERT (!m_View->isSensitiveGoToFirstPage ()); 
     134    CPPUNIT_ASSERT (!m_View->isSensitiveGoToLastPage ()); 
     135    CPPUNIT_ASSERT (!m_View->isSensitiveGoToNextPage ()); 
     136    CPPUNIT_ASSERT (!m_View->isSensitiveGoToPage ()); 
     137    CPPUNIT_ASSERT (!m_View->isSensitiveGoToPreviousPage ()); 
     138    CPPUNIT_ASSERT (!m_View->isSensitiveZoomIn ()); 
     139    CPPUNIT_ASSERT (!m_View->isSensitiveZoomOut ()); 
     140    CPPUNIT_ASSERT (!m_View->isSensitiveZoomFit ()); 
     141    CPPUNIT_ASSERT (!m_View->isSensitiveZoomWidth ()); 
     142    CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
     143}