| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 #include "testing/gmock/include/gmock/gmock.h" | 70 #include "testing/gmock/include/gmock/gmock.h" |
| 71 | 71 |
| 72 #if defined(ENABLE_CONFIGURATION_POLICY) | 72 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 73 #include "chrome/browser/policy/policy_service_impl.h" | 73 #include "chrome/browser/policy/policy_service_impl.h" |
| 74 #else | 74 #else |
| 75 #include "chrome/browser/policy/policy_service_stub.h" | 75 #include "chrome/browser/policy/policy_service_stub.h" |
| 76 #endif // defined(ENABLE_CONFIGURATION_POLICY) | 76 #endif // defined(ENABLE_CONFIGURATION_POLICY) |
| 77 | 77 |
| 78 #if defined(OS_CHROMEOS) | 78 #if defined(OS_CHROMEOS) |
| 79 #include "chrome/browser/chromeos/proxy_config_service_impl.h" | 79 #include "chrome/browser/chromeos/proxy_config_service_impl.h" |
| 80 #include "chromeos/dbus/dbus_thread_manager.h" |
| 80 #endif // defined(OS_CHROMEOS) | 81 #endif // defined(OS_CHROMEOS) |
| 81 | 82 |
| 82 using base::Time; | 83 using base::Time; |
| 83 using content::BrowserThread; | 84 using content::BrowserThread; |
| 84 using content::DownloadManagerDelegate; | 85 using content::DownloadManagerDelegate; |
| 85 using testing::NiceMock; | 86 using testing::NiceMock; |
| 86 using testing::Return; | 87 using testing::Return; |
| 87 | 88 |
| 88 namespace { | 89 namespace { |
| 89 | 90 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 // That shouldn't happen, but if it does, try to recover. | 266 // That shouldn't happen, but if it does, try to recover. |
| 266 LOG(ERROR) << "Failed to use a fallback temporary directory."; | 267 LOG(ERROR) << "Failed to use a fallback temporary directory."; |
| 267 | 268 |
| 268 // We're screwed if this fails, see CHECK above. | 269 // We're screwed if this fails, see CHECK above. |
| 269 CHECK(temp_dir_.Set(system_tmp_dir)); | 270 CHECK(temp_dir_.Set(system_tmp_dir)); |
| 270 } | 271 } |
| 271 } | 272 } |
| 272 } | 273 } |
| 273 | 274 |
| 274 void TestingProfile::Init() { | 275 void TestingProfile::Init() { |
| 276 #if defined(OS_CHROMEOS) |
| 277 chromeos::DBusThreadManager::Initialize(); |
| 278 #endif |
| 275 if (prefs_.get()) | 279 if (prefs_.get()) |
| 276 components::UserPrefs::Set(this, prefs_.get()); | 280 components::UserPrefs::Set(this, prefs_.get()); |
| 277 | 281 |
| 278 if (!file_util::PathExists(profile_path_)) | 282 if (!file_util::PathExists(profile_path_)) |
| 279 file_util::CreateDirectory(profile_path_); | 283 file_util::CreateDirectory(profile_path_); |
| 280 | 284 |
| 281 extensions::ExtensionSystemFactory::GetInstance()->SetTestingFactory( | 285 extensions::ExtensionSystemFactory::GetInstance()->SetTestingFactory( |
| 282 this, extensions::TestExtensionSystem::Build); | 286 this, extensions::TestExtensionSystem::Build); |
| 283 | 287 |
| 284 profile_dependency_manager_->CreateProfileServices(this, true); | 288 profile_dependency_manager_->CreateProfileServices(this, true); |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 | 783 |
| 780 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { | 784 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { |
| 781 DCHECK(!build_called_); | 785 DCHECK(!build_called_); |
| 782 build_called_ = true; | 786 build_called_ = true; |
| 783 return scoped_ptr<TestingProfile>(new TestingProfile( | 787 return scoped_ptr<TestingProfile>(new TestingProfile( |
| 784 path_, | 788 path_, |
| 785 delegate_, | 789 delegate_, |
| 786 extension_policy_, | 790 extension_policy_, |
| 787 pref_service_.Pass())); | 791 pref_service_.Pass())); |
| 788 } | 792 } |
| OLD | NEW |