OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 public: | 51 public: |
52 // Initializes |g_browser_process| with a new TestingBrowserProcess. | 52 // Initializes |g_browser_process| with a new TestingBrowserProcess. |
53 static void CreateInstance(); | 53 static void CreateInstance(); |
54 | 54 |
55 // Cleanly destroys |g_browser_process|, which has special deletion semantics. | 55 // Cleanly destroys |g_browser_process|, which has special deletion semantics. |
56 static void DeleteInstance(); | 56 static void DeleteInstance(); |
57 | 57 |
58 // Convenience method to get g_browser_process as a TestingBrowserProcess*. | 58 // Convenience method to get g_browser_process as a TestingBrowserProcess*. |
59 static TestingBrowserProcess* GetGlobal(); | 59 static TestingBrowserProcess* GetGlobal(); |
60 | 60 |
61 virtual void ResourceDispatcherHostCreated() OVERRIDE; | 61 virtual void ResourceDispatcherHostCreated() override; |
62 virtual void EndSession() OVERRIDE; | 62 virtual void EndSession() override; |
63 virtual MetricsServicesManager* GetMetricsServicesManager() OVERRIDE; | 63 virtual MetricsServicesManager* GetMetricsServicesManager() override; |
64 virtual metrics::MetricsService* metrics_service() OVERRIDE; | 64 virtual metrics::MetricsService* metrics_service() override; |
65 virtual rappor::RapporService* rappor_service() OVERRIDE; | 65 virtual rappor::RapporService* rappor_service() override; |
66 virtual IOThread* io_thread() OVERRIDE; | 66 virtual IOThread* io_thread() override; |
67 virtual WatchDogThread* watchdog_thread() OVERRIDE; | 67 virtual WatchDogThread* watchdog_thread() override; |
68 virtual ProfileManager* profile_manager() OVERRIDE; | 68 virtual ProfileManager* profile_manager() override; |
69 virtual PrefService* local_state() OVERRIDE; | 69 virtual PrefService* local_state() override; |
70 virtual chrome_variations::VariationsService* variations_service() OVERRIDE; | 70 virtual chrome_variations::VariationsService* variations_service() override; |
71 virtual policy::BrowserPolicyConnector* browser_policy_connector() OVERRIDE; | 71 virtual policy::BrowserPolicyConnector* browser_policy_connector() override; |
72 virtual policy::PolicyService* policy_service() OVERRIDE; | 72 virtual policy::PolicyService* policy_service() override; |
73 virtual IconManager* icon_manager() OVERRIDE; | 73 virtual IconManager* icon_manager() override; |
74 virtual GLStringManager* gl_string_manager() OVERRIDE; | 74 virtual GLStringManager* gl_string_manager() override; |
75 virtual GpuModeManager* gpu_mode_manager() OVERRIDE; | 75 virtual GpuModeManager* gpu_mode_manager() override; |
76 virtual BackgroundModeManager* background_mode_manager() OVERRIDE; | 76 virtual BackgroundModeManager* background_mode_manager() override; |
77 virtual void set_background_mode_manager_for_test( | 77 virtual void set_background_mode_manager_for_test( |
78 scoped_ptr<BackgroundModeManager> manager) OVERRIDE; | 78 scoped_ptr<BackgroundModeManager> manager) override; |
79 virtual StatusTray* status_tray() OVERRIDE; | 79 virtual StatusTray* status_tray() override; |
80 virtual SafeBrowsingService* safe_browsing_service() OVERRIDE; | 80 virtual SafeBrowsingService* safe_browsing_service() override; |
81 virtual safe_browsing::ClientSideDetectionService* | 81 virtual safe_browsing::ClientSideDetectionService* |
82 safe_browsing_detection_service() OVERRIDE; | 82 safe_browsing_detection_service() override; |
83 virtual net::URLRequestContextGetter* system_request_context() OVERRIDE; | 83 virtual net::URLRequestContextGetter* system_request_context() override; |
84 virtual BrowserProcessPlatformPart* platform_part() OVERRIDE; | 84 virtual BrowserProcessPlatformPart* platform_part() override; |
85 | 85 |
86 virtual extensions::EventRouterForwarder* | 86 virtual extensions::EventRouterForwarder* |
87 extension_event_router_forwarder() OVERRIDE; | 87 extension_event_router_forwarder() override; |
88 virtual NotificationUIManager* notification_ui_manager() OVERRIDE; | 88 virtual NotificationUIManager* notification_ui_manager() override; |
89 virtual message_center::MessageCenter* message_center() OVERRIDE; | 89 virtual message_center::MessageCenter* message_center() override; |
90 virtual IntranetRedirectDetector* intranet_redirect_detector() OVERRIDE; | 90 virtual IntranetRedirectDetector* intranet_redirect_detector() override; |
91 virtual void CreateDevToolsHttpProtocolHandler( | 91 virtual void CreateDevToolsHttpProtocolHandler( |
92 chrome::HostDesktopType host_desktop_type, | 92 chrome::HostDesktopType host_desktop_type, |
93 const std::string& ip, | 93 const std::string& ip, |
94 int port) OVERRIDE; | 94 int port) override; |
95 virtual unsigned int AddRefModule() OVERRIDE; | 95 virtual unsigned int AddRefModule() override; |
96 virtual unsigned int ReleaseModule() OVERRIDE; | 96 virtual unsigned int ReleaseModule() override; |
97 virtual bool IsShuttingDown() OVERRIDE; | 97 virtual bool IsShuttingDown() override; |
98 virtual printing::PrintJobManager* print_job_manager() OVERRIDE; | 98 virtual printing::PrintJobManager* print_job_manager() override; |
99 virtual printing::PrintPreviewDialogController* | 99 virtual printing::PrintPreviewDialogController* |
100 print_preview_dialog_controller() OVERRIDE; | 100 print_preview_dialog_controller() override; |
101 virtual printing::BackgroundPrintingManager* | 101 virtual printing::BackgroundPrintingManager* |
102 background_printing_manager() OVERRIDE; | 102 background_printing_manager() override; |
103 virtual const std::string& GetApplicationLocale() OVERRIDE; | 103 virtual const std::string& GetApplicationLocale() override; |
104 virtual void SetApplicationLocale(const std::string& app_locale) OVERRIDE; | 104 virtual void SetApplicationLocale(const std::string& app_locale) override; |
105 virtual DownloadStatusUpdater* download_status_updater() OVERRIDE; | 105 virtual DownloadStatusUpdater* download_status_updater() override; |
106 virtual DownloadRequestLimiter* download_request_limiter() OVERRIDE; | 106 virtual DownloadRequestLimiter* download_request_limiter() override; |
107 | 107 |
108 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 108 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
109 virtual void StartAutoupdateTimer() OVERRIDE {} | 109 virtual void StartAutoupdateTimer() override {} |
110 #endif | 110 #endif |
111 | 111 |
112 virtual ChromeNetLog* net_log() OVERRIDE; | 112 virtual ChromeNetLog* net_log() override; |
113 virtual prerender::PrerenderTracker* prerender_tracker() OVERRIDE; | 113 virtual prerender::PrerenderTracker* prerender_tracker() override; |
114 virtual component_updater::ComponentUpdateService* | 114 virtual component_updater::ComponentUpdateService* |
115 component_updater() OVERRIDE; | 115 component_updater() override; |
116 virtual CRLSetFetcher* crl_set_fetcher() OVERRIDE; | 116 virtual CRLSetFetcher* crl_set_fetcher() override; |
117 virtual component_updater::PnaclComponentInstaller* | 117 virtual component_updater::PnaclComponentInstaller* |
118 pnacl_component_installer() OVERRIDE; | 118 pnacl_component_installer() override; |
119 virtual MediaFileSystemRegistry* media_file_system_registry() OVERRIDE; | 119 virtual MediaFileSystemRegistry* media_file_system_registry() override; |
120 virtual bool created_local_state() const OVERRIDE; | 120 virtual bool created_local_state() const override; |
121 | 121 |
122 #if defined(ENABLE_WEBRTC) | 122 #if defined(ENABLE_WEBRTC) |
123 virtual WebRtcLogUploader* webrtc_log_uploader() OVERRIDE; | 123 virtual WebRtcLogUploader* webrtc_log_uploader() override; |
124 #endif | 124 #endif |
125 | 125 |
126 virtual network_time::NetworkTimeTracker* network_time_tracker() OVERRIDE; | 126 virtual network_time::NetworkTimeTracker* network_time_tracker() override; |
127 | 127 |
128 virtual gcm::GCMDriver* gcm_driver() OVERRIDE; | 128 virtual gcm::GCMDriver* gcm_driver() override; |
129 | 129 |
130 // Set the local state for tests. Consumer is responsible for cleaning it up | 130 // Set the local state for tests. Consumer is responsible for cleaning it up |
131 // afterwards (using ScopedTestingLocalState, for example). | 131 // afterwards (using ScopedTestingLocalState, for example). |
132 void SetLocalState(PrefService* local_state); | 132 void SetLocalState(PrefService* local_state); |
133 void SetProfileManager(ProfileManager* profile_manager); | 133 void SetProfileManager(ProfileManager* profile_manager); |
134 void SetIOThread(IOThread* io_thread); | 134 void SetIOThread(IOThread* io_thread); |
135 void SetBrowserPolicyConnector(policy::BrowserPolicyConnector* connector); | 135 void SetBrowserPolicyConnector(policy::BrowserPolicyConnector* connector); |
136 void SetSafeBrowsingService(SafeBrowsingService* sb_service); | 136 void SetSafeBrowsingService(SafeBrowsingService* sb_service); |
137 void SetSystemRequestContext(net::URLRequestContextGetter* context_getter); | 137 void SetSystemRequestContext(net::URLRequestContextGetter* context_getter); |
138 | 138 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 class TestingBrowserProcessInitializer { | 204 class TestingBrowserProcessInitializer { |
205 public: | 205 public: |
206 TestingBrowserProcessInitializer(); | 206 TestingBrowserProcessInitializer(); |
207 ~TestingBrowserProcessInitializer(); | 207 ~TestingBrowserProcessInitializer(); |
208 | 208 |
209 private: | 209 private: |
210 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcessInitializer); | 210 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcessInitializer); |
211 }; | 211 }; |
212 | 212 |
213 #endif // CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ | 213 #endif // CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ |
OLD | NEW |