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 a852c3c82cebb30a1b8dd506a3c2bc4c712dcb5f..93c7ae7ff317dea43c3819ba378481e215f9015c 100644 |
| --- a/third_party/WebKit/Source/platform/testing/RunAllTests.cpp |
| +++ b/third_party/WebKit/Source/platform/testing/RunAllTests.cpp |
| @@ -28,10 +28,14 @@ |
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| */ |
| +#include "base/command_line.h" |
| +#include "base/test/test_io_thread.h" |
| #include "platform/EventTracer.h" |
| #include "platform/HTTPNames.h" |
| #include "platform/heap/Heap.h" |
| #include "platform/testing/TestingPlatformSupport.h" |
| +#include "third_party/mojo/src/mojo/edk/embedder/embedder.h" |
| +#include "third_party/mojo/src/mojo/edk/test/scoped_ipc_support.h" |
| #include "wtf/CryptographicallyRandomNumber.h" |
| #include "wtf/MainThread.h" |
| #include "wtf/Partitions.h" |
| @@ -43,18 +47,29 @@ |
| #include <cc/blink/web_compositor_support_impl.h> |
| #include <string.h> |
| -static double CurrentTime() |
| +namespace { |
| + |
| +double CurrentTime() |
| { |
| return 0.0; |
| } |
| -static int runTestSuite(base::TestSuite* testSuite) |
| +void InitializeMojo() |
| +{ |
| + base::CommandLine::ForCurrentProcess()->AppendSwitch("use-new-edk"); |
| + mojo::embedder::PreInitializeParentProcess(); |
| + mojo::embedder::Init(); |
| +} |
| + |
| +int runTestSuite(base::TestSuite* testSuite) |
| { |
| int result = testSuite->Run(); |
| blink::Heap::collectAllGarbage(); |
| return result; |
| } |
| +} // namespace |
| + |
| int main(int argc, char** argv) |
| { |
| WTF::Partitions::initialize(nullptr); |
| @@ -75,6 +90,12 @@ int main(int argc, char** argv) |
| blink::HTTPNames::init(); |
| base::TestSuite testSuite(argc, argv); |
| + |
| + InitializeMojo(); |
| + base::TestIOThread testIoThread(base::TestIOThread::kAutoStart); |
| + WTF::OwnPtr<mojo::test::ScopedIPCSupport> ipcSupport( |
| + adoptPtr(new mojo::test::ScopedIPCSupport(testIoThread.task_runner()))); |
|
haraken
2016/02/09 12:01:21
Shall we rename InitializeMojo to InitializePlatfo
Yuki
2016/02/12 12:36:14
No. We'd like to keep a ScopedIPCSupport alive wh
|
| + |
| int result = base::LaunchUnitTests(argc, argv, base::Bind(runTestSuite, base::Unretained(&testSuite))); |
| blink::ThreadState::detachMainThread(); |