| | 234 | |
| | 235 | /// |
| | 236 | /// @brief Test a good password. |
| | 237 | /// |
| | 238 | /// This test just check that giving the correct password opens the |
| | 239 | /// file correctly. |
| | 240 | /// |
| | 241 | void |
| | 242 | MainPterTest::goodPassword () |
| | 243 | { |
| | 244 | m_View->setOpenFileName ("/tmp/test.pdf"); |
| | 245 | m_View->setPassword ("goodpassword"); |
| | 246 | m_Document->setPassword ("goodpassword"); |
| | 247 | m_Document->setOpenError (DocumentErrorEncrypted); |
| | 248 | m_MainPter->openFileActivated (); |
| | 249 | CPPUNIT_ASSERT_EQUAL (0, |
| | 250 | g_ascii_strcasecmp ("/tmp/test.pdf", m_View->getTitle ())); |
| | 251 | CPPUNIT_ASSERT (!m_View->isSensitiveGoToFirstPage ()); |
| | 252 | CPPUNIT_ASSERT (m_View->isSensitiveGoToLastPage ()); |
| | 253 | CPPUNIT_ASSERT (m_View->isSensitiveGoToNextPage ()); |
| | 254 | CPPUNIT_ASSERT (m_View->isSensitiveGoToPage ()); |
| | 255 | CPPUNIT_ASSERT (!m_View->isSensitiveGoToPreviousPage ()); |
| | 256 | CPPUNIT_ASSERT (m_View->isSensitiveZoomIn ()); |
| | 257 | CPPUNIT_ASSERT (m_View->isSensitiveZoomOut ()); |
| | 258 | CPPUNIT_ASSERT (m_View->isSensitiveZoomFit ()); |
| | 259 | CPPUNIT_ASSERT (m_View->isSensitiveZoomWidth ()); |
| | 260 | CPPUNIT_ASSERT (m_View->hasImagePageView ()); |
| | 261 | CPPUNIT_ASSERT (!m_View->shownError ()); |
| | 262 | CPPUNIT_ASSERT_EQUAL (1, m_View->countTimesShownPasswordPrompt ()); |
| | 263 | } |