| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/test/launcher/unit_test_launcher.h" | 9 #include "base/test/launcher/unit_test_launcher.h" |
| 10 #include "base/test/test_io_thread.h" | 10 #include "base/test/test_io_thread.h" |
| 11 #include "base/test/test_suite.h" | 11 #include "base/test/test_suite.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 | 13 |
| 14 #if defined(OS_ANDROID) | |
| 15 #include "base/android/jni_android.h" | |
| 16 #include "base/test/test_file_util.h" | |
| 17 #endif | |
| 18 | |
| 19 #if !defined(OS_IOS) | 14 #if !defined(OS_IOS) |
| 20 #include "mojo/edk/embedder/embedder.h" // nogncheck | 15 #include "mojo/edk/embedder/embedder.h" // nogncheck |
| 21 #include "mojo/edk/test/scoped_ipc_support.h" // nogncheck | 16 #include "mojo/edk/test/scoped_ipc_support.h" // nogncheck |
| 22 #endif | 17 #endif |
| 23 | 18 |
| 24 int main(int argc, char** argv) { | 19 int main(int argc, char** argv) { |
| 25 #if defined(OS_ANDROID) | |
| 26 JNIEnv* env = base::android::AttachCurrentThread(); | |
| 27 base::RegisterContentUriTestUtils(env); | |
| 28 #endif | |
| 29 base::TestSuite test_suite(argc, argv); | 20 base::TestSuite test_suite(argc, argv); |
| 30 | 21 |
| 31 #if !defined(OS_IOS) | 22 #if !defined(OS_IOS) |
| 32 mojo::edk::Init(); | 23 mojo::edk::Init(); |
| 33 base::TestIOThread test_io_thread(base::TestIOThread::kAutoStart); | 24 base::TestIOThread test_io_thread(base::TestIOThread::kAutoStart); |
| 34 std::unique_ptr<mojo::edk::test::ScopedIPCSupport> ipc_support; | 25 std::unique_ptr<mojo::edk::test::ScopedIPCSupport> ipc_support; |
| 35 ipc_support.reset( | 26 ipc_support.reset( |
| 36 new mojo::edk::test::ScopedIPCSupport(test_io_thread.task_runner())); | 27 new mojo::edk::test::ScopedIPCSupport(test_io_thread.task_runner())); |
| 37 #endif | 28 #endif |
| 38 | 29 |
| 39 return base::LaunchUnitTests( | 30 return base::LaunchUnitTests( |
| 40 argc, argv, | 31 argc, argv, |
| 41 base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite))); | 32 base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite))); |
| 42 } | 33 } |
| OLD | NEW |