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

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

Issue 11308362: Add StoragePartition's ProtocolHandlers at URLRequestContext construction time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address awong's comments Created 7 years, 10 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 | Annotate | Revision Log
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 #ifndef CHROME_TEST_BASE_TESTING_PROFILE_H_ 5 #ifndef CHROME_TEST_BASE_TESTING_PROFILE_H_
6 #define CHROME_TEST_BASE_TESTING_PROFILE_H_ 6 #define CHROME_TEST_BASE_TESTING_PROFILE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 GetDownloadManagerDelegate() OVERRIDE; 183 GetDownloadManagerDelegate() OVERRIDE;
184 // Returns a testing ContextGetter (if one has been created via 184 // Returns a testing ContextGetter (if one has been created via
185 // CreateRequestContext) or NULL. This is not done on-demand for two reasons: 185 // CreateRequestContext) or NULL. This is not done on-demand for two reasons:
186 // (1) Some tests depend on GetRequestContext() returning NULL. (2) Because 186 // (1) Some tests depend on GetRequestContext() returning NULL. (2) Because
187 // of the special memory management considerations for the 187 // of the special memory management considerations for the
188 // TestURLRequestContextGetter class, many tests would find themseleves 188 // TestURLRequestContextGetter class, many tests would find themseleves
189 // leaking if they called this method without the necessary IO thread. This 189 // leaking if they called this method without the necessary IO thread. This
190 // getter is currently only capable of returning a Context that helps test 190 // getter is currently only capable of returning a Context that helps test
191 // the CookieMonster. See implementation comments for more details. 191 // the CookieMonster. See implementation comments for more details.
192 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; 192 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE;
193 virtual net::URLRequestContextGetter* CreateRequestContext(
194 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
195 blob_protocol_handler,
196 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
197 file_system_protocol_handler,
198 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
199 developer_protocol_handler,
200 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
201 chrome_protocol_handler,
202 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
203 chrome_devtools_protocol_handler) OVERRIDE;
193 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( 204 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess(
194 int renderer_child_id) OVERRIDE; 205 int renderer_child_id) OVERRIDE;
195 virtual content::ResourceContext* GetResourceContext() OVERRIDE; 206 virtual content::ResourceContext* GetResourceContext() OVERRIDE;
196 virtual content::GeolocationPermissionContext* 207 virtual content::GeolocationPermissionContext*
197 GetGeolocationPermissionContext() OVERRIDE; 208 GetGeolocationPermissionContext() OVERRIDE;
198 virtual content::SpeechRecognitionPreferences* 209 virtual content::SpeechRecognitionPreferences*
199 GetSpeechRecognitionPreferences() OVERRIDE; 210 GetSpeechRecognitionPreferences() OVERRIDE;
200 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; 211 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE;
201 212
202 virtual TestingProfile* AsTestingProfile() OVERRIDE; 213 virtual TestingProfile* AsTestingProfile() OVERRIDE;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 248
238 virtual net::URLRequestContextGetter* GetMediaRequestContext() OVERRIDE; 249 virtual net::URLRequestContextGetter* GetMediaRequestContext() OVERRIDE;
239 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( 250 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess(
240 int renderer_child_id) OVERRIDE; 251 int renderer_child_id) OVERRIDE;
241 virtual net::URLRequestContextGetter* 252 virtual net::URLRequestContextGetter*
242 GetRequestContextForExtensions() OVERRIDE; 253 GetRequestContextForExtensions() OVERRIDE;
243 virtual net::URLRequestContextGetter* 254 virtual net::URLRequestContextGetter*
244 GetMediaRequestContextForStoragePartition( 255 GetMediaRequestContextForStoragePartition(
245 const FilePath& partition_path, 256 const FilePath& partition_path,
246 bool in_memory) OVERRIDE; 257 bool in_memory) OVERRIDE;
247 virtual net::URLRequestContextGetter* GetRequestContextForStoragePartition( 258 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition(
248 const FilePath& partition_path, 259 const FilePath& partition_path,
249 bool in_memory) OVERRIDE; 260 bool in_memory,
261 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
262 blob_protocol_handler,
263 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
264 file_system_protocol_handler,
265 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
266 developer_protocol_handler,
267 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
268 chrome_protocol_handler,
269 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
270 chrome_devtools_protocol_handler) OVERRIDE;
250 virtual net::SSLConfigService* GetSSLConfigService() OVERRIDE; 271 virtual net::SSLConfigService* GetSSLConfigService() OVERRIDE;
251 virtual HostContentSettingsMap* GetHostContentSettingsMap() OVERRIDE; 272 virtual HostContentSettingsMap* GetHostContentSettingsMap() OVERRIDE;
252 virtual std::wstring GetName(); 273 virtual std::wstring GetName();
253 virtual void SetName(const std::wstring& name) {} 274 virtual void SetName(const std::wstring& name) {}
254 virtual std::wstring GetID(); 275 virtual std::wstring GetID();
255 virtual void SetID(const std::wstring& id); 276 virtual void SetID(const std::wstring& id);
256 void set_last_session_exited_cleanly(bool value) { 277 void set_last_session_exited_cleanly(bool value) {
257 last_session_exited_cleanly_ = value; 278 last_session_exited_cleanly_ = value;
258 } 279 }
259 virtual void MergeResourceString(int message_id, 280 virtual void MergeResourceString(int message_id,
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 // testing. 376 // testing.
356 ProfileDependencyManager* profile_dependency_manager_; 377 ProfileDependencyManager* profile_dependency_manager_;
357 378
358 scoped_ptr<content::MockResourceContext> resource_context_; 379 scoped_ptr<content::MockResourceContext> resource_context_;
359 380
360 // Weak pointer to a delegate for indicating that a profile was created. 381 // Weak pointer to a delegate for indicating that a profile was created.
361 Delegate* delegate_; 382 Delegate* delegate_;
362 }; 383 };
363 384
364 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_ 385 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698