]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/controls/webtest.cpp
Ensure wxWebViewIE::SetPage clears the existing content before writing the new output...
[wxWidgets.git] / tests / controls / webtest.cpp
index 7ab8a7570e7f382e3067b50b7da282d18f8d8ecd..41e7adfdfe711ec72c079100ef1e363a3fafad6b 100644 (file)
@@ -44,6 +44,7 @@ private:
         CPPUNIT_TEST( Selection );
         CPPUNIT_TEST( Zoom );
         CPPUNIT_TEST( RunScript );
+        CPPUNIT_TEST( SetPage );
     CPPUNIT_TEST_SUITE_END();
 
     void Title();
@@ -56,6 +57,7 @@ private:
     void Selection();
     void Zoom();
     void RunScript();
+    void SetPage();
     void LoadUrl(int times = 1);
 
     wxWebView* m_browser;
@@ -244,4 +246,13 @@ void WebTestCase::RunScript()
     CPPUNIT_ASSERT_EQUAL("Hello World!", m_browser->GetPageText());
 }
 
+void WebTestCase::SetPage()
+{
+    m_browser->SetPage("<html><body>text</body></html>", "");
+    CPPUNIT_ASSERT_EQUAL("text", m_browser->GetPageText());
+
+    m_browser->SetPage("<html><body>other text</body></html>", "");
+    CPPUNIT_ASSERT_EQUAL("other text", m_browser->GetPageText());
+}
+
 #endif //wxUSE_WEBVIEW && (wxUSE_WEBVIEW_WEBKIT || wxUSE_WEBVIEW_IE)