]> git.saurik.com Git - wxWidgets.git/commitdiff
Add tests for the back and forward history lists.
authorSteve Lamerton <steve.lamerton@gmail.com>
Fri, 8 Jul 2011 14:35:49 +0000 (14:35 +0000)
committerSteve Lamerton <steve.lamerton@gmail.com>
Fri, 8 Jul 2011 14:35:49 +0000 (14:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68190 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

tests/controls/webtest.cpp

index 74360c9c5386f42a18dfc2597f295b3cc66442c6..aba77363462f3b804b39d97a3835b35ef4847447 100644 (file)
@@ -39,6 +39,7 @@ private:
         CPPUNIT_TEST( History );
         CPPUNIT_TEST( HistoryEnable );
         CPPUNIT_TEST( HistoryClear );
+        CPPUNIT_TEST( HistoryList );
     CPPUNIT_TEST_SUITE_END();
 
     void Title();
@@ -46,6 +47,7 @@ private:
     void History();
     void HistoryEnable();
     void HistoryClear();
+    void HistoryList();
 
     wxWebView* m_browser;
 
@@ -156,4 +158,23 @@ void WebTestCase::HistoryClear()
     CPPUNIT_ASSERT(!m_browser->CanGoBack());
 }
 
+void WebTestCase::HistoryList()
+{
+    m_browser->LoadUrl("about:blank");
+    wxYield();
+
+    m_browser->LoadUrl("about:blank");
+    wxYield();
+
+    m_browser->GoBack();
+
+    CPPUNIT_ASSERT_EQUAL(1, m_browser->GetBackwardHistory().size());
+    CPPUNIT_ASSERT_EQUAL(1, m_browser->GetForwardHistory().size());
+
+    m_browser->LoadHistoryItem(m_browser->GetForwardHistory()[0]);
+
+    CPPUNIT_ASSERT(!m_browser->CanGoForward());
+    CPPUNIT_ASSERT_EQUAL(2, m_browser->GetBackwardHistory().size());
+}
+
 #endif //wxUSE_WEB