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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/debugger.h" | 9 #include "base/debug/debugger.h" |
10 #include "base/debug/stack_trace.h" | 10 #include "base/debug/stack_trace.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/files/file_util.h" | 12 #include "base/files/file_util.h" |
13 #include "base/i18n/icu_util.h" | 13 #include "base/i18n/icu_util.h" |
14 #include "base/json/json_reader.h" | 14 #include "base/json/json_reader.h" |
15 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
17 #include "base/path_service.h" | 17 #include "base/path_service.h" |
18 #include "base/process/launch.h" | 18 #include "base/process/launch.h" |
19 #include "base/run_loop.h" | 19 #include "base/run_loop.h" |
20 #include "base/sys_info.h" | 20 #include "base/sys_info.h" |
21 #include "base/threading/thread_task_runner_handle.h" | 21 #include "base/threading/thread_task_runner_handle.h" |
22 #include "base/values.h" | 22 #include "base/values.h" |
23 #include "chrome/test/base/chrome_test_launcher.h" | 23 #include "chrome/test/base/chrome_test_launcher.h" |
24 #include "chrome/test/base/chrome_test_suite.h" | 24 #include "chrome/test/base/chrome_test_suite.h" |
25 #include "chrome/test/base/mojo_test_connector.h" | 25 #include "chrome/test/base/mojo_test_connector.h" |
26 #include "content/public/app/content_main.h" | 26 #include "content/public/app/content_main.h" |
27 #include "content/public/common/service_manager_connection.h" | 27 #include "content/public/common/service_manager_connection.h" |
28 #include "content/public/common/service_names.mojom.h" | |
28 #include "content/public/test/test_launcher.h" | 29 #include "content/public/test/test_launcher.h" |
29 #include "mash/package/mash_packaged_service.h" | 30 #include "mash/package/mash_packaged_service.h" |
30 #include "mash/session/public/interfaces/constants.mojom.h" | 31 #include "mash/session/public/interfaces/constants.mojom.h" |
31 #include "services/service_manager/public/cpp/connector.h" | 32 #include "services/service_manager/public/cpp/connector.h" |
32 #include "services/service_manager/public/cpp/service.h" | 33 #include "services/service_manager/public/cpp/service.h" |
33 #include "services/service_manager/public/cpp/service_context.h" | 34 #include "services/service_manager/public/cpp/service_context.h" |
34 #include "services/service_manager/public/cpp/service_runner.h" | 35 #include "services/service_manager/public/cpp/service_runner.h" |
35 #include "services/service_manager/public/cpp/standalone_service/standalone_serv ice.h" | 36 #include "services/service_manager/public/cpp/standalone_service/standalone_serv ice.h" |
36 #include "services/service_manager/runner/common/switches.h" | 37 #include "services/service_manager/runner/common/switches.h" |
37 #include "services/service_manager/runner/init.h" | 38 #include "services/service_manager/runner/init.h" |
38 #include "services/ui/common/switches.h" | 39 #include "services/ui/common/switches.h" |
39 #include "ui/aura/env.h" | 40 #include "ui/aura/env.h" |
40 | 41 |
41 namespace { | 42 namespace { |
42 | 43 |
43 const base::FilePath::CharType kCatalogFilename[] = | 44 const base::FilePath::CharType kCatalogFilename[] = |
44 FILE_PATH_LITERAL("mash_browser_tests_catalog.json"); | 45 FILE_PATH_LITERAL("mash_browser_tests_catalog.json"); |
45 | 46 |
46 void ConnectToDefaultApps(service_manager::Connector* connector) { | 47 void ConnectToDefaultApps(service_manager::Connector* connector) { |
47 connector->Connect(mash::session::mojom::kServiceName); | 48 connector->Connect(mash::session::mojom::kServiceName); |
49 connector->Connect(content::mojom::kPackagedServicesServiceName); | |
sky
2017/02/28 04:17:57
Why are you changing this?
fwang
2017/02/28 07:06:51
This is only to preserve the behavior that browser
| |
48 } | 50 } |
49 | 51 |
50 class MashTestSuite : public ChromeTestSuite { | 52 class MashTestSuite : public ChromeTestSuite { |
51 public: | 53 public: |
52 MashTestSuite(int argc, char** argv) : ChromeTestSuite(argc, argv) {} | 54 MashTestSuite(int argc, char** argv) : ChromeTestSuite(argc, argv) {} |
53 | 55 |
54 void SetMojoTestConnector(std::unique_ptr<MojoTestConnector> connector) { | 56 void SetMojoTestConnector(std::unique_ptr<MojoTestConnector> connector) { |
55 mojo_test_connector_ = std::move(connector); | 57 mojo_test_connector_ = std::move(connector); |
56 } | 58 } |
57 | 59 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
202 if (command_line->HasSwitch(content::kSingleProcessTestsFlag) && | 204 if (command_line->HasSwitch(content::kSingleProcessTestsFlag) && |
203 !command_line->HasSwitch(switches::kPrimordialPipeToken)) { | 205 !command_line->HasSwitch(switches::kPrimordialPipeToken)) { |
204 service_manager_connection_factory = | 206 service_manager_connection_factory = |
205 base::Bind(&CreateServiceManagerConnection, &delegate); | 207 base::Bind(&CreateServiceManagerConnection, &delegate); |
206 content::ServiceManagerConnection::SetFactoryForTest( | 208 content::ServiceManagerConnection::SetFactoryForTest( |
207 &service_manager_connection_factory); | 209 &service_manager_connection_factory); |
208 } | 210 } |
209 *exit_code = LaunchChromeTests(default_jobs, &delegate, argc, argv); | 211 *exit_code = LaunchChromeTests(default_jobs, &delegate, argc, argv); |
210 return true; | 212 return true; |
211 } | 213 } |
OLD | NEW |