Chromium Code Reviews| 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(); |