OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | |
6 #include "base/test/launcher/unit_test_launcher.h" | 7 #include "base/test/launcher/unit_test_launcher.h" |
8 #include "base/test/test_io_thread.h" | |
7 #include "content/app/mojo/mojo_init.h" | 9 #include "content/app/mojo/mojo_init.h" |
8 #include "content/public/test/unittest_test_suite.h" | 10 #include "content/public/test/unittest_test_suite.h" |
9 #include "content/test/content_test_suite.h" | 11 #include "content/test/content_test_suite.h" |
12 #include "third_party/mojo/src/mojo/edk/test/scoped_ipc_support.h" | |
10 | 13 |
11 #if defined(OS_ANDROID) | 14 #if defined(OS_ANDROID) |
12 #include "base/android/jni_android.h" | 15 #include "base/android/jni_android.h" |
13 #include "base/test/test_file_util.h" | 16 #include "base/test/test_file_util.h" |
14 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 17 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
15 #endif | 18 #endif |
16 | 19 |
17 int main(int argc, char** argv) { | 20 int main(int argc, char** argv) { |
18 #if defined(OS_ANDROID) | 21 #if defined(OS_ANDROID) |
19 // Register JNI bindings for android. | 22 // Register JNI bindings for android. |
20 base::RegisterContentUriTestUtils(base::android::AttachCurrentThread()); | 23 base::RegisterContentUriTestUtils(base::android::AttachCurrentThread()); |
21 #endif | 24 #endif |
22 content::UnitTestTestSuite test_suite( | 25 content::UnitTestTestSuite test_suite( |
23 new content::ContentTestSuite(argc, argv)); | 26 new content::ContentTestSuite(argc, argv)); |
24 #if !defined(OS_IOS) | 27 #if !defined(OS_IOS) |
25 content::InitializeMojo(); | 28 content::InitializeMojo(); |
29 base::TestIOThread test_io_thread(base::TestIOThread::kAutoStart); | |
yzshen1
2015/12/10 17:52:25
Is line 29 needed if we don't use-new-edk?
jam
2015/12/10 18:02:48
no, but i figured no harm done in leaving it. as o
| |
30 scoped_ptr<mojo::test::ScopedIPCSupport> ipc_support; | |
31 if (base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk")) { | |
32 ipc_support.reset(new mojo::test::ScopedIPCSupport( | |
33 test_io_thread.task_runner())); | |
34 } | |
26 #endif | 35 #endif |
27 | 36 |
28 return base::LaunchUnitTests( | 37 return base::LaunchUnitTests( |
29 argc, argv, base::Bind(&content::UnitTestTestSuite::Run, | 38 argc, argv, base::Bind(&content::UnitTestTestSuite::Run, |
30 base::Unretained(&test_suite))); | 39 base::Unretained(&test_suite))); |
31 } | 40 } |
OLD | NEW |