Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(544)

Side by Side Diff: chrome/test/base/testing_profile.cc

Issue 8869005: Revert EnableClose() removal and related crash fixes. I don't understand the crashes here, and th... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698