| 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 2a3220e0e84829a4a68c26bb6db127be434f9236..dc8ed0f35b4b22b3c4d5cc53fd9c69ba7e856a1a 100644
|
| --- a/third_party/WebKit/Source/platform/testing/RunAllTests.cpp
|
| +++ b/third_party/WebKit/Source/platform/testing/RunAllTests.cpp
|
| @@ -62,6 +62,11 @@ int runTestSuite(base::TestSuite* testSuite)
|
| return result;
|
| }
|
|
|
| +class DummyPlatform final : public blink::Platform {
|
| +public:
|
| + DummyPlatform() { }
|
| +};
|
| +
|
| } // namespace
|
|
|
| int main(int argc, char** argv)
|
| @@ -72,33 +77,35 @@ int main(int argc, char** argv)
|
| WTF::setTimeFunctionsForTesting(dummyCurrentTime);
|
| WTF::initialize(nullptr);
|
| WTF::initializeMainThread(0);
|
| -
|
| - blink::Platform::initialize(nullptr);
|
| - blink::TestingPlatformSupport::Config platformConfig;
|
| - cc_blink::WebCompositorSupportImpl compositorSupport;
|
| - platformConfig.compositorSupport = &compositorSupport;
|
| - blink::TestingPlatformSupport platform(platformConfig);
|
| -
|
| - blink::Heap::init();
|
| - blink::ThreadState::attachMainThread();
|
| - blink::ThreadState::current()->registerTraceDOMWrappers(nullptr, nullptr);
|
| - blink::EventTracer::initialize();
|
| -
|
| - blink::HTTPNames::init();
|
| -
|
| - base::TestSuite testSuite(argc, argv);
|
| -
|
| - mojo::edk::Init();
|
| - base::TestIOThread testIoThread(base::TestIOThread::kAutoStart);
|
| - WTF::OwnPtr<mojo::edk::test::ScopedIPCSupport> ipcSupport(
|
| - adoptPtr(new mojo::edk::test::ScopedIPCSupport(testIoThread.task_runner())));
|
| -
|
| - int result = base::LaunchUnitTests(argc, argv, base::Bind(runTestSuite, base::Unretained(&testSuite)));
|
| -
|
| - blink::ThreadState::detachMainThread();
|
| - blink::Heap::shutdown();
|
| -
|
| - blink::Platform::shutdown();
|
| + int result = 0;
|
| + {
|
| + OwnPtr<DummyPlatform> platform = adoptPtr(new DummyPlatform);
|
| + blink::Platform::initialize(platform.get());
|
| + {
|
| + blink::TestingPlatformSupport::Config platformConfig;
|
| + cc_blink::WebCompositorSupportImpl compositorSupport;
|
| + platformConfig.compositorSupport = &compositorSupport;
|
| + blink::TestingPlatformSupport platform(platformConfig);
|
| +
|
| + blink::Heap::init();
|
| + blink::ThreadState::attachMainThread();
|
| + blink::ThreadState::current()->registerTraceDOMWrappers(nullptr, nullptr);
|
| + blink::EventTracer::initialize();
|
| +
|
| + blink::HTTPNames::init();
|
| +
|
| + base::TestSuite testSuite(argc, argv);
|
| +
|
| + mojo::edk::Init();
|
| + base::TestIOThread testIoThread(base::TestIOThread::kAutoStart);
|
| + WTF::OwnPtr<mojo::edk::test::ScopedIPCSupport> ipcSupport(adoptPtr(new mojo::edk::test::ScopedIPCSupport(testIoThread.task_runner())));
|
| + result = base::LaunchUnitTests(argc, argv, base::Bind(runTestSuite, base::Unretained(&testSuite)));
|
| +
|
| + blink::ThreadState::detachMainThread();
|
| + blink::Heap::shutdown();
|
| + }
|
| + blink::Platform::shutdown();
|
| + }
|
|
|
| WTF::shutdown();
|
| WTF::Partitions::shutdown();
|
|
|