X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1d156af3247c862e51a7c62f569a3fd302052a42..7f98bdd6a50b7d328a6fb3bd59a95e36f34aa68c:/tests/controls/webtest.cpp?ds=sidebyside diff --git a/tests/controls/webtest.cpp b/tests/controls/webtest.cpp index 0d6bbc5347..41e7adfdfe 100644 --- a/tests/controls/webtest.cpp +++ b/tests/controls/webtest.cpp @@ -9,7 +9,7 @@ #include "testprec.h" -#if wxUSE_WEBVIEW +#if wxUSE_WEBVIEW && (wxUSE_WEBVIEW_WEBKIT || wxUSE_WEBVIEW_IE) #ifdef __BORLANDC__ #pragma hdrstop @@ -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; @@ -88,9 +90,9 @@ void WebTestCase::LoadUrl(int times) for(int i = 0; i < times; i++) { if(i % 2 == 1) - m_browser->LoadUrl("about:blank"); + m_browser->LoadURL("about:blank"); else - m_browser->LoadUrl("about:"); + m_browser->LoadURL("about:"); wxYield(); } } @@ -244,4 +246,13 @@ void WebTestCase::RunScript() CPPUNIT_ASSERT_EQUAL("Hello World!", m_browser->GetPageText()); } -#endif //wxUSE_WEBVIEW +void WebTestCase::SetPage() +{ + m_browser->SetPage("text", ""); + CPPUNIT_ASSERT_EQUAL("text", m_browser->GetPageText()); + + m_browser->SetPage("other text", ""); + CPPUNIT_ASSERT_EQUAL("other text", m_browser->GetPageText()); +} + +#endif //wxUSE_WEBVIEW && (wxUSE_WEBVIEW_WEBKIT || wxUSE_WEBVIEW_IE)