| 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 if (delegate_) { | 190 if (delegate_) { |
| 191 MessageLoop::current()->PostTask(FROM_HERE, | 191 MessageLoop::current()->PostTask(FROM_HERE, |
| 192 base::Bind(&TestingProfile::FinishInit, | 192 base::Bind(&TestingProfile::FinishInit, |
| 193 base::Unretained(this))); | 193 base::Unretained(this))); |
| 194 } else { | 194 } else { |
| 195 FinishInit(); | 195 FinishInit(); |
| 196 } | 196 } |
| 197 } | 197 } |
| 198 | 198 |
| 199 void TestingProfile::Init() { | 199 void TestingProfile::Init() { |
| 200 if (!file_util::PathExists(profile_path_)) |
| 201 file_util::CreateDirectory(profile_path_); |
| 202 |
| 200 ExtensionSystemFactory::GetInstance()->SetTestingFactory( | 203 ExtensionSystemFactory::GetInstance()->SetTestingFactory( |
| 201 this, TestExtensionSystem::Build); | 204 this, TestExtensionSystem::Build); |
| 202 | 205 |
| 203 profile_dependency_manager_->CreateProfileServices(this, true); | 206 profile_dependency_manager_->CreateProfileServices(this, true); |
| 204 | 207 |
| 205 #if defined(ENABLE_NOTIFICATIONS) | 208 #if defined(ENABLE_NOTIFICATIONS) |
| 206 // Install profile keyed service factory hooks for dummy/test services | 209 // Install profile keyed service factory hooks for dummy/test services |
| 207 DesktopNotificationServiceFactory::GetInstance()->SetTestingFactory( | 210 DesktopNotificationServiceFactory::GetInstance()->SetTestingFactory( |
| 208 this, CreateTestDesktopNotificationService); | 211 this, CreateTestDesktopNotificationService); |
| 209 #endif | 212 #endif |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 } | 713 } |
| 711 | 714 |
| 712 bool TestingProfile::WasCreatedByVersionOrLater(const std::string& version) { | 715 bool TestingProfile::WasCreatedByVersionOrLater(const std::string& version) { |
| 713 return true; | 716 return true; |
| 714 } | 717 } |
| 715 | 718 |
| 716 base::Callback<ChromeURLDataManagerBackend*(void)> | 719 base::Callback<ChromeURLDataManagerBackend*(void)> |
| 717 TestingProfile::GetChromeURLDataManagerBackendGetter() const { | 720 TestingProfile::GetChromeURLDataManagerBackendGetter() const { |
| 718 return base::Callback<ChromeURLDataManagerBackend*(void)>(); | 721 return base::Callback<ChromeURLDataManagerBackend*(void)>(); |
| 719 } | 722 } |
| OLD | NEW |