| 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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 if (resource_context_) { | 389 if (resource_context_) { |
| 390 CHECK(BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, | 390 CHECK(BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, |
| 391 resource_context_)); | 391 resource_context_)); |
| 392 resource_context_ = NULL; | 392 resource_context_ = NULL; |
| 393 content::RunAllPendingInMessageLoop(BrowserThread::IO); | 393 content::RunAllPendingInMessageLoop(BrowserThread::IO); |
| 394 } | 394 } |
| 395 } | 395 } |
| 396 | 396 |
| 397 static BrowserContextKeyedService* BuildFaviconService( | 397 static BrowserContextKeyedService* BuildFaviconService( |
| 398 content::BrowserContext* profile) { | 398 content::BrowserContext* profile) { |
| 399 return new FaviconService( | 399 return new FaviconService(static_cast<Profile*>(profile)); |
| 400 HistoryServiceFactory::GetForProfileWithoutCreating( | |
| 401 static_cast<Profile*>(profile))); | |
| 402 } | 400 } |
| 403 | 401 |
| 404 void TestingProfile::CreateFaviconService() { | 402 void TestingProfile::CreateFaviconService() { |
| 405 // It is up to the caller to create the history service if one is needed. | 403 // It is up to the caller to create the history service if one is needed. |
| 406 FaviconServiceFactory::GetInstance()->SetTestingFactory( | 404 FaviconServiceFactory::GetInstance()->SetTestingFactory( |
| 407 this, BuildFaviconService); | 405 this, BuildFaviconService); |
| 408 } | 406 } |
| 409 | 407 |
| 410 static BrowserContextKeyedService* BuildHistoryService( | 408 static BrowserContextKeyedService* BuildHistoryService( |
| 411 content::BrowserContext* profile) { | 409 content::BrowserContext* profile) { |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 | 896 |
| 899 return scoped_ptr<TestingProfile>(new TestingProfile( | 897 return scoped_ptr<TestingProfile>(new TestingProfile( |
| 900 path_, | 898 path_, |
| 901 delegate_, | 899 delegate_, |
| 902 extension_policy_, | 900 extension_policy_, |
| 903 pref_service_.Pass(), | 901 pref_service_.Pass(), |
| 904 incognito_, | 902 incognito_, |
| 905 managed_user_id_, | 903 managed_user_id_, |
| 906 testing_factories_)); | 904 testing_factories_)); |
| 907 } | 905 } |
| OLD | NEW |