Ensure wxWebViewIE::SetPage clears the existing content before writing the new output. Also add a basic unit test to verify correctness in the future.

Fixes #13770

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70041 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Steve Lamerton
2011-12-18 11:51:52 +00:00
parent 913ce2990e
commit 7f98bdd6a5
2 changed files with 49 additions and 18 deletions

View 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)