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

Side by Side Diff: chrome/test/base/mojo_test_connector.h

Issue 2858103002: Have mash_browser_tests recreate BackgroundServiceManager per test (Closed)
Patch Set: Rebase Created 3 years, 7 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/base/mash_browser_tests_main.cc ('k') | chrome/test/base/mojo_test_connector.cc » ('j') | 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 #ifndef CHROME_TEST_BASE_MOJO_TEST_CONNECTOR_H_ 5 #ifndef CHROME_TEST_BASE_MOJO_TEST_CONNECTOR_H_
6 #define CHROME_TEST_BASE_MOJO_TEST_CONNECTOR_H_ 6 #define CHROME_TEST_BASE_MOJO_TEST_CONNECTOR_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 // Aura is backed by mus and chrome and ash are in separate processes. In 51 // Aura is backed by mus and chrome and ash are in separate processes. In
52 // this mode chrome code can only use ash code in ash/public/cpp. 52 // this mode chrome code can only use ash code in ash/public/cpp.
53 MASH, 53 MASH,
54 }; 54 };
55 55
56 MojoTestConnector(std::unique_ptr<base::Value> catalog_contents, 56 MojoTestConnector(std::unique_ptr<base::Value> catalog_contents,
57 Config config); 57 Config config);
58 ~MojoTestConnector(); 58 ~MojoTestConnector();
59 59
60 service_manager::BackgroundServiceManager* background_service_manager() {
61 return background_service_manager_.get();
62 }
63
64 // Initializes the Mojo environment, and IPC thread.
65 void Init();
66
60 // Initializes the background thread the ServiceManager runs on. 67 // Initializes the background thread the ServiceManager runs on.
61 service_manager::mojom::ServiceRequest Init(); 68 service_manager::mojom::ServiceRequest InitBackgroundServiceManager();
62 69
63 std::unique_ptr<content::TestState> PrepareForTest( 70 std::unique_ptr<content::TestState> PrepareForTest(
64 base::CommandLine* command_line, 71 base::CommandLine* command_line,
65 base::TestLauncher::LaunchOptions* test_launch_options, 72 base::TestLauncher::LaunchOptions* test_launch_options,
66 base::OnceClosure on_process_launched); 73 base::OnceClosure on_process_launched);
67 74
68 void StartService(const std::string& service_name); 75 void StartService(const std::string& service_name);
69 76
70 private: 77 private:
71 class ServiceProcessLauncherDelegateImpl; 78 class ServiceProcessLauncherDelegateImpl;
72 79
73 const Config config_; 80 const Config config_;
74 81
75 std::unique_ptr<ServiceProcessLauncherDelegateImpl> 82 std::unique_ptr<ServiceProcessLauncherDelegateImpl>
76 service_process_launcher_delegate_; 83 service_process_launcher_delegate_;
77 std::unique_ptr<service_manager::BackgroundServiceManager> 84 std::unique_ptr<service_manager::BackgroundServiceManager>
78 background_service_manager_; 85 background_service_manager_;
79 86
80 std::unique_ptr<base::Thread> ipc_thread_; 87 std::unique_ptr<base::Thread> ipc_thread_;
81 std::unique_ptr<mojo::edk::ScopedIPCSupport> ipc_support_; 88 std::unique_ptr<mojo::edk::ScopedIPCSupport> ipc_support_;
82 89
83 std::unique_ptr<base::Value> catalog_contents_; 90 std::unique_ptr<base::Value> catalog_contents_;
84 91
85 DISALLOW_COPY_AND_ASSIGN(MojoTestConnector); 92 DISALLOW_COPY_AND_ASSIGN(MojoTestConnector);
86 }; 93 };
87 94
88 #endif // CHROME_TEST_BASE_MOJO_TEST_CONNECTOR_H_ 95 #endif // CHROME_TEST_BASE_MOJO_TEST_CONNECTOR_H_
OLDNEW
« no previous file with comments | « chrome/test/base/mash_browser_tests_main.cc ('k') | chrome/test/base/mojo_test_connector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698