+void WebTestCase::Editable()
+{
+ CPPUNIT_ASSERT(!m_browser->IsEditable());
+
+ m_browser->SetEditable(true);
+
+ CPPUNIT_ASSERT(m_browser->IsEditable());
+
+ m_browser->SetEditable(false);
+
+ CPPUNIT_ASSERT(!m_browser->IsEditable());
+}
+
+void WebTestCase::Selection()
+{
+ m_browser->SetPage("<html><body>Some <strong>strong</strong> text</body></html>", "");
+ ENSURE_LOADED;
+ CPPUNIT_ASSERT(!m_browser->HasSelection());
+
+ m_browser->SelectAll();
+
+ CPPUNIT_ASSERT(m_browser->HasSelection());
+ CPPUNIT_ASSERT_EQUAL("Some strong text", m_browser->GetSelectedText());
+ //We lower case the result as ie returns tags in uppercase
+ CPPUNIT_ASSERT_EQUAL("some <strong>strong</strong> text",
+ m_browser->GetSelectedSource().Lower());
+
+ m_browser->ClearSelection();
+ CPPUNIT_ASSERT(!m_browser->HasSelection());
+}
+
+void WebTestCase::Zoom()
+{
+ if(m_browser->CanSetZoomType(wxWEBVIEW_ZOOM_TYPE_LAYOUT))
+ {
+ m_browser->SetZoomType(wxWEBVIEW_ZOOM_TYPE_LAYOUT);
+ CPPUNIT_ASSERT_EQUAL(wxWEBVIEW_ZOOM_TYPE_LAYOUT, m_browser->GetZoomType());
+
+ m_browser->SetZoom(wxWEBVIEW_ZOOM_TINY);
+ CPPUNIT_ASSERT_EQUAL(wxWEBVIEW_ZOOM_TINY, m_browser->GetZoom());
+ }
+
+ //Reset the zoom level
+ m_browser->SetZoom(wxWEBVIEW_ZOOM_MEDIUM);
+
+ if(m_browser->CanSetZoomType(wxWEBVIEW_ZOOM_TYPE_TEXT))
+ {
+ m_browser->SetZoomType(wxWEBVIEW_ZOOM_TYPE_TEXT);
+ CPPUNIT_ASSERT_EQUAL(wxWEBVIEW_ZOOM_TYPE_TEXT, m_browser->GetZoomType());
+
+ m_browser->SetZoom(wxWEBVIEW_ZOOM_TINY);
+ CPPUNIT_ASSERT_EQUAL(wxWEBVIEW_ZOOM_TINY, m_browser->GetZoom());
+ }
+}
+
+void WebTestCase::RunScript()
+{
+ m_browser->RunScript("document.write(\"Hello World!\");");
+ CPPUNIT_ASSERT_EQUAL("Hello World!", m_browser->GetPageText());
+}
+
+void WebTestCase::SetPage()
+{
+ m_browser->SetPage("<html><body>text</body></html>", "");
+ ENSURE_LOADED;
+ CPPUNIT_ASSERT_EQUAL("text", m_browser->GetPageText());
+
+ m_browser->SetPage("<html><body>other text</body></html>", "");
+ ENSURE_LOADED;
+ CPPUNIT_ASSERT_EQUAL("other text", m_browser->GetPageText());
+}
+
+#endif //wxUSE_WEBVIEW && (wxUSE_WEBVIEW_WEBKIT || wxUSE_WEBVIEW_IE)