Changeset 141

Show
Ignore:
Timestamp:
05/01/06 18:00:18 (2 years ago)
Author:
jordi
Message:

I've added a new test fixture for the PagePter? class that just checks that resizing the view changes the current zoom if the zoom to fit or zoom to width options are activated. The two tests are part of the tests with the same name from the MainPterTest?, where were doing the same checks.

In order to do the PagePterTest? work I also had to add a new DumbPageView? class derivated from IPageView.

Now all 41 tests works correctly.

Location:
trunk
Files:
4 added
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/MainPter.cxx

    r140 r141  
    610610    setInitialState (); 
    611611    m_Document->goToFirstPage (); 
     612    notifyPageChanged (1); 
    612613#if defined (DEBUG) 
    613614    G_LOCK (fileLoaded); 
  • trunk/tests/DumbMainView.cxx

    r123 r141  
    1717 
    1818#include <epdfview.h> 
     19#include "DumbPageView.h" 
    1920#include "DumbMainView.h" 
    2021 
     
    2829{ 
    2930    m_CurrentPage = 0; 
    30     // This won't be deleted because it's presenter responsibility. 
    31     m_DocumentPage = NULL; 
    3231    m_GoToPageText = g_strdup (""); 
    3332    m_OpenFileName = g_strdup (""); 
    3433    m_LastOpenFileFolder = NULL; 
    3534    m_Outline = NULL; 
     35    m_PageView = new DumbPageView ();  
    3636    m_Password = NULL; 
    3737    m_SensitiveGoToFirstPage = TRUE; 
     
    7979    m_ZoomToWidth = active; 
    8080} 
     81 
     82IPageView * 
     83DumbMainView::getPageView (void) 
     84{ 
     85    return m_PageView; 
     86} 
    8187             
    8288gchar * 
     
    198204 
    199205void 
    200 DumbMainView::getPageViewSize (gint *width, gint *height) 
    201 { 
    202     *width = 75; 
    203     *height = 50; 
    204 } 
    205  
    206 void 
    207206DumbMainView::setTitle (const gchar *title) 
    208207{ 
     
    232231{ 
    233232    m_ShownError = TRUE; 
    234 } 
    235  
    236 void 
    237 DumbMainView::showPage (DocumentPage *page, PageScroll scroll) 
    238 { 
    239     m_DocumentPage = page; 
    240233} 
    241234 
     
    291284{ 
    292285    return m_TotalPages; 
    293 } 
    294  
    295 gboolean 
    296 DumbMainView::hasImagePageView () 
    297 { 
    298     gboolean shown = (NULL != m_DocumentPage); 
    299     // The next time, it will be FALSE unless it's shown again. 
    300     m_DocumentPage = NULL; 
    301  
    302     return shown; 
    303286} 
    304287 
  • trunk/tests/DumbMainView.h

    r123 r141  
    2121namespace ePDFView  
    2222{ 
     23    // Forward declarations. 
     24    class DumbPageView; 
     25     
    2326    class DumbMainView: public IMainView 
    2427    { 
     
    3033            void activeZoomFit (gboolean active); 
    3134            void activeZoomWidth (gboolean active); 
     35            IPageView *getPageView (void); 
    3236            gchar *openFileDialog (const gchar *lastFolder); 
    3337            gchar *promptPasswordDialog (void); 
     
    4650            void sensitiveZoomWidth (gboolean sensitive); 
    4751            const gchar *getGoToPageText (void); 
    48             void getPageViewSize (gint *width, gint *height); 
    4952            void setCursor (ViewCursor cursorType); 
    5053            void setTotalPages (gint pages); 
     
    5558            void show (void); 
    5659            void showErrorMessage (const gchar *title, const gchar *body); 
    57             void showPage (DocumentPage *page, PageScroll scroll); 
    5860            void showIndex (gboolean show); 
    5961            void showStatusbar (gboolean show); 
     
    6769            const gchar *getTitle (void); 
    6870            gint getTotalPages (void); 
    69             gboolean hasImagePageView (void); 
    7071            gboolean isShown (void); 
    7172            gboolean isSensitiveGoToFirstPage (void); 
     
    9293        protected: 
    9394            gint m_CurrentPage; 
    94             DocumentPage *m_DocumentPage; 
    9595            gchar *m_GoToPageText; 
    9696            gchar *m_LastOpenFileFolder; 
    9797            gchar *m_OpenFileName; 
    9898            DocumentOutline *m_Outline; 
     99            DumbPageView *m_PageView; 
    99100            gchar *m_Password; 
    100101            gboolean m_SensitiveGoToFirstPage; 
  • trunk/tests/MainPterTest.cxx

    r136 r141  
    9191    CPPUNIT_ASSERT (m_View->isShownToolbar ()); 
    9292    CPPUNIT_ASSERT (m_View->isShownStatusbar ()); 
    93     CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    9493} 
    9594 
     
    124123    CPPUNIT_ASSERT (m_View->isSensitiveZoomWidth ()); 
    125124    CPPUNIT_ASSERT (!m_View->isShownIndex ()); 
    126     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    127125 
    128126    // Now try a document with a title. 
     
    145143    CPPUNIT_ASSERT (m_View->isSensitiveZoomWidth ()); 
    146144    CPPUNIT_ASSERT (!m_View->isShownIndex ()); 
    147     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    148145} 
    149146 
     
    173170    CPPUNIT_ASSERT (!m_View->isSensitiveZoomFit ()); 
    174171    CPPUNIT_ASSERT (!m_View->isSensitiveZoomWidth ()); 
    175     CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    176172    CPPUNIT_ASSERT (!m_View->shownError ()); 
    177173} 
     
    206202    CPPUNIT_ASSERT (!m_View->isSensitiveZoomFit ()); 
    207203    CPPUNIT_ASSERT (!m_View->isSensitiveZoomWidth ()); 
    208     CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    209204    CPPUNIT_ASSERT (m_View->shownError ()); 
    210205} 
     
    240235    CPPUNIT_ASSERT (!m_View->isSensitiveZoomFit ()); 
    241236    CPPUNIT_ASSERT (!m_View->isSensitiveZoomWidth ()); 
    242     CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    243237    CPPUNIT_ASSERT (!m_View->shownError ()); 
    244238} 
     
    274268    CPPUNIT_ASSERT (!m_View->isSensitiveZoomFit ()); 
    275269    CPPUNIT_ASSERT (!m_View->isSensitiveZoomWidth ()); 
    276     CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    277270    CPPUNIT_ASSERT (m_View->shownError ()); 
    278271    CPPUNIT_ASSERT_EQUAL (3, m_View->countTimesShownPasswordPrompt ()); 
     
    308301    CPPUNIT_ASSERT (m_View->isSensitiveZoomFit ()); 
    309302    CPPUNIT_ASSERT (m_View->isSensitiveZoomWidth ()); 
    310     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    311303    CPPUNIT_ASSERT (!m_View->shownError ()); 
    312304    CPPUNIT_ASSERT_EQUAL (1, m_View->countTimesShownPasswordPrompt ()); 
     
    357349    CPPUNIT_ASSERT_EQUAL (4, m_View->getTotalPages ()); 
    358350    CPPUNIT_ASSERT_EQUAL (1, m_View->getCurrentPage ()); 
    359     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    360     // This is to check that after calling this function, it returns false 
    361     // because no page can be shown between the two... (I didn't called 
    362     // the presenter or the view, yet) 
    363     CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    364351    // Going to the next page should make all actions sensitive. 
    365352    m_MainPter->goToNextPageActivated (); 
     
    370357    CPPUNIT_ASSERT (m_View->isSensitiveGoToPage ()); 
    371358    CPPUNIT_ASSERT (m_View->isSensitiveGoToPreviousPage ()); 
    372     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    373359    // Going to the last will make some insensitive. 
    374360    m_MainPter->goToLastPageActivated (); 
     
    379365    CPPUNIT_ASSERT (m_View->isSensitiveGoToPage ()); 
    380366    CPPUNIT_ASSERT (m_View->isSensitiveGoToPreviousPage ()); 
    381     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    382367    // Again to the last won't harm (just in case...) nor going next. 
    383368    m_MainPter->goToLastPageActivated (); 
     
    389374    CPPUNIT_ASSERT (m_View->isSensitiveGoToPage ()); 
    390375    CPPUNIT_ASSERT (m_View->isSensitiveGoToPreviousPage ()); 
    391     // Since the page hasn't changed, no image preview is shown. 
    392     CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    393376    // But going to the previous will change something. 
    394377    m_MainPter->goToPreviousPageActivated (); 
     
    399382    CPPUNIT_ASSERT (m_View->isSensitiveGoToPage ()); 
    400383    CPPUNIT_ASSERT (m_View->isSensitiveGoToPreviousPage ()); 
    401     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    402     CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    403384    // Now, to the first again. 
    404385    m_MainPter->goToFirstPageActivated (); 
     
    409390    CPPUNIT_ASSERT (m_View->isSensitiveGoToPage ()); 
    410391    CPPUNIT_ASSERT (!m_View->isSensitiveGoToPreviousPage ()); 
    411     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    412392    // Check sane behaviour. 
    413393    m_MainPter->goToFirstPageActivated (); 
     
    419399    CPPUNIT_ASSERT (m_View->isSensitiveGoToPage ()); 
    420400    CPPUNIT_ASSERT (!m_View->isSensitiveGoToPreviousPage ()); 
    421     // The page hasn't changed. 
    422     CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    423401} 
    424402 
     
    440418    CPPUNIT_ASSERT_EQUAL (4, m_View->getTotalPages ()); 
    441419    CPPUNIT_ASSERT_EQUAL (1, m_View->getCurrentPage ()); 
    442     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    443420 
    444421    // Now try again using the page entry on toolbar. 
     
    451428    CPPUNIT_ASSERT (m_View->isSensitiveGoToPage ()); 
    452429    CPPUNIT_ASSERT (m_View->isSensitiveGoToPreviousPage ()); 
    453     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    454430 
    455431    m_View->setGoToPageText ("4 of 4"); 
     
    461437    CPPUNIT_ASSERT (m_View->isSensitiveGoToPage ()); 
    462438    CPPUNIT_ASSERT (m_View->isSensitiveGoToPreviousPage ()); 
    463     CPPUNIT_ASSERT (m_View->hasImagePageView ());     
    464439 
    465440    m_View->setGoToPageText ("1 of 4"); 
     
    471446    CPPUNIT_ASSERT (m_View->isSensitiveGoToPage ()); 
    472447    CPPUNIT_ASSERT (!m_View->isSensitiveGoToPreviousPage ()); 
    473     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    474448 
    475449    // Invalid values. Remains to the same page. 
     
    482456    CPPUNIT_ASSERT (m_View->isSensitiveGoToPage ()); 
    483457    CPPUNIT_ASSERT (!m_View->isSensitiveGoToPreviousPage ()); 
    484     // Since the page hasn't changed, no image preview is shown. 
    485     CPPUNIT_ASSERT (!m_View->hasImagePageView ());     
    486458 
    487459    m_View->setGoToPageText ("0 of 12"); 
     
    493465    CPPUNIT_ASSERT (m_View->isSensitiveGoToPage ()); 
    494466    CPPUNIT_ASSERT (!m_View->isSensitiveGoToPreviousPage ()); 
    495     CPPUNIT_ASSERT (!m_View->hasImagePageView ());     
    496467 
    497468    m_MainPter->goToNextPageActivated (); 
    498     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    499469    m_View->setGoToPageText ("Jejej :-)"); 
    500470    m_MainPter->goToPageActivated (); 
     
    505475    CPPUNIT_ASSERT (m_View->isSensitiveGoToPage ()); 
    506476    CPPUNIT_ASSERT (m_View->isSensitiveGoToPreviousPage ()); 
    507     CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    508477} 
    509478 
     
    519488    m_MainPter->openFileActivated (); 
    520489    m_MainPter->waitForFileLoaded (); 
    521     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    522     CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    523490    CPPUNIT_ASSERT_EQUAL (0, m_Document->getRotation ()); 
    524491 
    525492    m_MainPter->rotateRightActivated ();  
    526     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    527     CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    528493    CPPUNIT_ASSERT_EQUAL (90, m_Document->getRotation ()); 
    529494 
    530495    m_MainPter->rotateLeftActivated ();  
    531     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    532     CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    533496    CPPUNIT_ASSERT_EQUAL (0, m_Document->getRotation ()); 
    534497} 
     
    548511    m_MainPter->openFileActivated (); 
    549512    m_MainPter->waitForFileLoaded (); 
    550     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    551     CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    552513    CPPUNIT_ASSERT_DOUBLES_EQUAL (1.0, m_Document->getZoom (), 0.0001); 
    553514 
    554515    m_MainPter->zoomInActivated (); 
    555     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    556     CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    557516    CPPUNIT_ASSERT_DOUBLES_EQUAL (1.2, m_Document->getZoom (), 0.0001); 
    558517 
    559518    m_MainPter->zoomOutActivated (); 
    560     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    561     CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    562519    CPPUNIT_ASSERT_DOUBLES_EQUAL (1.0, m_Document->getZoom (), 0.0001); 
    563520    
     
    588545    m_MainPter->openFileActivated (); 
    589546    m_MainPter->waitForFileLoaded (); 
    590     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    591     CPPUNIT_ASSERT_DOUBLES_EQUAL (1.0, m_Document->getZoom (), 0.0001); 
    592  
    593     // OK, now try to zoom width. Since rotation is 0 
    594     // the zoom level should be 75/100 = 0.75 
     547     
    595548    m_MainPter->zoomWidthActivated (TRUE); 
    596549    CPPUNIT_ASSERT (m_View->isZoomToWidthActive ()); 
    597     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    598     CPPUNIT_ASSERT_DOUBLES_EQUAL (0.75, m_Document->getZoom (), 0.0001); 
    599  
    600     // Now change the view size. We do this calling the main presenter's 
    601     // function instead of the view, because the view here don't have anything 
    602     // to do. 
    603     // The new zoom should be 50/100 = 0.5 
    604     m_MainPter->pageViewResized (50, 50); 
    605     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    606     CPPUNIT_ASSERT_DOUBLES_EQUAL (0.5, m_Document->getZoom (), 0.0001); 
    607      
    608     m_MainPter->pageViewResized (75, 50); 
    609     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    610     CPPUNIT_ASSERT_DOUBLES_EQUAL (0.75, m_Document->getZoom (), 0.0001); 
    611  
    612     // If we desactive the zoom to width, no resizing changes the 
    613     // zoom. 
    614550    m_MainPter->zoomWidthActivated (FALSE); 
    615551    CPPUNIT_ASSERT (!m_View->isZoomToWidthActive ()); 
    616     m_MainPter->pageViewResized (50, 50); 
    617     CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    618     CPPUNIT_ASSERT_DOUBLES_EQUAL (0.75, m_Document->getZoom (), 0.0001); 
    619     m_MainPter->pageViewResized (100, 50); 
    620     CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    621     CPPUNIT_ASSERT_DOUBLES_EQUAL (0.75, m_Document->getZoom (), 0.0001); 
    622  
    623     // Now rotate and try again. 
    624     m_MainPter->rotateRightActivated ();  
    625     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    626     CPPUNIT_ASSERT_EQUAL (90, m_Document->getRotation ());     
    627     // Since rotation is now 90 the zoom level should be 75/250 = 0.3 
    628552    m_MainPter->zoomWidthActivated (TRUE); 
    629553    CPPUNIT_ASSERT (m_View->isZoomToWidthActive ()); 
    630     CPPUNIT_ASSERT_DOUBLES_EQUAL (0.3, m_Document->getZoom (), 0.0001); 
    631     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    632     // Resizing. 50/250 = 0.2 
    633     m_MainPter->pageViewResized (50, 50); 
    634     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    635     CPPUNIT_ASSERT_DOUBLES_EQUAL (0.2, m_Document->getZoom (), 0.0001); 
    636  
    637     // Changing any of the zoom in or zoom out features should make the  
     554    // Changing any of the zoom in or zoom out features should make the 
    638555    // zoom to width not being active. 
    639556    m_MainPter->zoomInActivated (); 
     
    653570    m_MainPter->openFileActivated (); 
    654571    m_MainPter->waitForFileLoaded (); 
    655     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    656     CPPUNIT_ASSERT_DOUBLES_EQUAL (1.0, m_Document->getZoom (), 0.0001); 
    657  
    658     // OK, now try to zoom to fit. Since rotation is 0 
    659     // the zoom level should be 50/250 = 0.2 
     572     
    660573    m_MainPter->zoomFitActivated (TRUE); 
    661574    CPPUNIT_ASSERT (m_View->isZoomToFitActive ()); 
    662     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    663     CPPUNIT_ASSERT_DOUBLES_EQUAL (0.2, m_Document->getZoom (), 0.0001); 
    664  
    665     // Resizing the view size. 100/250 = 0.4 
    666     m_MainPter->pageViewResized (100, 100); 
    667     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    668     CPPUNIT_ASSERT_DOUBLES_EQUAL (0.4, m_Document->getZoom (), 0.0001); 
    669     m_MainPter->pageViewResized (100, 50); 
    670     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    671     CPPUNIT_ASSERT_DOUBLES_EQUAL (0.2, m_Document->getZoom (), 0.0001); 
    672  
    673     // Desactivating the zoom to fit. 
    674575    m_MainPter->zoomFitActivated (FALSE); 
    675576    CPPUNIT_ASSERT (!m_View->isZoomToFitActive ()); 
    676     m_MainPter->pageViewResized (100, 100); 
    677     CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    678     CPPUNIT_ASSERT_DOUBLES_EQUAL (0.2, m_Document->getZoom (), 0.0001); 
    679     m_MainPter->pageViewResized (100, 50); 
    680     CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    681     CPPUNIT_ASSERT_DOUBLES_EQUAL (0.2, m_Document->getZoom (), 0.0001); 
    682  
    683     // Now rotate and try again. 
    684     m_MainPter->rotateRightActivated ();  
    685     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    686     CPPUNIT_ASSERT_EQUAL (90, m_Document->getRotation ()); 
    687      
    688     // Since rotation is now 90 the zoom level should be 75/250 = 0.3 
    689577    m_MainPter->zoomFitActivated (TRUE); 
    690578    CPPUNIT_ASSERT (m_View->isZoomToFitActive ()); 
    691     CPPUNIT_ASSERT_DOUBLES_EQUAL (0.3, m_Document->getZoom (), 0.0001); 
    692     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    693     // 100/250 = 0.4 
    694     m_MainPter->pageViewResized (100, 100); 
    695     CPPUNIT_ASSERT_DOUBLES_EQUAL (0.4, m_Document->getZoom (), 0.0001); 
    696     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    697      
    698     // Changing any of the zoom in or zoom out features should make the  
     579    // Changing any of the zoom in or zoom out features should make the 
    699580    // zoom to fit not being active. 
    700581    m_MainPter->zoomInActivated (); 
     
    717598    m_MainPter->openFileActivated (); 
    718599    m_MainPter->waitForFileLoaded (); 
    719     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    720600    CPPUNIT_ASSERT_DOUBLES_EQUAL (1.0, m_Document->getZoom (), 0.0001); 
    721601 
     
    761641    m_MainPter->openFileActivated (); 
    762642    m_MainPter->waitForFileLoaded (); 
    763     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    764643 
    765644    m_MainPter->goToNextPageActivated (); 
     
    769648    CPPUNIT_ASSERT_EQUAL (90, m_Document->getRotation ());  
    770649    CPPUNIT_ASSERT_DOUBLES_EQUAL (0.3, m_Document->getZoom (), 0.0001); 
    771     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    772650 
    773651    // Reload the document. 
     
    779657    CPPUNIT_ASSERT_EQUAL (90, m_Document->getRotation ());  
    780658    CPPUNIT_ASSERT_DOUBLES_EQUAL (0.3, m_Document->getZoom (), 0.0001); 
    781     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    782659} 
    783660 
     
    797674    m_MainPter->openFileActivated (); 
    798675    m_MainPter->waitForFileLoaded (); 
    799     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    800676    CPPUNIT_ASSERT_EQUAL (0,  
    801677            g_ascii_strcasecmp ("/tmp/test.pdf", m_View->getTitle ())); 
     
    807683    CPPUNIT_ASSERT_EQUAL (90, m_Document->getRotation ());  
    808684    CPPUNIT_ASSERT_DOUBLES_EQUAL (0.3, m_Document->getZoom (), 0.0001); 
    809     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    810685 
    811686    // Reload the document. 
     
    820695    CPPUNIT_ASSERT_EQUAL (90, m_Document->getRotation ());  
    821696    CPPUNIT_ASSERT_DOUBLES_EQUAL (0.3, m_Document->getZoom (), 0.0001); 
    822     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    823697    CPPUNIT_ASSERT (!m_View->shownError ()); 
    824698    CPPUNIT_ASSERT_EQUAL (0, m_View->countTimesShownPasswordPrompt ()); 
     
    840714    m_MainPter->openFileActivated (); 
    841715    m_MainPter->waitForFileLoaded (); 
    842     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    843716    CPPUNIT_ASSERT_EQUAL (0,  
    844717            g_ascii_strcasecmp ("/tmp/test.pdf", m_View->getTitle ())); 
     
    850723    CPPUNIT_ASSERT_EQUAL (90, m_Document->getRotation ());  
    851724    CPPUNIT_ASSERT_DOUBLES_EQUAL (0.3, m_Document->getZoom (), 0.0001); 
    852     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    853725 
    854726    // Reload the document. 
     
    867739    CPPUNIT_ASSERT_EQUAL (90, m_Document->getRotation ());  
    868740    CPPUNIT_ASSERT_DOUBLES_EQUAL (0.3, m_Document->getZoom (), 0.0001); 
    869     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    870741    CPPUNIT_ASSERT (!m_View->shownError ()); 
    871742    CPPUNIT_ASSERT_EQUAL (1, m_View->countTimesShownPasswordPrompt ()); 
     
    897768    CPPUNIT_ASSERT (m_View->isShownIndex ()); 
    898769    CPPUNIT_ASSERT (outline == m_View->getOutline ()); 
    899     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    900770 
    901771    // When the user does click on a outline item, the view 
     
    904774    m_MainPter->outlineActivated (child); 
    905775    CPPUNIT_ASSERT_EQUAL (2, m_View->getCurrentPage ()); 
    906     CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    907776 
    908777    // When the user clicks on the "Show Index" option, the 
  • trunk/tests/Makefile.am

    r136 r141  
    1818    DumbMainView.cxx        \ 
    1919    DumbMainView.h          \ 
     20    DumbPageView.cxx    \ 
     21    DumbPageView.h  \ 
    2022    main.cxx                \ 
    2123    MainPterTest.cxx    \ 
    2224    MainPterTest.h  \ 
     25    PagePterTest.cxx    \ 
     26    PagePterTest.h  \ 
    2327    PDFDocumentTest.cxx \ 
    2428    PDFDocumentTest.h   \