summaryrefslogtreecommitdiffstats
path: root/WebKit/chromium/tests/RunAllTests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/chromium/tests/RunAllTests.cpp')
-rw-r--r--WebKit/chromium/tests/RunAllTests.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/WebKit/chromium/tests/RunAllTests.cpp b/WebKit/chromium/tests/RunAllTests.cpp
index 0f3f82f..b213de7 100644
--- a/WebKit/chromium/tests/RunAllTests.cpp
+++ b/WebKit/chromium/tests/RunAllTests.cpp
@@ -33,18 +33,27 @@
#include "WebKit.h"
#include "WebKitClient.h"
+#include <webkit/support/webkit_support.h>
-// WebKitClient has a protected destructor, so we need to subclass.
-class DummyWebKitClient : public WebKit::WebKitClient {
-};
+#if defined(WIN32) && defined(WEBKIT_DLL_UNITTEST)
+#include "WebUnitTests.h"
+#endif
int main(int argc, char** argv)
{
- DummyWebKitClient dummyClient;
- WebKit::initialize(&dummyClient);
+ TestSuite testSuite(argc, argv);
+ // TestSuite must be created before SetUpTestEnvironment so it performs
+ // initializations needed by WebKit support.
+ webkit_support::SetUpTestEnvironmentForUnitTests();
- int result = TestSuite(argc, argv).Run();
+#if defined(WIN32) && defined(WEBKIT_DLL_UNITTEST)
+ // For chromium multi-dll build, need to call webkit api to create a
+ // TestSuite instance in webkit.dll and run all tests from there.
+ int result = WebKit::RunAllUnitTests(argc, argv);
+#else
+ int result = testSuite.Run();
+#endif
- WebKit::shutdown();
+ webkit_support::TearDownTestEnvironment();
return result;
}