| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/test/testing_profile.h" | 5 #include "chrome/test/testing_profile.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
| 12 #include "base/message_loop_proxy.h" | 12 #include "base/message_loop_proxy.h" |
| 13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 14 #include "base/string_number_conversions.h" | 14 #include "base/string_number_conversions.h" |
| 15 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 15 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
| 16 #include "chrome/browser/bookmarks/bookmark_model.h" | 16 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 17 #include "chrome/browser/browser_thread.h" | 17 #include "chrome/browser/browser_thread.h" |
| 18 #include "chrome/browser/content_settings/host_content_settings_map.h" | 18 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 19 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
| 19 #include "chrome/browser/dom_ui/ntp_resource_cache.h" | 20 #include "chrome/browser/dom_ui/ntp_resource_cache.h" |
| 20 #include "chrome/browser/extensions/extension_service.h" | 21 #include "chrome/browser/extensions/extension_service.h" |
| 21 #include "chrome/browser/extensions/extension_pref_value_map.h" | 22 #include "chrome/browser/extensions/extension_pref_value_map.h" |
| 22 #include "chrome/browser/favicon_service.h" | 23 #include "chrome/browser/favicon_service.h" |
| 23 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" | 24 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" |
| 24 #include "chrome/browser/geolocation/geolocation_permission_context.h" | 25 #include "chrome/browser/geolocation/geolocation_permission_context.h" |
| 25 #include "chrome/browser/history/history.h" | 26 #include "chrome/browser/history/history.h" |
| 26 #include "chrome/browser/history/history_backend.h" | 27 #include "chrome/browser/history/history_backend.h" |
| 27 #include "chrome/browser/history/top_sites.h" | 28 #include "chrome/browser/history/top_sites.h" |
| 28 #include "chrome/browser/in_process_webkit/webkit_context.h" | 29 #include "chrome/browser/in_process_webkit/webkit_context.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 42 #include "chrome/common/notification_service.h" | 43 #include "chrome/common/notification_service.h" |
| 43 #include "chrome/common/url_constants.h" | 44 #include "chrome/common/url_constants.h" |
| 44 #include "chrome/test/test_url_request_context_getter.h" | 45 #include "chrome/test/test_url_request_context_getter.h" |
| 45 #include "chrome/test/testing_pref_service.h" | 46 #include "chrome/test/testing_pref_service.h" |
| 46 #include "chrome/test/ui_test_utils.h" | 47 #include "chrome/test/ui_test_utils.h" |
| 47 #include "net/base/cookie_monster.h" | 48 #include "net/base/cookie_monster.h" |
| 48 #include "net/url_request/url_request_context.h" | 49 #include "net/url_request/url_request_context.h" |
| 49 #include "net/url_request/url_request_test_util.h" | 50 #include "net/url_request/url_request_test_util.h" |
| 50 #include "testing/gmock/include/gmock/gmock.h" | 51 #include "testing/gmock/include/gmock/gmock.h" |
| 51 #include "webkit/database/database_tracker.h" | 52 #include "webkit/database/database_tracker.h" |
| 53 |
| 52 #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) | 54 #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) |
| 53 #include "chrome/browser/ui/gtk/gtk_theme_provider.h" | 55 #include "chrome/browser/ui/gtk/gtk_theme_provider.h" |
| 54 #endif | 56 #endif |
| 55 | 57 |
| 56 using base::Time; | 58 using base::Time; |
| 57 using testing::NiceMock; | 59 using testing::NiceMock; |
| 58 using testing::Return; | 60 using testing::Return; |
| 59 | 61 |
| 60 namespace { | 62 namespace { |
| 61 | 63 |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 if (!profile_sync_service_.get()) { | 520 if (!profile_sync_service_.get()) { |
| 519 // Use a NiceMock here since we are really using the mock as a | 521 // Use a NiceMock here since we are really using the mock as a |
| 520 // fake. Test cases that want to set expectations on a | 522 // fake. Test cases that want to set expectations on a |
| 521 // ProfileSyncService should use the ProfileMock and have this | 523 // ProfileSyncService should use the ProfileMock and have this |
| 522 // method return their own mock instance. | 524 // method return their own mock instance. |
| 523 profile_sync_service_.reset(new NiceMock<ProfileSyncServiceMock>()); | 525 profile_sync_service_.reset(new NiceMock<ProfileSyncServiceMock>()); |
| 524 } | 526 } |
| 525 return profile_sync_service_.get(); | 527 return profile_sync_service_.get(); |
| 526 } | 528 } |
| 527 | 529 |
| 530 ChromeURLDataManager* TestingProfile::GetChromeURLDataManager() { |
| 531 if (!chrome_url_data_manager_.get()) |
| 532 chrome_url_data_manager_.reset(new ChromeURLDataManager(this)); |
| 533 return chrome_url_data_manager_.get(); |
| 534 } |
| 535 |
| 528 void TestingProfile::DestroyWebDataService() { | 536 void TestingProfile::DestroyWebDataService() { |
| 529 if (!web_data_service_.get()) | 537 if (!web_data_service_.get()) |
| 530 return; | 538 return; |
| 531 | 539 |
| 532 web_data_service_->Shutdown(); | 540 web_data_service_->Shutdown(); |
| 533 } | 541 } |
| OLD | NEW |