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 3371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3382 | 3382 |
3383 EXPECT_TRUE(ValidateBooleanPref(good0, "blacklist", true)); | 3383 EXPECT_TRUE(ValidateBooleanPref(good0, "blacklist", true)); |
3384 EXPECT_FALSE(IsPrefExist(good1, "blacklist")); | 3384 EXPECT_FALSE(IsPrefExist(good1, "blacklist")); |
3385 EXPECT_TRUE(ValidateBooleanPref(good2, "blacklist", true)); | 3385 EXPECT_TRUE(ValidateBooleanPref(good2, "blacklist", true)); |
3386 EXPECT_FALSE(IsPrefExist("invalid_id", "blacklist")); | 3386 EXPECT_FALSE(IsPrefExist("invalid_id", "blacklist")); |
3387 } | 3387 } |
3388 #endif // defined(ENABLE_BLACKLIST_TESTS) | 3388 #endif // defined(ENABLE_BLACKLIST_TESTS) |
3389 | 3389 |
3390 #if defined(ENABLE_BLACKLIST_TESTS) | 3390 #if defined(ENABLE_BLACKLIST_TESTS) |
3391 // Tests trying to install a blacklisted extension. | 3391 // Tests trying to install a blacklisted extension. |
3392 TEST_F(ExtensionServiceTest, BlacklistedExtensionWillNotInstall) { | 3392 // Disabled due to http://crbug.com/315396 |
| 3393 TEST_F(ExtensionServiceTest, |
| 3394 DISABLED_BlacklistedExtensionWillNotInstall) { |
3393 scoped_refptr<FakeSafeBrowsingDatabaseManager> blacklist_db( | 3395 scoped_refptr<FakeSafeBrowsingDatabaseManager> blacklist_db( |
3394 new FakeSafeBrowsingDatabaseManager(true)); | 3396 new FakeSafeBrowsingDatabaseManager(true)); |
3395 Blacklist::ScopedDatabaseManagerForTest scoped_blacklist_db(blacklist_db); | 3397 Blacklist::ScopedDatabaseManagerForTest scoped_blacklist_db(blacklist_db); |
3396 | 3398 |
3397 InitializeEmptyExtensionService(); | 3399 InitializeEmptyExtensionService(); |
3398 service_->Init(); | 3400 service_->Init(); |
3399 | 3401 |
3400 // After blacklisting good_crx, we cannot install it. | 3402 // After blacklisting good_crx, we cannot install it. |
3401 blacklist_db->SetUnsafe(good_crx).NotifyUpdate(); | 3403 blacklist_db->SetUnsafe(good_crx).NotifyUpdate(); |
3402 base::RunLoop().RunUntilIdle(); | 3404 base::RunLoop().RunUntilIdle(); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3437 | 3439 |
3438 // The good_crx is blacklisted and the whitelist doesn't negate it. | 3440 // The good_crx is blacklisted and the whitelist doesn't negate it. |
3439 ASSERT_TRUE(ValidateBooleanPref(good_crx, "blacklist", true)); | 3441 ASSERT_TRUE(ValidateBooleanPref(good_crx, "blacklist", true)); |
3440 EXPECT_EQ(0u, service_->extensions()->size()); | 3442 EXPECT_EQ(0u, service_->extensions()->size()); |
3441 } | 3443 } |
3442 #endif // defined(ENABLE_BLACKLIST_TESTS) | 3444 #endif // defined(ENABLE_BLACKLIST_TESTS) |
3443 | 3445 |
3444 #if defined(ENABLE_BLACKLIST_TESTS) | 3446 #if defined(ENABLE_BLACKLIST_TESTS) |
3445 // Tests that a blacklisted extension is eventually unloaded on startup, if it | 3447 // Tests that a blacklisted extension is eventually unloaded on startup, if it |
3446 // wasn't already. | 3448 // wasn't already. |
3447 TEST_F(ExtensionServiceTest, WillNotLoadBlacklistedExtensionsFromDirectory) { | 3449 // Disabled due to http://crbug.com/315396 |
| 3450 TEST_F(ExtensionServiceTest, |
| 3451 DISABLED_WillNotLoadBlacklistedExtensionsFromDirectory) { |
3448 scoped_refptr<FakeSafeBrowsingDatabaseManager> blacklist_db( | 3452 scoped_refptr<FakeSafeBrowsingDatabaseManager> blacklist_db( |
3449 new FakeSafeBrowsingDatabaseManager(true)); | 3453 new FakeSafeBrowsingDatabaseManager(true)); |
3450 Blacklist::ScopedDatabaseManagerForTest scoped_blacklist_db(blacklist_db); | 3454 Blacklist::ScopedDatabaseManagerForTest scoped_blacklist_db(blacklist_db); |
3451 | 3455 |
3452 // A profile with 3 extensions installed: good0, good1, and good2. | 3456 // A profile with 3 extensions installed: good0, good1, and good2. |
3453 InitializeGoodInstalledExtensionService(); | 3457 InitializeGoodInstalledExtensionService(); |
3454 | 3458 |
3455 // Blacklist good1 before the service initializes. | 3459 // Blacklist good1 before the service initializes. |
3456 blacklist_db->SetUnsafe(good1); | 3460 blacklist_db->SetUnsafe(good1); |
3457 | 3461 |
(...skipping 3076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6534 // ReconcileKnownDisabled(). | 6538 // ReconcileKnownDisabled(). |
6535 service_->EnableExtension(good2); | 6539 service_->EnableExtension(good2); |
6536 service_->ReconcileKnownDisabled(); | 6540 service_->ReconcileKnownDisabled(); |
6537 expected_extensions.insert(good2); | 6541 expected_extensions.insert(good2); |
6538 expected_disabled_extensions.erase(good2); | 6542 expected_disabled_extensions.erase(good2); |
6539 | 6543 |
6540 EXPECT_EQ(expected_extensions, service_->extensions()->GetIDs()); | 6544 EXPECT_EQ(expected_extensions, service_->extensions()->GetIDs()); |
6541 EXPECT_EQ(expected_disabled_extensions, | 6545 EXPECT_EQ(expected_disabled_extensions, |
6542 service_->disabled_extensions()->GetIDs()); | 6546 service_->disabled_extensions()->GetIDs()); |
6543 } | 6547 } |
OLD | NEW |