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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
472 } | 472 } |
473 | 473 |
474 void ExtensionServiceTestBase::InitializeExtensionService( | 474 void ExtensionServiceTestBase::InitializeExtensionService( |
475 const ExtensionServiceTestBase::ExtensionServiceInitParams& params) { | 475 const ExtensionServiceTestBase::ExtensionServiceInitParams& params) { |
476 TestingProfile::Builder profile_builder; | 476 TestingProfile::Builder profile_builder; |
477 // Create a PrefService that only contains user defined preference values. | 477 // Create a PrefService that only contains user defined preference values. |
478 PrefServiceMockBuilder builder; | 478 PrefServiceMockBuilder builder; |
479 // If pref_file is empty, TestingProfile automatically creates | 479 // If pref_file is empty, TestingProfile automatically creates |
480 // TestingPrefServiceSyncable instance. | 480 // TestingPrefServiceSyncable instance. |
481 if (!params.pref_file.empty()) { | 481 if (!params.pref_file.empty()) { |
482 builder.WithUserFilePrefs(params.pref_file, | 482 builder.SetUserPrefsFile(params.pref_file, |
483 base::MessageLoopProxy::current().get()); | 483 base::MessageLoopProxy::current().get()); |
Jói
2013/11/08 13:48:38
indent one more space
Ilya Sherman
2013/11/11 21:27:55
Done.
| |
484 scoped_refptr<user_prefs::PrefRegistrySyncable> registry( | 484 scoped_refptr<user_prefs::PrefRegistrySyncable> registry( |
485 new user_prefs::PrefRegistrySyncable); | 485 new user_prefs::PrefRegistrySyncable); |
486 scoped_ptr<PrefServiceSyncable> prefs( | 486 scoped_ptr<PrefServiceSyncable> prefs( |
487 builder.CreateSyncable(registry.get())); | 487 builder.CreateSyncable(registry.get())); |
488 chrome::RegisterUserProfilePrefs(registry.get()); | 488 chrome::RegisterUserProfilePrefs(registry.get()); |
489 profile_builder.SetPrefService(prefs.Pass()); | 489 profile_builder.SetPrefService(prefs.Pass()); |
490 } | 490 } |
491 | 491 |
492 if (params.profile_is_managed) | 492 if (params.profile_is_managed) |
493 profile_builder.SetManagedUserId("asdf"); | 493 profile_builder.SetManagedUserId("asdf"); |
(...skipping 6040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6534 // ReconcileKnownDisabled(). | 6534 // ReconcileKnownDisabled(). |
6535 service_->EnableExtension(good2); | 6535 service_->EnableExtension(good2); |
6536 service_->ReconcileKnownDisabled(); | 6536 service_->ReconcileKnownDisabled(); |
6537 expected_extensions.insert(good2); | 6537 expected_extensions.insert(good2); |
6538 expected_disabled_extensions.erase(good2); | 6538 expected_disabled_extensions.erase(good2); |
6539 | 6539 |
6540 EXPECT_EQ(expected_extensions, service_->extensions()->GetIDs()); | 6540 EXPECT_EQ(expected_extensions, service_->extensions()->GetIDs()); |
6541 EXPECT_EQ(expected_disabled_extensions, | 6541 EXPECT_EQ(expected_disabled_extensions, |
6542 service_->disabled_extensions()->GetIDs()); | 6542 service_->disabled_extensions()->GetIDs()); |
6543 } | 6543 } |
OLD | NEW |