]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/controls/webtest.cpp
Update setup fort OpenVMS
[wxWidgets.git] / tests / controls / webtest.cpp
index 8154a9032b9a48f2fe28e83a909b4ac2700ee343..7ab8a7570e7f382e3067b50b7da282d18f8d8ecd 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "testprec.h"
 
-#if wxUSE_WEB
+#if wxUSE_WEBVIEW && (wxUSE_WEBVIEW_WEBKIT || wxUSE_WEBVIEW_IE)
 
 #ifdef __BORLANDC__
     #pragma hdrstop
@@ -43,6 +43,7 @@ private:
         CPPUNIT_TEST( Editable );
         CPPUNIT_TEST( Selection );
         CPPUNIT_TEST( Zoom );
+        CPPUNIT_TEST( RunScript );
     CPPUNIT_TEST_SUITE_END();
 
     void Title();
@@ -54,6 +55,7 @@ private:
     void Editable();
     void Selection();
     void Zoom();
+    void RunScript();
     void LoadUrl(int times = 1);
 
     wxWebView* m_browser;
@@ -86,9 +88,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();
     }
 }
@@ -236,4 +238,10 @@ void WebTestCase::Zoom()
     }
 }
 
-#endif //wxUSE_WEB
+void WebTestCase::RunScript()
+{
+    m_browser->RunScript("document.write(\"Hello World!\");");
+    CPPUNIT_ASSERT_EQUAL("Hello World!", m_browser->GetPageText());
+}
+
+#endif //wxUSE_WEBVIEW && (wxUSE_WEBVIEW_WEBKIT || wxUSE_WEBVIEW_IE)