Chromium Code Reviews

Unified Diff: third_party/WebKit/Source/platform/testing/RunAllTests.cpp

Issue 1448833003: Run Oilpan GC in blink_platform_unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: technically, base/bind.h and base/bind_helpers.h are the right headers to include (rather than call… Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/weborigin/OriginAccessEntryTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/testing/RunAllTests.cpp
diff --git a/third_party/WebKit/Source/platform/testing/RunAllTests.cpp b/third_party/WebKit/Source/platform/testing/RunAllTests.cpp
index d63549b2954f32c12b87e8dffb6d39cf23cd761b..a449602ab0717c23cff4e1b027e3a3b5758c92ac 100644
--- a/third_party/WebKit/Source/platform/testing/RunAllTests.cpp
+++ b/third_party/WebKit/Source/platform/testing/RunAllTests.cpp
@@ -37,6 +37,9 @@
#include "wtf/MainThread.h"
#include "wtf/Partitions.h"
#include "wtf/WTF.h"
+#include <base/bind.h>
+#include <base/bind_helpers.h>
+#include <base/test/launcher/unit_test_launcher.h>
#include <base/test/test_suite.h>
#include <string.h>
@@ -50,6 +53,14 @@ static void AlwaysZeroNumberSource(unsigned char* buf, size_t len)
memset(buf, '\0', len);
}
+static int runTestSuite(base::TestSuite* testSuite)
+{
+ blink::ThreadState::current()->registerTraceDOMWrappers(nullptr, nullptr);
haraken 2015/11/16 23:30:13 This doesn't need to be called for each test. You
jbroman 2015/11/17 16:16:52 Moved at your request. (I'd put it here to match b
+ int result = testSuite->Run();
+ blink::Heap::collectAllGarbage();
+ return result;
+}
+
int main(int argc, char** argv)
{
WTF::setRandomSource(AlwaysZeroNumberSource);
@@ -62,7 +73,10 @@ int main(int argc, char** argv)
blink::Heap::init();
blink::ThreadState::attachMainThread();
blink::EventTracer::initialize();
- int result = base::RunUnitTestsUsingBaseTestSuite(argc, argv);
+
+ base::TestSuite testSuite(argc, argv);
+ int result = base::LaunchUnitTests(argc, argv, base::Bind(runTestSuite, base::Unretained(&testSuite)));
+
blink::ThreadState::detachMainThread();
blink::Heap::shutdown();
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/weborigin/OriginAccessEntryTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine