| 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..439f2c8f72907ca50c3adddcabf46cbf11369774 100644
|
| --- a/third_party/WebKit/Source/platform/testing/RunAllTests.cpp
|
| +++ b/third_party/WebKit/Source/platform/testing/RunAllTests.cpp
|
| @@ -28,10 +28,15 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| +#include "base/command_line.h"
|
| +#include "base/message_loop/message_loop.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 +48,30 @@
|
| #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)
|
| {
|
| + base::MessageLoop messageLoop;
|
| int result = testSuite->Run();
|
| blink::Heap::collectAllGarbage();
|
| return result;
|
| }
|
|
|
| +} // namespace
|
| +
|
| int main(int argc, char** argv)
|
| {
|
| WTF::Partitions::initialize(nullptr);
|
| @@ -75,6 +92,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())));
|
| +
|
| int result = base::LaunchUnitTests(argc, argv, base::Bind(runTestSuite, base::Unretained(&testSuite)));
|
|
|
| blink::ThreadState::detachMainThread();
|
|
|