| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_ |
| 11 #define CHROME_TEST_TESTING_BROWSER_PROCESS_H_ | 11 #define CHROME_TEST_TESTING_BROWSER_PROCESS_H_ |
| 12 | 12 |
| 13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 14 | 14 |
| 15 #include <string> | 15 #include <string> |
| 16 | 16 |
| 17 #include "base/string_util.h" | 17 #include "base/string_util.h" |
| 18 #include "base/waitable_event.h" | 18 #include "base/waitable_event.h" |
| 19 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
| 20 #include "chrome/common/notification_service.h" | 20 #include "chrome/common/notification_service.h" |
| 21 #include "base/logging.h" | |
| 22 | 21 |
| 23 class TestingBrowserProcess : public BrowserProcess { | 22 class TestingBrowserProcess : public BrowserProcess { |
| 24 public: | 23 public: |
| 25 TestingBrowserProcess() | 24 TestingBrowserProcess() |
| 26 : shutdown_event_(new base::WaitableEvent(true, false)) { | 25 : shutdown_event_(new base::WaitableEvent(true, false)) { |
| 27 } | 26 } |
| 28 | 27 |
| 29 virtual ~TestingBrowserProcess() { | 28 virtual ~TestingBrowserProcess() { |
| 30 } | 29 } |
| 31 | 30 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 return shutdown_event_.get(); | 125 return shutdown_event_.get(); |
| 127 } | 126 } |
| 128 | 127 |
| 129 private: | 128 private: |
| 130 NotificationService notification_service_; | 129 NotificationService notification_service_; |
| 131 scoped_ptr<base::WaitableEvent> shutdown_event_; | 130 scoped_ptr<base::WaitableEvent> shutdown_event_; |
| 132 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); | 131 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); |
| 133 }; | 132 }; |
| 134 | 133 |
| 135 #endif // CHROME_TEST_TESTING_BROWSER_PROCESS_H_ | 134 #endif // CHROME_TEST_TESTING_BROWSER_PROCESS_H_ |
| OLD | NEW |