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

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

Issue 12851008: Create a common base class for all the webdatas (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on trunk and comments Created 7 years, 9 months 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) 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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 HistoryService* history_service = 413 HistoryService* history_service =
414 HistoryServiceFactory::GetForProfileWithoutCreating(this); 414 HistoryServiceFactory::GetForProfileWithoutCreating(this);
415 if (history_service) { 415 if (history_service) {
416 history_service->history_backend_->bookmark_service_ = 416 history_service->history_backend_->bookmark_service_ =
417 bookmark_service; 417 bookmark_service;
418 history_service->history_backend_->expirer_.bookmark_service_ = 418 history_service->history_backend_->expirer_.bookmark_service_ =
419 bookmark_service; 419 bookmark_service;
420 } 420 }
421 } 421 }
422 422
423 static scoped_refptr<RefcountedProfileKeyedService> BuildWebDataService( 423 static ProfileKeyedService* BuildWebDataService(
424 Profile* profile) { 424 Profile* profile) {
425 WebDataService* web_data_service = new WebDataService(); 425 return new WebDataServiceWrapper(profile);
426 if (web_data_service)
427 web_data_service->Init(profile->GetPath());
428 return web_data_service;
429 } 426 }
430 427
431 void TestingProfile::CreateWebDataService() { 428 void TestingProfile::CreateWebDataService() {
432 WebDataServiceFactory::GetInstance()->SetTestingFactory( 429 WebDataServiceFactory::GetInstance()->SetTestingFactory(
433 this, BuildWebDataService); 430 this, BuildWebDataService);
434 } 431 }
435 432
436 void TestingProfile::BlockUntilBookmarkModelLoaded() { 433 void TestingProfile::BlockUntilBookmarkModelLoaded() {
437 // Only get the bookmark model if it actually exists since the caller of the 434 // Only get the bookmark model if it actually exists since the caller of the
438 // test should explicitly call CreateBookmarkModel to build it. 435 // test should explicitly call CreateBookmarkModel to build it.
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 796
800 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { 797 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() {
801 DCHECK(!build_called_); 798 DCHECK(!build_called_);
802 build_called_ = true; 799 build_called_ = true;
803 return scoped_ptr<TestingProfile>(new TestingProfile( 800 return scoped_ptr<TestingProfile>(new TestingProfile(
804 path_, 801 path_,
805 delegate_, 802 delegate_,
806 extension_policy_, 803 extension_policy_,
807 pref_service_.Pass())); 804 pref_service_.Pass()));
808 } 805 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698