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

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

Issue 16703025: [StorageMonitor] Move StorageMonitor ownership to BrowserProcessImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 5 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
OLDNEW
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 98 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
99 virtual void StartAutoupdateTimer() OVERRIDE {} 99 virtual void StartAutoupdateTimer() OVERRIDE {}
100 #endif 100 #endif
101 101
102 virtual ChromeNetLog* net_log() OVERRIDE; 102 virtual ChromeNetLog* net_log() OVERRIDE;
103 virtual prerender::PrerenderTracker* prerender_tracker() OVERRIDE; 103 virtual prerender::PrerenderTracker* prerender_tracker() OVERRIDE;
104 virtual ComponentUpdateService* component_updater() OVERRIDE; 104 virtual ComponentUpdateService* component_updater() OVERRIDE;
105 virtual CRLSetFetcher* crl_set_fetcher() OVERRIDE; 105 virtual CRLSetFetcher* crl_set_fetcher() OVERRIDE;
106 virtual PnaclComponentInstaller* pnacl_component_installer() OVERRIDE; 106 virtual PnaclComponentInstaller* pnacl_component_installer() OVERRIDE;
107 virtual BookmarkPromptController* bookmark_prompt_controller() OVERRIDE; 107 virtual BookmarkPromptController* bookmark_prompt_controller() OVERRIDE;
108 virtual chrome::StorageMonitor* storage_monitor() OVERRIDE;
108 virtual chrome::MediaFileSystemRegistry* 109 virtual chrome::MediaFileSystemRegistry*
109 media_file_system_registry() OVERRIDE; 110 media_file_system_registry() OVERRIDE;
110 virtual bool created_local_state() const OVERRIDE; 111 virtual bool created_local_state() const OVERRIDE;
111 112
112 #if defined(ENABLE_WEBRTC) 113 #if defined(ENABLE_WEBRTC)
113 virtual WebRtcLogUploader* webrtc_log_uploader() OVERRIDE; 114 virtual WebRtcLogUploader* webrtc_log_uploader() OVERRIDE;
114 #endif 115 #endif
115 116
116 // Set the local state for tests. Consumer is responsible for cleaning it up 117 // Set the local state for tests. Consumer is responsible for cleaning it up
117 // afterwards (using ScopedTestingLocalState, for example). 118 // afterwards (using ScopedTestingLocalState, for example).
118 void SetLocalState(PrefService* local_state); 119 void SetLocalState(PrefService* local_state);
119 void SetProfileManager(ProfileManager* profile_manager); 120 void SetProfileManager(ProfileManager* profile_manager);
120 void SetIOThread(IOThread* io_thread); 121 void SetIOThread(IOThread* io_thread);
121 void SetBrowserPolicyConnector(policy::BrowserPolicyConnector* connector); 122 void SetBrowserPolicyConnector(policy::BrowserPolicyConnector* connector);
122 void SetSafeBrowsingService(SafeBrowsingService* sb_service); 123 void SetSafeBrowsingService(SafeBrowsingService* sb_service);
123 void SetBookmarkPromptController(BookmarkPromptController* controller); 124 void SetBookmarkPromptController(BookmarkPromptController* controller);
124 void SetSystemRequestContext(net::URLRequestContextGetter* context_getter); 125 void SetSystemRequestContext(net::URLRequestContextGetter* context_getter);
126 void SetStorageMonitor(chrome::StorageMonitor* storage_monitor);
127
128 static void SetStorageMonitorForBrowserTests(
Lei Zhang 2013/07/02 23:16:57 I don't think we need this. Just put SetStorageMon
Greg Billock 2013/07/03 17:49:17 I'd like to keep the testing interface out of brow
Lei Zhang 2013/07/03 23:25:10 set_background_mode_manager_for_test() already exi
Greg Billock 2013/07/08 18:50:07 Yeah, I saw that. I don't think it simplifies that
129 chrome::StorageMonitor* storage_monitor);
125 130
126 private: 131 private:
127 scoped_ptr<content::NotificationService> notification_service_; 132 scoped_ptr<content::NotificationService> notification_service_;
128 unsigned int module_ref_count_; 133 unsigned int module_ref_count_;
129 std::string app_locale_; 134 std::string app_locale_;
130 135
131 // TODO(ios): Add back members as more code is compiled. 136 // TODO(ios): Add back members as more code is compiled.
132 #if !defined(OS_IOS) 137 #if !defined(OS_IOS)
133 #if defined(ENABLE_CONFIGURATION_POLICY) 138 #if defined(ENABLE_CONFIGURATION_POLICY)
134 scoped_ptr<policy::BrowserPolicyConnector> browser_policy_connector_; 139 scoped_ptr<policy::BrowserPolicyConnector> browser_policy_connector_;
135 #else 140 #else
136 scoped_ptr<policy::PolicyService> policy_service_; 141 scoped_ptr<policy::PolicyService> policy_service_;
137 #endif 142 #endif
138 scoped_ptr<ProfileManager> profile_manager_; 143 scoped_ptr<ProfileManager> profile_manager_;
139 scoped_ptr<NotificationUIManager> notification_ui_manager_; 144 scoped_ptr<NotificationUIManager> notification_ui_manager_;
140 scoped_ptr<printing::BackgroundPrintingManager> background_printing_manager_; 145 scoped_ptr<printing::BackgroundPrintingManager> background_printing_manager_;
141 scoped_refptr<printing::PrintPreviewDialogController> 146 scoped_refptr<printing::PrintPreviewDialogController>
142 print_preview_dialog_controller_; 147 print_preview_dialog_controller_;
143 scoped_ptr<prerender::PrerenderTracker> prerender_tracker_; 148 scoped_ptr<prerender::PrerenderTracker> prerender_tracker_;
144 scoped_ptr<RenderWidgetSnapshotTaker> render_widget_snapshot_taker_; 149 scoped_ptr<RenderWidgetSnapshotTaker> render_widget_snapshot_taker_;
145 scoped_refptr<SafeBrowsingService> sb_service_; 150 scoped_refptr<SafeBrowsingService> sb_service_;
146 scoped_ptr<BookmarkPromptController> bookmark_prompt_controller_; 151 scoped_ptr<BookmarkPromptController> bookmark_prompt_controller_;
147 #if !defined(OS_ANDROID) 152 #endif // !defined(OS_IOS)
153
154 #if !defined(OS_IOS) && !defined(OS_ANDROID)
155 scoped_ptr<chrome::StorageMonitor> storage_monitor_;
148 scoped_ptr<chrome::MediaFileSystemRegistry> media_file_system_registry_; 156 scoped_ptr<chrome::MediaFileSystemRegistry> media_file_system_registry_;
149 #endif 157 #endif
150 #endif // !defined(OS_IOS)
151 158
152 // The following objects are not owned by TestingBrowserProcess: 159 // The following objects are not owned by TestingBrowserProcess:
153 PrefService* local_state_; 160 PrefService* local_state_;
154 IOThread* io_thread_; 161 IOThread* io_thread_;
155 net::URLRequestContextGetter* system_request_context_; 162 net::URLRequestContextGetter* system_request_context_;
156 163
157 scoped_ptr<BrowserProcessPlatformPart> platform_part_; 164 scoped_ptr<BrowserProcessPlatformPart> platform_part_;
158 165
159 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); 166 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess);
160 }; 167 };
161 168
162 #endif // CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ 169 #endif // CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698