| OLD | NEW |
| 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 #include "chrome/test/base/testing_profile.h" | 5 #include "chrome/test/base/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 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 base::FilePath TestingProfile::last_selected_directory() { | 713 base::FilePath TestingProfile::last_selected_directory() { |
| 714 return last_selected_directory_; | 714 return last_selected_directory_; |
| 715 } | 715 } |
| 716 | 716 |
| 717 void TestingProfile::set_last_selected_directory(const base::FilePath& path) { | 717 void TestingProfile::set_last_selected_directory(const base::FilePath& path) { |
| 718 last_selected_directory_ = path; | 718 last_selected_directory_ = path; |
| 719 } | 719 } |
| 720 | 720 |
| 721 PrefProxyConfigTracker* TestingProfile::GetProxyConfigTracker() { | 721 PrefProxyConfigTracker* TestingProfile::GetProxyConfigTracker() { |
| 722 if (!pref_proxy_config_tracker_.get()) { | 722 if (!pref_proxy_config_tracker_.get()) { |
| 723 // TestingProfile is used in unit tests, where local state is not available. |
| 723 pref_proxy_config_tracker_.reset( | 724 pref_proxy_config_tracker_.reset( |
| 724 ProxyServiceFactory::CreatePrefProxyConfigTracker(GetPrefs())); | 725 ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile(GetPrefs(), |
| 726 NULL)); |
| 725 } | 727 } |
| 726 return pref_proxy_config_tracker_.get(); | 728 return pref_proxy_config_tracker_.get(); |
| 727 } | 729 } |
| 728 | 730 |
| 729 void TestingProfile::BlockUntilHistoryProcessesPendingRequests() { | 731 void TestingProfile::BlockUntilHistoryProcessesPendingRequests() { |
| 730 HistoryService* history_service = | 732 HistoryService* history_service = |
| 731 HistoryServiceFactory::GetForProfile(this, Profile::EXPLICIT_ACCESS); | 733 HistoryServiceFactory::GetForProfile(this, Profile::EXPLICIT_ACCESS); |
| 732 DCHECK(history_service); | 734 DCHECK(history_service); |
| 733 DCHECK(base::MessageLoop::current()); | 735 DCHECK(base::MessageLoop::current()); |
| 734 | 736 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 | 799 |
| 798 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { | 800 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { |
| 799 DCHECK(!build_called_); | 801 DCHECK(!build_called_); |
| 800 build_called_ = true; | 802 build_called_ = true; |
| 801 return scoped_ptr<TestingProfile>(new TestingProfile( | 803 return scoped_ptr<TestingProfile>(new TestingProfile( |
| 802 path_, | 804 path_, |
| 803 delegate_, | 805 delegate_, |
| 804 extension_policy_, | 806 extension_policy_, |
| 805 pref_service_.Pass())); | 807 pref_service_.Pass())); |
| 806 } | 808 } |
| OLD | NEW |