| 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 3351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3362 // initialized. | 3362 // initialized. |
| 3363 TEST_F(ExtensionServiceTest, SetUnsetBlacklistInPrefs) { | 3363 TEST_F(ExtensionServiceTest, SetUnsetBlacklistInPrefs) { |
| 3364 scoped_refptr<FakeSafeBrowsingDatabaseManager> blacklist_db( | 3364 scoped_refptr<FakeSafeBrowsingDatabaseManager> blacklist_db( |
| 3365 new FakeSafeBrowsingDatabaseManager(true)); | 3365 new FakeSafeBrowsingDatabaseManager(true)); |
| 3366 Blacklist::ScopedDatabaseManagerForTest scoped_blacklist_db(blacklist_db); | 3366 Blacklist::ScopedDatabaseManagerForTest scoped_blacklist_db(blacklist_db); |
| 3367 | 3367 |
| 3368 // A profile with 3 extensions installed: good0, good1, and good2. | 3368 // A profile with 3 extensions installed: good0, good1, and good2. |
| 3369 InitializeGoodInstalledExtensionService(); | 3369 InitializeGoodInstalledExtensionService(); |
| 3370 service_->Init(); | 3370 service_->Init(); |
| 3371 | 3371 |
| 3372 const ExtensionSet* extensions = service_->extensions(); | 3372 const extensions::ExtensionSet* extensions = service_->extensions(); |
| 3373 const ExtensionSet* blacklisted_extensions = | 3373 const extensions::ExtensionSet* blacklisted_extensions = |
| 3374 service_->blacklisted_extensions(); | 3374 service_->blacklisted_extensions(); |
| 3375 | 3375 |
| 3376 EXPECT_TRUE( extensions->Contains(good0) && | 3376 EXPECT_TRUE( extensions->Contains(good0) && |
| 3377 !blacklisted_extensions->Contains(good0)); | 3377 !blacklisted_extensions->Contains(good0)); |
| 3378 EXPECT_TRUE( extensions->Contains(good1) && | 3378 EXPECT_TRUE( extensions->Contains(good1) && |
| 3379 !blacklisted_extensions->Contains(good1)); | 3379 !blacklisted_extensions->Contains(good1)); |
| 3380 EXPECT_TRUE( extensions->Contains(good2) && | 3380 EXPECT_TRUE( extensions->Contains(good2) && |
| 3381 !blacklisted_extensions->Contains(good2)); | 3381 !blacklisted_extensions->Contains(good2)); |
| 3382 | 3382 |
| 3383 EXPECT_FALSE(IsPrefExist(good0, "blacklist")); | 3383 EXPECT_FALSE(IsPrefExist(good0, "blacklist")); |
| (...skipping 3357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6741 // ReconcileKnownDisabled(). | 6741 // ReconcileKnownDisabled(). |
| 6742 service_->EnableExtension(good2); | 6742 service_->EnableExtension(good2); |
| 6743 service_->ReconcileKnownDisabled(); | 6743 service_->ReconcileKnownDisabled(); |
| 6744 expected_extensions.insert(good2); | 6744 expected_extensions.insert(good2); |
| 6745 expected_disabled_extensions.erase(good2); | 6745 expected_disabled_extensions.erase(good2); |
| 6746 | 6746 |
| 6747 EXPECT_EQ(expected_extensions, service_->extensions()->GetIDs()); | 6747 EXPECT_EQ(expected_extensions, service_->extensions()->GetIDs()); |
| 6748 EXPECT_EQ(expected_disabled_extensions, | 6748 EXPECT_EQ(expected_disabled_extensions, |
| 6749 service_->disabled_extensions()->GetIDs()); | 6749 service_->disabled_extensions()->GetIDs()); |
| 6750 } | 6750 } |
| OLD | NEW |