OLD | NEW |
| (Empty) |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "base/at_exit.h" | |
6 #include "base/bind.h" | |
7 #include "base/test/launcher/unit_test_launcher.h" | |
8 #include "base/test/multiprocess_test.h" | |
9 #include "base/test/test_io_thread.h" | |
10 #include "base/test/test_suite.h" | |
11 #include "build/build_config.h" | |
12 #include "mojo/edk/embedder/embedder.h" | |
13 #include "mojo/edk/test/scoped_ipc_support.h" | |
14 | |
15 #if defined(OS_ANDROID) | |
16 #include "base/android/jni_android.h" | |
17 #include "base/test/test_file_util.h" | |
18 #endif | |
19 | |
20 int main(int argc, char** argv) { | |
21 #if defined(OS_ANDROID) | |
22 // Enable the alternate test child implementation. This is needed because Mojo | |
23 // tests need to spawn test children after initialising the Mojo system. | |
24 base::InitAndroidMultiProcessTestHelper(main); | |
25 | |
26 JNIEnv* env = base::android::AttachCurrentThread(); | |
27 base::RegisterContentUriTestUtils(env); | |
28 #endif | |
29 base::TestSuite test_suite(argc, argv); | |
30 mojo::edk::Init(); | |
31 base::TestIOThread test_io_thread(base::TestIOThread::kAutoStart); | |
32 // Leak this because its destructor calls mojo::edk::ShutdownIPCSupport which | |
33 // really does nothing in the new EDK but does depend on the current message | |
34 // loop, which is destructed inside base::LaunchUnitTests. | |
35 new mojo::edk::test::ScopedIPCSupport(test_io_thread.task_runner()); | |
36 return base::LaunchUnitTestsSerially( | |
37 argc, argv, | |
38 base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite))); | |
39 } | |
OLD | NEW |