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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 | 457 |
458 void ExtensionServiceTestBase::InitializeExtensionService( | 458 void ExtensionServiceTestBase::InitializeExtensionService( |
459 const ExtensionServiceTestBase::ExtensionServiceInitParams& params) { | 459 const ExtensionServiceTestBase::ExtensionServiceInitParams& params) { |
460 TestingProfile::Builder profile_builder; | 460 TestingProfile::Builder profile_builder; |
461 // Create a PrefService that only contains user defined preference values. | 461 // Create a PrefService that only contains user defined preference values. |
462 PrefServiceMockBuilder builder; | 462 PrefServiceMockBuilder builder; |
463 builder.WithUserFilePrefs(params.pref_file, loop_.message_loop_proxy().get()); | 463 builder.WithUserFilePrefs(params.pref_file, loop_.message_loop_proxy().get()); |
464 scoped_refptr<user_prefs::PrefRegistrySyncable> registry( | 464 scoped_refptr<user_prefs::PrefRegistrySyncable> registry( |
465 new user_prefs::PrefRegistrySyncable); | 465 new user_prefs::PrefRegistrySyncable); |
466 scoped_ptr<PrefServiceSyncable> prefs(builder.CreateSyncable(registry.get())); | 466 scoped_ptr<PrefServiceSyncable> prefs(builder.CreateSyncable(registry.get())); |
467 chrome::RegisterUserPrefs(registry.get()); | 467 chrome::RegisterUserProfilePrefs(registry.get()); |
468 profile_builder.SetPrefService(prefs.Pass()); | 468 profile_builder.SetPrefService(prefs.Pass()); |
469 profile_builder.SetPath(params.profile_path); | 469 profile_builder.SetPath(params.profile_path); |
470 profile_ = profile_builder.Build(); | 470 profile_ = profile_builder.Build(); |
471 | 471 |
472 TestExtensionSystem* system = static_cast<TestExtensionSystem*>( | 472 TestExtensionSystem* system = static_cast<TestExtensionSystem*>( |
473 ExtensionSystem::Get(profile_.get())); | 473 ExtensionSystem::Get(profile_.get())); |
474 if (!params.is_first_run) { | 474 if (!params.is_first_run) { |
475 ExtensionPrefs* prefs = system->CreateExtensionPrefs( | 475 ExtensionPrefs* prefs = system->CreateExtensionPrefs( |
476 CommandLine::ForCurrentProcess(), | 476 CommandLine::ForCurrentProcess(), |
477 params.extensions_install_dir); | 477 params.extensions_install_dir); |
(...skipping 5617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6095 new MockExtensionProvider(service_, Manifest::EXTERNAL_PREF); | 6095 new MockExtensionProvider(service_, Manifest::EXTERNAL_PREF); |
6096 AddMockExternalProvider(provider); | 6096 AddMockExternalProvider(provider); |
6097 provider->UpdateOrAddExtension(updates_from_webstore, "1", crx_path); | 6097 provider->UpdateOrAddExtension(updates_from_webstore, "1", crx_path); |
6098 | 6098 |
6099 service_->CheckForExternalUpdates(); | 6099 service_->CheckForExternalUpdates(); |
6100 loop_.RunUntilIdle(); | 6100 loop_.RunUntilIdle(); |
6101 EXPECT_TRUE(extensions::HasExternalInstallError(service_)); | 6101 EXPECT_TRUE(extensions::HasExternalInstallError(service_)); |
6102 EXPECT_FALSE(extensions::HasExternalInstallBubble(service_)); | 6102 EXPECT_FALSE(extensions::HasExternalInstallBubble(service_)); |
6103 EXPECT_FALSE(service_->IsExtensionEnabled(updates_from_webstore)); | 6103 EXPECT_FALSE(service_->IsExtensionEnabled(updates_from_webstore)); |
6104 } | 6104 } |
OLD | NEW |