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

When an error loading the document happens, the view shows to the user an error message.

Also, updated POTFILES.in with the correct document sources and the MainPter? sources.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/MainPterTest.cxx

    r25 r26  
    141141    CPPUNIT_ASSERT (!m_View->isSensitiveZoomWidth ()); 
    142142    CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
     143    CPPUNIT_ASSERT (!m_View->shownError ()); 
    143144} 
     145 
     146/// 
     147/// @brief Test a failed load. 
     148/// 
     149/// A failed load (anything but a DocumentErrorNone and DocumentErrorEncrypted) 
     150/// is very similar to the load cancelled, but an error message is shown  
     151/// to the user. 
     152/// 
     153void 
     154MainPterTest::loadFailed () 
     155{     
     156    m_View->setOpenFileName ("/tmp/test.pdf"); 
     157    m_Document->setOpenError (DocumentErrorDamaged); 
     158    m_MainPter->openFileActivated (); 
     159    CPPUNIT_ASSERT_EQUAL (0,  
     160            g_ascii_strcasecmp ("PDF Viewer", m_View->getTitle ())); 
     161    CPPUNIT_ASSERT (!m_View->isSensitiveGoToFirstPage ()); 
     162    CPPUNIT_ASSERT (!m_View->isSensitiveGoToLastPage ()); 
     163    CPPUNIT_ASSERT (!m_View->isSensitiveGoToNextPage ()); 
     164    CPPUNIT_ASSERT (!m_View->isSensitiveGoToPage ()); 
     165    CPPUNIT_ASSERT (!m_View->isSensitiveGoToPreviousPage ()); 
     166    CPPUNIT_ASSERT (!m_View->isSensitiveZoomIn ()); 
     167    CPPUNIT_ASSERT (!m_View->isSensitiveZoomOut ()); 
     168    CPPUNIT_ASSERT (!m_View->isSensitiveZoomFit ()); 
     169    CPPUNIT_ASSERT (!m_View->isSensitiveZoomWidth ()); 
     170    CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
     171    CPPUNIT_ASSERT (m_View->shownError ()); 
     172 
     173}