| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/browser/extensions/extension_service_unittest.h" | 5 #include "chrome/browser/extensions/extension_service_unittest.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 MessageLoop::current()->RunUntilIdle(); | 448 MessageLoop::current()->RunUntilIdle(); |
| 449 } | 449 } |
| 450 | 450 |
| 451 void ExtensionServiceTestBase::InitializeExtensionService( | 451 void ExtensionServiceTestBase::InitializeExtensionService( |
| 452 const ExtensionServiceTestBase::ExtensionServiceInitParams& params) { | 452 const ExtensionServiceTestBase::ExtensionServiceInitParams& params) { |
| 453 TestingProfile::Builder profile_builder; | 453 TestingProfile::Builder profile_builder; |
| 454 // Create a PrefService that only contains user defined preference values. | 454 // Create a PrefService that only contains user defined preference values. |
| 455 PrefServiceMockBuilder builder; | 455 PrefServiceMockBuilder builder; |
| 456 builder.WithUserFilePrefs( | 456 builder.WithUserFilePrefs( |
| 457 params.pref_file, loop_.message_loop_proxy()); | 457 params.pref_file, loop_.message_loop_proxy()); |
| 458 scoped_refptr<PrefRegistrySyncable> registry(new PrefRegistrySyncable); | 458 scoped_refptr<user_prefs::PrefRegistrySyncable> registry( |
| 459 new user_prefs::PrefRegistrySyncable); |
| 459 scoped_ptr<PrefServiceSyncable> prefs(builder.CreateSyncable(registry)); | 460 scoped_ptr<PrefServiceSyncable> prefs(builder.CreateSyncable(registry)); |
| 460 chrome::RegisterUserPrefs(registry); | 461 chrome::RegisterUserPrefs(registry); |
| 461 profile_builder.SetPrefService(prefs.Pass()); | 462 profile_builder.SetPrefService(prefs.Pass()); |
| 462 profile_builder.SetPath(params.profile_path); | 463 profile_builder.SetPath(params.profile_path); |
| 463 profile_ = profile_builder.Build(); | 464 profile_ = profile_builder.Build(); |
| 464 | 465 |
| 465 TestExtensionSystem* system = static_cast<TestExtensionSystem*>( | 466 TestExtensionSystem* system = static_cast<TestExtensionSystem*>( |
| 466 ExtensionSystem::Get(profile_.get())); | 467 ExtensionSystem::Get(profile_.get())); |
| 467 if (!params.is_first_run) { | 468 if (!params.is_first_run) { |
| 468 ExtensionPrefs* prefs = system->CreateExtensionPrefs( | 469 ExtensionPrefs* prefs = system->CreateExtensionPrefs( |
| (...skipping 5500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5969 new MockExtensionProvider(service_, Manifest::EXTERNAL_PREF); | 5970 new MockExtensionProvider(service_, Manifest::EXTERNAL_PREF); |
| 5970 AddMockExternalProvider(provider); | 5971 AddMockExternalProvider(provider); |
| 5971 provider->UpdateOrAddExtension(updates_from_webstore, "1", crx_path); | 5972 provider->UpdateOrAddExtension(updates_from_webstore, "1", crx_path); |
| 5972 | 5973 |
| 5973 service_->CheckForExternalUpdates(); | 5974 service_->CheckForExternalUpdates(); |
| 5974 loop_.RunUntilIdle(); | 5975 loop_.RunUntilIdle(); |
| 5975 EXPECT_TRUE(extensions::HasExternalInstallError(service_)); | 5976 EXPECT_TRUE(extensions::HasExternalInstallError(service_)); |
| 5976 EXPECT_FALSE(extensions::HasExternalInstallBubble(service_)); | 5977 EXPECT_FALSE(extensions::HasExternalInstallBubble(service_)); |
| 5977 EXPECT_FALSE(service_->IsExtensionEnabled(updates_from_webstore)); | 5978 EXPECT_FALSE(service_->IsExtensionEnabled(updates_from_webstore)); |
| 5978 } | 5979 } |
| OLD | NEW |