Changeset 66 for trunk/tests/MainPterTest.cxx
- Timestamp:
- 04/15/06 06:57:59 (3 years ago)
- Files:
-
- 1 modified
-
trunk/tests/MainPterTest.cxx (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/MainPterTest.cxx
r65 r66 56 56 /// the main window's title is 'PDF Viewer', the page selection 57 57 /// and zoom actions are unsensitived and the documentView has 58 /// no image yet. 58 /// no image yet. Also the side bar won't be displayed, yet. 59 59 /// 60 60 void … … 76 76 CPPUNIT_ASSERT (!m_View->isSensitiveZoomFit ()); 77 77 CPPUNIT_ASSERT (!m_View->isSensitiveZoomWidth ()); 78 CPPUNIT_ASSERT (!m_View->isShownSidebar ()); 78 79 CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 79 80 } … … 85 86 /// document's file name, if it has no title. Also will sensitive the 86 87 /// go to next page, go to last page and all zoom actions. Also will 87 /// show the document's first page. 88 /// show the document's first page. Since this document don't have 89 /// outline, the sidebar won't be displayed. 88 90 /// 89 91 void … … 106 108 CPPUNIT_ASSERT (m_View->isSensitiveZoomFit ()); 107 109 CPPUNIT_ASSERT (m_View->isSensitiveZoomWidth ()); 110 CPPUNIT_ASSERT (!m_View->isShownSidebar ()); 108 111 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 109 112 … … 125 128 CPPUNIT_ASSERT (m_View->isSensitiveZoomFit ()); 126 129 CPPUNIT_ASSERT (m_View->isSensitiveZoomWidth ()); 130 CPPUNIT_ASSERT (!m_View->isShownSidebar ()); 127 131 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 128 132 } … … 661 665 CPPUNIT_ASSERT_EQUAL (1, m_View->countTimesShownPasswordPrompt ()); 662 666 } 667 668 /// 669 /// @brief Checks that the sidebar is shown when a document has outline. 670 /// 671 /// From now, the sidebar is shown only for the outline (no thumbnails), 672 /// so if a document has outline the sidebar should be shown with it. 673 /// 674 /// When the presenter needs to show the outline, it just passes the root 675 /// outline item to the view, and the view must then render it whatever it 676 /// can (a GtkTreeView in GTK, etc...) 677 /// 678 void 679 MainPterTest::showSidebar () 680 { 681 DocumentOutline *outline = new DocumentOutline (); 682 DocumentOutline *child = new DocumentOutline (); 683 child->setParent (outline); 684 child->setTitle ("Outline 1"); 685 child->setDestination (2); 686 outline->addChild (child); 687 m_Document->setOutline (outline); 688 m_Document->setNumPages (4); 689 690 m_View->setOpenFileName ("/tmp/test.pdf"); 691 m_MainPter->openFileActivated (); 692 CPPUNIT_ASSERT (m_View->isShownSidebar ()); 693 CPPUNIT_ASSERT (outline == m_View->getOutline ()); 694 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 695 696 // When the user does click on a outline item, the view 697 // sends to the presenter the outline that has been activated. 698 // Then the presenter goes to that page. 699 m_MainPter->outlineActivated (child); 700 CPPUNIT_ASSERT_EQUAL (2, m_View->getCurrentPage ()); 701 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 702 }
