| 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/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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 | 366 |
| 367 static ProfileKeyedService* BuildTemplateURLService(Profile* profile) { | 367 static ProfileKeyedService* BuildTemplateURLService(Profile* profile) { |
| 368 return new TemplateURLService(profile); | 368 return new TemplateURLService(profile); |
| 369 } | 369 } |
| 370 | 370 |
| 371 void TestingProfile::CreateTemplateURLService() { | 371 void TestingProfile::CreateTemplateURLService() { |
| 372 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 372 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
| 373 this, BuildTemplateURLService); | 373 this, BuildTemplateURLService); |
| 374 } | 374 } |
| 375 | 375 |
| 376 void TestingProfile::BlockUntilTemplateURLServiceLoaded() { | |
| 377 TemplateURLService* turl_model = | |
| 378 TemplateURLServiceFactory::GetForProfile(this); | |
| 379 if (turl_model->loaded()) | |
| 380 return; | |
| 381 | |
| 382 ui_test_utils::WindowedNotificationObserver turl_service_load_observer( | |
| 383 chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED, | |
| 384 content::NotificationService::AllSources()); | |
| 385 turl_model->Load(); | |
| 386 turl_service_load_observer.Wait(); | |
| 387 } | |
| 388 | |
| 389 void TestingProfile::CreateExtensionProcessManager() { | 376 void TestingProfile::CreateExtensionProcessManager() { |
| 390 extension_process_manager_.reset(ExtensionProcessManager::Create(this)); | 377 extension_process_manager_.reset(ExtensionProcessManager::Create(this)); |
| 391 } | 378 } |
| 392 | 379 |
| 393 ExtensionService* TestingProfile::CreateExtensionService( | 380 ExtensionService* TestingProfile::CreateExtensionService( |
| 394 const CommandLine* command_line, | 381 const CommandLine* command_line, |
| 395 const FilePath& install_directory, | 382 const FilePath& install_directory, |
| 396 bool autoupdate_enabled) { | 383 bool autoupdate_enabled) { |
| 397 // Extension pref store, created for use by |extension_prefs_|. | 384 // Extension pref store, created for use by |extension_prefs_|. |
| 398 | 385 |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() { | 841 quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() { |
| 855 return GetExtensionSpecialStoragePolicy(); | 842 return GetExtensionSpecialStoragePolicy(); |
| 856 } | 843 } |
| 857 | 844 |
| 858 void TestingProfile::DestroyWebDataService() { | 845 void TestingProfile::DestroyWebDataService() { |
| 859 if (!web_data_service_.get()) | 846 if (!web_data_service_.get()) |
| 860 return; | 847 return; |
| 861 | 848 |
| 862 web_data_service_->Shutdown(); | 849 web_data_service_->Shutdown(); |
| 863 } | 850 } |
| OLD | NEW |