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 #ifndef CHROME_TEST_TESTING_PROFILE_H_ | 5 #ifndef CHROME_TEST_TESTING_PROFILE_H_ |
6 #define CHROME_TEST_TESTING_PROFILE_H_ | 6 #define CHROME_TEST_TESTING_PROFILE_H_ |
7 | 7 |
8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 return webkit_context_; | 254 return webkit_context_; |
255 } | 255 } |
256 virtual WebKitContext* GetOffTheRecordWebKitContext() { return NULL; } | 256 virtual WebKitContext* GetOffTheRecordWebKitContext() { return NULL; } |
257 virtual void MarkAsCleanShutdown() {} | 257 virtual void MarkAsCleanShutdown() {} |
258 virtual void InitExtensions() {} | 258 virtual void InitExtensions() {} |
259 virtual void InitWebResources() {} | 259 virtual void InitWebResources() {} |
260 virtual NTPResourceCache* GetNTPResourceCache(); | 260 virtual NTPResourceCache* GetNTPResourceCache(); |
261 virtual DesktopNotificationService* GetDesktopNotificationService() { | 261 virtual DesktopNotificationService* GetDesktopNotificationService() { |
262 return NULL; | 262 return NULL; |
263 } | 263 } |
| 264 virtual FilePath last_selected_directory() { |
| 265 return last_selected_directory_; |
| 266 } |
| 267 virtual void set_last_selected_directory(const FilePath& path) { |
| 268 last_selected_directory_ = path; |
| 269 } |
| 270 |
264 | 271 |
265 // Schedules a task on the history backend and runs a nested loop until the | 272 // Schedules a task on the history backend and runs a nested loop until the |
266 // task is processed. This has the effect of blocking the caller until the | 273 // task is processed. This has the effect of blocking the caller until the |
267 // history service processes all pending requests. | 274 // history service processes all pending requests. |
268 void BlockUntilHistoryProcessesPendingRequests(); | 275 void BlockUntilHistoryProcessesPendingRequests(); |
269 | 276 |
270 // Creates and initializes a profile sync service if the tests require one. | 277 // Creates and initializes a profile sync service if the tests require one. |
271 virtual ProfileSyncService* GetProfileSyncService(); | 278 virtual ProfileSyncService* GetProfileSyncService(); |
272 virtual CloudPrintProxyService* GetCloudPrintProxyService() { return NULL; } | 279 virtual CloudPrintProxyService* GetCloudPrintProxyService() { return NULL; } |
273 | 280 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 // WebKitContext, lazily initialized by GetWebKitContext(). | 351 // WebKitContext, lazily initialized by GetWebKitContext(). |
345 scoped_refptr<WebKitContext> webkit_context_; | 352 scoped_refptr<WebKitContext> webkit_context_; |
346 | 353 |
347 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 354 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
348 scoped_refptr<GeolocationContentSettingsMap> | 355 scoped_refptr<GeolocationContentSettingsMap> |
349 geolocation_content_settings_map_; | 356 geolocation_content_settings_map_; |
350 scoped_refptr<GeolocationPermissionContext> geolocation_permission_context_; | 357 scoped_refptr<GeolocationPermissionContext> geolocation_permission_context_; |
351 | 358 |
352 // Find bar state. Created lazily by GetFindBarState(). | 359 // Find bar state. Created lazily by GetFindBarState(). |
353 scoped_ptr<FindBarState> find_bar_state_; | 360 scoped_ptr<FindBarState> find_bar_state_; |
| 361 |
| 362 FilePath last_selected_directory_; |
354 }; | 363 }; |
355 | 364 |
356 // A profile that derives from another profile. This does not actually | 365 // A profile that derives from another profile. This does not actually |
357 // override anything except the GetRuntimeId() in order to test sharing of | 366 // override anything except the GetRuntimeId() in order to test sharing of |
358 // site information. | 367 // site information. |
359 class DerivedTestingProfile : public TestingProfile { | 368 class DerivedTestingProfile : public TestingProfile { |
360 public: | 369 public: |
361 explicit DerivedTestingProfile(Profile* profile) | 370 explicit DerivedTestingProfile(Profile* profile) |
362 : original_profile_(profile) {} | 371 : original_profile_(profile) {} |
363 | 372 |
364 virtual ProfileId GetRuntimeId() { | 373 virtual ProfileId GetRuntimeId() { |
365 return original_profile_->GetRuntimeId(); | 374 return original_profile_->GetRuntimeId(); |
366 } | 375 } |
367 | 376 |
368 protected: | 377 protected: |
369 Profile* original_profile_; | 378 Profile* original_profile_; |
370 }; | 379 }; |
371 | 380 |
372 #endif // CHROME_TEST_TESTING_PROFILE_H_ | 381 #endif // CHROME_TEST_TESTING_PROFILE_H_ |
OLD | NEW |