| 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" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 40 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 41 #include "chrome/browser/ui/webui/ntp_resource_cache.h" | 41 #include "chrome/browser/ui/webui/ntp_resource_cache.h" |
| 42 #include "chrome/common/chrome_constants.h" | 42 #include "chrome/common/chrome_constants.h" |
| 43 #include "chrome/common/url_constants.h" | 43 #include "chrome/common/url_constants.h" |
| 44 #include "chrome/test/test_url_request_context_getter.h" | 44 #include "chrome/test/test_url_request_context_getter.h" |
| 45 #include "chrome/test/testing_pref_service.h" | 45 #include "chrome/test/testing_pref_service.h" |
| 46 #include "chrome/test/ui_test_utils.h" | 46 #include "chrome/test/ui_test_utils.h" |
| 47 #include "content/browser/browser_thread.h" | 47 #include "content/browser/browser_thread.h" |
| 48 #include "content/browser/geolocation/geolocation_permission_context.h" | 48 #include "content/browser/geolocation/geolocation_permission_context.h" |
| 49 #include "content/browser/in_process_webkit/webkit_context.h" | 49 #include "content/browser/in_process_webkit/webkit_context.h" |
| 50 #include "content/browser/mock_resource_context.h" |
| 50 #include "content/common/notification_service.h" | 51 #include "content/common/notification_service.h" |
| 51 #include "net/base/cookie_monster.h" | 52 #include "net/base/cookie_monster.h" |
| 52 #include "net/url_request/url_request_context.h" | 53 #include "net/url_request/url_request_context.h" |
| 53 #include "net/url_request/url_request_context_getter.h" | 54 #include "net/url_request/url_request_context_getter.h" |
| 54 #include "net/url_request/url_request_test_util.h" | 55 #include "net/url_request/url_request_test_util.h" |
| 55 #include "testing/gmock/include/gmock/gmock.h" | 56 #include "testing/gmock/include/gmock/gmock.h" |
| 56 #include "webkit/database/database_tracker.h" | 57 #include "webkit/database/database_tracker.h" |
| 57 | 58 |
| 58 using base::Time; | 59 using base::Time; |
| 59 using testing::NiceMock; | 60 using testing::NiceMock; |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 return NULL; | 583 return NULL; |
| 583 } | 584 } |
| 584 | 585 |
| 585 net::URLRequestContextGetter* TestingProfile::GetRequestContextForIsolatedApp( | 586 net::URLRequestContextGetter* TestingProfile::GetRequestContextForIsolatedApp( |
| 586 const std::string& app_id) { | 587 const std::string& app_id) { |
| 587 // We don't test isolated app storage here yet, so returning the same dummy | 588 // We don't test isolated app storage here yet, so returning the same dummy |
| 588 // context is sufficient for now. | 589 // context is sufficient for now. |
| 589 return GetRequestContext(); | 590 return GetRequestContext(); |
| 590 } | 591 } |
| 591 | 592 |
| 593 const content::ResourceContext& TestingProfile::GetResourceContext() { |
| 594 return content::MockResourceContext::GetInstance(); |
| 595 } |
| 596 |
| 592 FindBarState* TestingProfile::GetFindBarState() { | 597 FindBarState* TestingProfile::GetFindBarState() { |
| 593 if (!find_bar_state_.get()) | 598 if (!find_bar_state_.get()) |
| 594 find_bar_state_.reset(new FindBarState()); | 599 find_bar_state_.reset(new FindBarState()); |
| 595 return find_bar_state_.get(); | 600 return find_bar_state_.get(); |
| 596 } | 601 } |
| 597 | 602 |
| 598 HostContentSettingsMap* TestingProfile::GetHostContentSettingsMap() { | 603 HostContentSettingsMap* TestingProfile::GetHostContentSettingsMap() { |
| 599 if (!host_content_settings_map_.get()) | 604 if (!host_content_settings_map_.get()) |
| 600 host_content_settings_map_ = new HostContentSettingsMap(this); | 605 host_content_settings_map_ = new HostContentSettingsMap(this); |
| 601 return host_content_settings_map_.get(); | 606 return host_content_settings_map_.get(); |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 } | 810 } |
| 806 | 811 |
| 807 DerivedTestingProfile::DerivedTestingProfile(Profile* profile) | 812 DerivedTestingProfile::DerivedTestingProfile(Profile* profile) |
| 808 : original_profile_(profile) {} | 813 : original_profile_(profile) {} |
| 809 | 814 |
| 810 DerivedTestingProfile::~DerivedTestingProfile() {} | 815 DerivedTestingProfile::~DerivedTestingProfile() {} |
| 811 | 816 |
| 812 ProfileId DerivedTestingProfile::GetRuntimeId() { | 817 ProfileId DerivedTestingProfile::GetRuntimeId() { |
| 813 return original_profile_->GetRuntimeId(); | 818 return original_profile_->GetRuntimeId(); |
| 814 } | 819 } |
| OLD | NEW |