]> git.saurik.com Git - wxWidgets.git/commitdiff
Add scaffolding for wxWebView unit tests.
authorSteve Lamerton <steve.lamerton@gmail.com>
Fri, 8 Jul 2011 08:19:25 +0000 (08:19 +0000)
committerSteve Lamerton <steve.lamerton@gmail.com>
Fri, 8 Jul 2011 08:19:25 +0000 (08:19 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68185 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

tests/controls/webtest.cpp [new file with mode: 0644]
tests/test.bkl

diff --git a/tests/controls/webtest.cpp b/tests/controls/webtest.cpp
new file mode 100644 (file)
index 0000000..34cb468
--- /dev/null
@@ -0,0 +1,60 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        tests/controls/webtest.cpp
+// Purpose:     wxWebView unit test
+// Author:      Steven Lamerton
+// Created:     2011-07-08
+// RCS-ID:      $Id$
+// Copyright:   (c) 2011 Steven Lamerton
+///////////////////////////////////////////////////////////////////////////////
+
+#include "testprec.h"
+
+#if wxUSE_WEB
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+    #include "wx/app.h"
+#endif // WX_PRECOMP
+
+#include "testableframe.h"
+#include "wx/uiaction.h"
+#include "wx/webview.h"
+#include "asserthelper.h"
+
+class WebTestCase : public CppUnit::TestCase
+{
+public:
+    WebTestCase() { }
+
+    void setUp();
+    void tearDown();
+
+private:
+    CPPUNIT_TEST_SUITE( WebTestCase );
+    CPPUNIT_TEST_SUITE_END();
+
+    wxWebView* m_browser;
+
+    DECLARE_NO_COPY_CLASS(WebTestCase)
+};
+
+// register in the unnamed registry so that these tests are run by default
+CPPUNIT_TEST_SUITE_REGISTRATION( WebTestCase );
+
+// also include in its own registry so that these tests can be run alone
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( WebTestCase, "WebTestCase" );
+
+void WebTestCase::setUp()
+{
+    m_browser = wxWebView::New(wxTheApp->GetTopWindow(), wxID_ANY, "about:blank");
+}
+
+void WebTestCase::tearDown()
+{
+    wxDELETE(m_browser);
+}
+
+#endif //wxUSE_WEB
index 4087a16b67c2e1a94ae7ba10de3ba2d39bb46c14..80b7eb176c354480a1e857d3084929281f8c8e0d 100644 (file)
             controls/treebooktest.cpp
             controls/treectrltest.cpp
             controls/virtlistctrltest.cpp
+            controls/webtest.cpp
             controls/windowtest.cpp
             events/clone.cpp
             events/propagation.cpp
             window/setsize.cpp
             xml/xrctest.cpp
         </sources>
+        <wx-lib>web</wx-lib>
         <wx-lib>richtext</wx-lib>
         <wx-lib>media</wx-lib>
         <wx-lib>xrc</wx-lib>