OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_TESTING_BROWSER_PROCESS_H_ | 10 #ifndef CHROME_TEST_TESTING_BROWSER_PROCESS_H_ |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 } | 126 } |
127 | 127 |
128 virtual unsigned int AddRefModule() { | 128 virtual unsigned int AddRefModule() { |
129 return ++module_ref_count_; | 129 return ++module_ref_count_; |
130 } | 130 } |
131 virtual unsigned int ReleaseModule() { | 131 virtual unsigned int ReleaseModule() { |
132 DCHECK(module_ref_count_ > 0); | 132 DCHECK(module_ref_count_ > 0); |
133 return --module_ref_count_; | 133 return --module_ref_count_; |
134 } | 134 } |
135 | 135 |
136 unsigned int module_ref_count() { | |
137 return module_ref_count_; | |
138 } | |
139 | |
140 virtual bool IsShuttingDown() { | 136 virtual bool IsShuttingDown() { |
141 return false; | 137 return false; |
142 } | 138 } |
143 | 139 |
144 virtual printing::PrintJobManager* print_job_manager() { | 140 virtual printing::PrintJobManager* print_job_manager() { |
145 return NULL; | 141 return NULL; |
146 } | 142 } |
147 | 143 |
148 virtual const std::string& GetApplicationLocale() { | 144 virtual const std::string& GetApplicationLocale() { |
149 return app_locale_; | 145 return app_locale_; |
(...skipping 22 matching lines...) Expand all Loading... |
172 NotificationService notification_service_; | 168 NotificationService notification_service_; |
173 scoped_ptr<base::WaitableEvent> shutdown_event_; | 169 scoped_ptr<base::WaitableEvent> shutdown_event_; |
174 unsigned int module_ref_count_; | 170 unsigned int module_ref_count_; |
175 scoped_ptr<Clipboard> clipboard_; | 171 scoped_ptr<Clipboard> clipboard_; |
176 std::string app_locale_; | 172 std::string app_locale_; |
177 | 173 |
178 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); | 174 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); |
179 }; | 175 }; |
180 | 176 |
181 #endif // CHROME_TEST_TESTING_BROWSER_PROCESS_H_ | 177 #endif // CHROME_TEST_TESTING_BROWSER_PROCESS_H_ |
OLD | NEW |