| 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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 return profile_path_; | 476 return profile_path_; |
| 477 } | 477 } |
| 478 | 478 |
| 479 TestingPrefService* TestingProfile::GetTestingPrefService() { | 479 TestingPrefService* TestingProfile::GetTestingPrefService() { |
| 480 if (!prefs_.get()) | 480 if (!prefs_.get()) |
| 481 CreateTestingPrefService(); | 481 CreateTestingPrefService(); |
| 482 DCHECK(testing_prefs_); | 482 DCHECK(testing_prefs_); |
| 483 return testing_prefs_; | 483 return testing_prefs_; |
| 484 } | 484 } |
| 485 | 485 |
| 486 void TestingProfile::CreateSkeletonIODataForTesting() { |
| 487 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 488 io_data_.reset(new ProfileImplIOData::Handle(this)); |
| 489 io_data_->InitForTesting(); |
| 490 } |
| 491 |
| 486 TestingProfile* TestingProfile::AsTestingProfile() { | 492 TestingProfile* TestingProfile::AsTestingProfile() { |
| 487 return this; | 493 return this; |
| 488 } | 494 } |
| 489 | 495 |
| 490 std::string TestingProfile::GetProfileName() { | 496 std::string TestingProfile::GetProfileName() { |
| 491 return std::string("testing_profile"); | 497 return std::string("testing_profile"); |
| 492 } | 498 } |
| 493 | 499 |
| 494 bool TestingProfile::IsOffTheRecord() const { | 500 bool TestingProfile::IsOffTheRecord() const { |
| 495 return incognito_; | 501 return incognito_; |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 | 783 |
| 778 CancelableRequestConsumer consumer; | 784 CancelableRequestConsumer consumer; |
| 779 history_service->ScheduleDBTask(new QuittingHistoryDBTask(), &consumer); | 785 history_service->ScheduleDBTask(new QuittingHistoryDBTask(), &consumer); |
| 780 MessageLoop::current()->Run(); | 786 MessageLoop::current()->Run(); |
| 781 } | 787 } |
| 782 | 788 |
| 783 chrome_browser_net::Predictor* TestingProfile::GetNetworkPredictor() { | 789 chrome_browser_net::Predictor* TestingProfile::GetNetworkPredictor() { |
| 784 return NULL; | 790 return NULL; |
| 785 } | 791 } |
| 786 | 792 |
| 787 void TestingProfile::ClearNetworkingHistorySince(base::Time time) { | 793 void TestingProfile::ClearNetworkingHistorySince( |
| 788 NOTIMPLEMENTED(); | 794 base::Time time, |
| 795 const base::Closure& completion) { |
| 796 DCHECK(io_data_.get()); |
| 797 io_data_->ClearNetworkingHistorySince(time, completion); |
| 789 } | 798 } |
| 790 | 799 |
| 791 GURL TestingProfile::GetHomePage() { | 800 GURL TestingProfile::GetHomePage() { |
| 792 return GURL(chrome::kChromeUINewTabURL); | 801 return GURL(chrome::kChromeUINewTabURL); |
| 793 } | 802 } |
| 794 | 803 |
| 795 PrefService* TestingProfile::GetOffTheRecordPrefs() { | 804 PrefService* TestingProfile::GetOffTheRecordPrefs() { |
| 796 return NULL; | 805 return NULL; |
| 797 } | 806 } |
| 798 | 807 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { | 855 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { |
| 847 DCHECK(!build_called_); | 856 DCHECK(!build_called_); |
| 848 build_called_ = true; | 857 build_called_ = true; |
| 849 return scoped_ptr<TestingProfile>(new TestingProfile( | 858 return scoped_ptr<TestingProfile>(new TestingProfile( |
| 850 path_, | 859 path_, |
| 851 delegate_, | 860 delegate_, |
| 852 extension_policy_, | 861 extension_policy_, |
| 853 pref_service_.Pass(), | 862 pref_service_.Pass(), |
| 854 user_cloud_policy_manager_.Pass())); | 863 user_cloud_policy_manager_.Pass())); |
| 855 } | 864 } |
| OLD | NEW |