| 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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 scoped_refptr<RefcountedProfileKeyedService> BuildWebDataService( |
| 424 Profile* profile) { | 424 Profile* profile) { |
| 425 base::FilePath path = profile->GetPath(); |
| 426 path = path.Append(chrome::kWebDataFilename); |
| 425 WebDataService* web_data_service = new WebDataService(); | 427 WebDataService* web_data_service = new WebDataService(); |
| 426 if (web_data_service) | 428 if (web_data_service) |
| 427 web_data_service->Init(profile->GetPath()); | 429 web_data_service->Init(path); |
| 428 return web_data_service; | 430 return web_data_service; |
| 429 } | 431 } |
| 430 | 432 |
| 431 void TestingProfile::CreateWebDataService() { | 433 void TestingProfile::CreateWebDataService() { |
| 432 WebDataServiceFactory::GetInstance()->SetTestingFactory( | 434 WebDataServiceFactory::GetInstance()->SetTestingFactory( |
| 433 this, BuildWebDataService); | 435 this, BuildWebDataService); |
| 434 } | 436 } |
| 435 | 437 |
| 436 void TestingProfile::BlockUntilBookmarkModelLoaded() { | 438 void TestingProfile::BlockUntilBookmarkModelLoaded() { |
| 437 // Only get the bookmark model if it actually exists since the caller of the | 439 // Only get the bookmark model if it actually exists since the caller of the |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 | 801 |
| 800 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { | 802 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { |
| 801 DCHECK(!build_called_); | 803 DCHECK(!build_called_); |
| 802 build_called_ = true; | 804 build_called_ = true; |
| 803 return scoped_ptr<TestingProfile>(new TestingProfile( | 805 return scoped_ptr<TestingProfile>(new TestingProfile( |
| 804 path_, | 806 path_, |
| 805 delegate_, | 807 delegate_, |
| 806 extension_policy_, | 808 extension_policy_, |
| 807 pref_service_.Pass())); | 809 pref_service_.Pass())); |
| 808 } | 810 } |
| OLD | NEW |