| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 return context_.get(); | 112 return context_.get(); |
| 113 } | 113 } |
| 114 virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const { | 114 virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const { |
| 115 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 115 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
| 116 } | 116 } |
| 117 | 117 |
| 118 private: | 118 private: |
| 119 scoped_refptr<net::URLRequestContext> context_; | 119 scoped_refptr<net::URLRequestContext> context_; |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 ProfileKeyedBase* CreateTestDesktopNotificationService(Profile* profile) { | 122 ProfileKeyedService* CreateTestDesktopNotificationService(Profile* profile) { |
| 123 return new DesktopNotificationService(profile, NULL); | 123 return new DesktopNotificationService(profile, NULL); |
| 124 } | 124 } |
| 125 | 125 |
| 126 } // namespace | 126 } // namespace |
| 127 | 127 |
| 128 TestingProfile::TestingProfile() | 128 TestingProfile::TestingProfile() |
| 129 : start_time_(Time::Now()), | 129 : start_time_(Time::Now()), |
| 130 testing_prefs_(NULL), | 130 testing_prefs_(NULL), |
| 131 incognito_(false), | 131 incognito_(false), |
| 132 last_session_exited_cleanly_(true), | 132 last_session_exited_cleanly_(true), |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 content::NotificationService::AllSources()); | 356 content::NotificationService::AllSources()); |
| 357 if (!GetHistoryService(Profile::EXPLICIT_ACCESS)) | 357 if (!GetHistoryService(Profile::EXPLICIT_ACCESS)) |
| 358 GetTopSites()->HistoryLoaded(); | 358 GetTopSites()->HistoryLoaded(); |
| 359 top_sites_loaded_observer.Wait(); | 359 top_sites_loaded_observer.Wait(); |
| 360 } | 360 } |
| 361 | 361 |
| 362 void TestingProfile::CreateTemplateURLFetcher() { | 362 void TestingProfile::CreateTemplateURLFetcher() { |
| 363 template_url_fetcher_.reset(new TemplateURLFetcher(this)); | 363 template_url_fetcher_.reset(new TemplateURLFetcher(this)); |
| 364 } | 364 } |
| 365 | 365 |
| 366 static ProfileKeyedBase* BuildTemplateURLService(Profile* profile) { | 366 static ProfileKeyedService* BuildTemplateURLService(Profile* profile) { |
| 367 return new TemplateURLService(profile); | 367 return new TemplateURLService(profile); |
| 368 } | 368 } |
| 369 | 369 |
| 370 void TestingProfile::CreateTemplateURLService() { | 370 void TestingProfile::CreateTemplateURLService() { |
| 371 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 371 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
| 372 this, BuildTemplateURLService); | 372 this, BuildTemplateURLService); |
| 373 } | 373 } |
| 374 | 374 |
| 375 void TestingProfile::BlockUntilTemplateURLServiceLoaded() { | 375 void TestingProfile::BlockUntilTemplateURLServiceLoaded() { |
| 376 TemplateURLService* turl_model = | 376 TemplateURLService* turl_model = |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 void TestingProfile::DestroyWebDataService() { | 758 void TestingProfile::DestroyWebDataService() { |
| 759 if (!web_data_service_.get()) | 759 if (!web_data_service_.get()) |
| 760 return; | 760 return; |
| 761 | 761 |
| 762 web_data_service_->Shutdown(); | 762 web_data_service_->Shutdown(); |
| 763 } | 763 } |
| 764 | 764 |
| 765 bool TestingProfile::WasCreatedByVersionOrLater(const std::string& version) { | 765 bool TestingProfile::WasCreatedByVersionOrLater(const std::string& version) { |
| 766 return true; | 766 return true; |
| 767 } | 767 } |
| OLD | NEW |