Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Side by Side Diff: chrome/test/base/mash_browser_tests_main.cc

Issue 2713223002: Use mash::session::mojom::kServiceName instead of a hardcoded string (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/test/DEPS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/test/test_launcher.h" 28 #include "content/public/test/test_launcher.h"
29 #include "mash/package/mash_packaged_service.h" 29 #include "mash/package/mash_packaged_service.h"
30 #include "mash/session/public/interfaces/constants.mojom.h"
30 #include "services/service_manager/public/cpp/connector.h" 31 #include "services/service_manager/public/cpp/connector.h"
31 #include "services/service_manager/public/cpp/service.h" 32 #include "services/service_manager/public/cpp/service.h"
32 #include "services/service_manager/public/cpp/service_context.h" 33 #include "services/service_manager/public/cpp/service_context.h"
33 #include "services/service_manager/public/cpp/service_runner.h" 34 #include "services/service_manager/public/cpp/service_runner.h"
34 #include "services/service_manager/public/cpp/standalone_service/standalone_serv ice.h" 35 #include "services/service_manager/public/cpp/standalone_service/standalone_serv ice.h"
35 #include "services/service_manager/runner/common/switches.h" 36 #include "services/service_manager/runner/common/switches.h"
36 #include "services/service_manager/runner/init.h" 37 #include "services/service_manager/runner/init.h"
37 #include "services/ui/common/switches.h" 38 #include "services/ui/common/switches.h"
38 #include "ui/aura/env.h" 39 #include "ui/aura/env.h"
39 40
40 namespace { 41 namespace {
41 42
42 const base::FilePath::CharType kCatalogFilename[] = 43 const base::FilePath::CharType kCatalogFilename[] =
43 FILE_PATH_LITERAL("mash_browser_tests_catalog.json"); 44 FILE_PATH_LITERAL("mash_browser_tests_catalog.json");
44 45
45 void ConnectToDefaultApps(service_manager::Connector* connector) { 46 void ConnectToDefaultApps(service_manager::Connector* connector) {
46 connector->Connect("mash_session"); 47 connector->Connect(mash::session::mojom::kServiceName);
47 } 48 }
48 49
49 class MashTestSuite : public ChromeTestSuite { 50 class MashTestSuite : public ChromeTestSuite {
50 public: 51 public:
51 MashTestSuite(int argc, char** argv) : ChromeTestSuite(argc, argv) {} 52 MashTestSuite(int argc, char** argv) : ChromeTestSuite(argc, argv) {}
52 53
53 void SetMojoTestConnector(std::unique_ptr<MojoTestConnector> connector) { 54 void SetMojoTestConnector(std::unique_ptr<MojoTestConnector> connector) {
54 mojo_test_connector_ = std::move(connector); 55 mojo_test_connector_ = std::move(connector);
55 } 56 }
56 57
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 if (command_line->HasSwitch(content::kSingleProcessTestsFlag) && 202 if (command_line->HasSwitch(content::kSingleProcessTestsFlag) &&
202 !command_line->HasSwitch(switches::kPrimordialPipeToken)) { 203 !command_line->HasSwitch(switches::kPrimordialPipeToken)) {
203 service_manager_connection_factory = 204 service_manager_connection_factory =
204 base::Bind(&CreateServiceManagerConnection, &delegate); 205 base::Bind(&CreateServiceManagerConnection, &delegate);
205 content::ServiceManagerConnection::SetFactoryForTest( 206 content::ServiceManagerConnection::SetFactoryForTest(
206 &service_manager_connection_factory); 207 &service_manager_connection_factory);
207 } 208 }
208 *exit_code = LaunchChromeTests(default_jobs, &delegate, argc, argv); 209 *exit_code = LaunchChromeTests(default_jobs, &delegate, argc, argv);
209 return true; 210 return true;
210 } 211 }
OLDNEW
« no previous file with comments | « chrome/test/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698