| | 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 | /// |
| | 153 | void |
| | 154 | MainPterTest::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 | } |