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

Unified Diff: Source/web/tests/WebUnitTests.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/tests/WebUnitTests.h ('k') | Source/web/web.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/WebUnitTests.cpp
diff --git a/Source/web/tests/WebUnitTests.cpp b/Source/web/tests/WebUnitTests.cpp
index f07b93718866c8b95a1a58d22115b7e20627c7c5..04ac4e8bdd1c781811b2a0d8b15b56932a8fc935 100644
--- a/Source/web/tests/WebUnitTests.cpp
+++ b/Source/web/tests/WebUnitTests.cpp
@@ -31,29 +31,30 @@
#include "config.h"
#include "web/tests/WebUnitTests.h"
-// FIXME: Can we move this to webkit/support and fix the layering violation?
+#include <base/bind.h>
+#include <base/message_loop/message_loop.h>
+#include <base/run_loop.h>
+#include <base/test/launcher/unit_test_launcher.h>
#include <base/test/test_suite.h>
-static TestSuite* testSuite = 0;
-
namespace blink {
-void InitTestSuite(int argc, char** argv)
-{
- testSuite = new TestSuite(argc, argv);
-}
+namespace {
-int RunAllUnitTests()
+int runHelper(TestSuite* testSuite, void (*preTestHook)(void), void (*postTestHook)(void))
{
+ preTestHook();
int result = testSuite->Run();
-
+ postTestHook();
return result;
}
-void DeleteTestSuite()
+} // namespace
+
+int runWebTests(int argc, char** argv, void (*preTestHook)(void), void (*postTestHook)(void))
{
- delete testSuite;
- testSuite = 0;
+ TestSuite testSuite(argc, argv);
+ return base::LaunchUnitTests(argc, argv, base::Bind(&runHelper, base::Unretained(&testSuite), preTestHook, postTestHook));
}
} // namespace blink
« no previous file with comments | « Source/web/tests/WebUnitTests.h ('k') | Source/web/web.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698