OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // An implementation of BrowserProcess for unit tests that fails for most | 5 // An implementation of BrowserProcess for unit tests that fails for most |
6 // services. By preventing creation of services, we reduce dependencies and | 6 // services. By preventing creation of services, we reduce dependencies and |
7 // keep the profile clean. Clients of this class must handle the NULL return | 7 // keep the profile clean. Clients of this class must handle the NULL return |
8 // value, however. | 8 // value, however. |
9 | 9 |
10 #ifndef CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ | 10 #ifndef CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 scoped_ptr<ProfileManager> profile_manager_; | 141 scoped_ptr<ProfileManager> profile_manager_; |
142 scoped_ptr<NotificationUIManager> notification_ui_manager_; | 142 scoped_ptr<NotificationUIManager> notification_ui_manager_; |
143 scoped_ptr<printing::BackgroundPrintingManager> background_printing_manager_; | 143 scoped_ptr<printing::BackgroundPrintingManager> background_printing_manager_; |
144 scoped_ptr<prerender::PrerenderTracker> prerender_tracker_; | 144 scoped_ptr<prerender::PrerenderTracker> prerender_tracker_; |
145 IOThread* io_thread_; | 145 IOThread* io_thread_; |
146 scoped_ptr<DevToolsManager> devtools_manager_; | 146 scoped_ptr<DevToolsManager> devtools_manager_; |
147 | 147 |
148 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); | 148 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); |
149 }; | 149 }; |
150 | 150 |
151 // Scoper to put a TestingBrowserProcess in |g_browser_process|. | |
152 class ScopedTestingBrowserProcess { | |
153 public: | |
154 ScopedTestingBrowserProcess(); | |
155 ~ScopedTestingBrowserProcess(); | |
156 | |
157 TestingBrowserProcess* get() { | |
158 return &browser_process_; | |
159 } | |
160 | |
161 private: | |
162 TestingBrowserProcess browser_process_; | |
163 | |
164 DISALLOW_COPY_AND_ASSIGN(ScopedTestingBrowserProcess); | |
165 }; | |
166 | |
167 #endif // CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ | 151 #endif // CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ |
OLD | NEW |