Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2750)

Unified Diff: Source/web/tests/RunAllTests.cpp

Issue 412683003: Switch webkit_unit_tests to use the new test launcher. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix gyp for non-component Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/BUILD.gn ('k') | Source/web/tests/WebUnitTests.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/RunAllTests.cpp
diff --git a/Source/web/tests/RunAllTests.cpp b/Source/web/tests/RunAllTests.cpp
index 97fa90b3a5d3e666f6f9bb0000809f63f12b0851..9160a6dce9c01d07f494adce327ad72dd9457821 100644
--- a/Source/web/tests/RunAllTests.cpp
+++ b/Source/web/tests/RunAllTests.cpp
@@ -32,35 +32,28 @@
#include "config.h"
#endif
-// FIXME: Avoid this source dependency on Chromium's base module.
-#include <base/test/test_suite.h>
-
#include "public/platform/Platform.h"
#include "public/web/WebKit.h"
+#include "web/tests/WebUnitTests.h"
#include <content/test/webkit_support.h>
-#if defined(BLINK_DLL_UNITTEST)
-#include "web/tests/WebUnitTests.h"
-#endif
+namespace {
-// TestSuite must be created before SetUpTestEnvironment so it performs
-// initializations needed by WebKit support. This is slightly complicated by the
-// fact that chromium multi-dll build requires that the TestSuite object be created
-// and run inside blink_web.dll.
-int main(int argc, char** argv)
+// Test helpers to support the fact that blink tests are gloriously complicated
+// in a shared library build. See WebUnitTests.h for more details.
+void preTestHook()
{
-#if defined(BLINK_DLL_UNITTEST)
- blink::InitTestSuite(argc, argv);
- content::SetUpTestEnvironmentForUnitTests();
- int result = blink::RunAllUnitTests();
- content::TearDownTestEnvironment();
- blink::DeleteTestSuite();
-#else
- TestSuite testSuite(argc, argv);
content::SetUpTestEnvironmentForUnitTests();
- int result = testSuite.Run();
+}
+
+void postTestHook()
+{
content::TearDownTestEnvironment();
-#endif
+}
- return result;
+} // namespace
+
+int main(int argc, char** argv)
+{
+ return blink::runWebTests(argc, argv, &preTestHook, &postTestHook);
}
« no previous file with comments | « Source/web/BUILD.gn ('k') | Source/web/tests/WebUnitTests.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698