Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(977)

Side by Side Diff: chrome/browser/extensions/extension_service_unittest.cc

Issue 60833007: Add ::Leaky to the LazyInstance<SafeBrowsingServiceFactoryImpl> in (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 // Disabled due to http://crbug.com/315396 3392 TEST_F(ExtensionServiceTest, BlacklistedExtensionWillNotInstall) {
3393 TEST_F(ExtensionServiceTest,
3394 DISABLED_BlacklistedExtensionWillNotInstall) {
3395 scoped_refptr<FakeSafeBrowsingDatabaseManager> blacklist_db( 3393 scoped_refptr<FakeSafeBrowsingDatabaseManager> blacklist_db(
3396 new FakeSafeBrowsingDatabaseManager(true)); 3394 new FakeSafeBrowsingDatabaseManager(true));
3397 Blacklist::ScopedDatabaseManagerForTest scoped_blacklist_db(blacklist_db); 3395 Blacklist::ScopedDatabaseManagerForTest scoped_blacklist_db(blacklist_db);
3398 3396
3399 InitializeEmptyExtensionService(); 3397 InitializeEmptyExtensionService();
3400 service_->Init(); 3398 service_->Init();
3401 3399
3402 // After blacklisting good_crx, we cannot install it. 3400 // After blacklisting good_crx, we cannot install it.
3403 blacklist_db->SetUnsafe(good_crx).NotifyUpdate(); 3401 blacklist_db->SetUnsafe(good_crx).NotifyUpdate();
3404 base::RunLoop().RunUntilIdle(); 3402 base::RunLoop().RunUntilIdle();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
3439 3437
3440 // The good_crx is blacklisted and the whitelist doesn't negate it. 3438 // The good_crx is blacklisted and the whitelist doesn't negate it.
3441 ASSERT_TRUE(ValidateBooleanPref(good_crx, "blacklist", true)); 3439 ASSERT_TRUE(ValidateBooleanPref(good_crx, "blacklist", true));
3442 EXPECT_EQ(0u, service_->extensions()->size()); 3440 EXPECT_EQ(0u, service_->extensions()->size());
3443 } 3441 }
3444 #endif // defined(ENABLE_BLACKLIST_TESTS) 3442 #endif // defined(ENABLE_BLACKLIST_TESTS)
3445 3443
3446 #if defined(ENABLE_BLACKLIST_TESTS) 3444 #if defined(ENABLE_BLACKLIST_TESTS)
3447 // Tests that a blacklisted extension is eventually unloaded on startup, if it 3445 // Tests that a blacklisted extension is eventually unloaded on startup, if it
3448 // wasn't already. 3446 // wasn't already.
3449 // Disabled due to http://crbug.com/315396 3447 TEST_F(ExtensionServiceTest, WillNotLoadBlacklistedExtensionsFromDirectory) {
3450 TEST_F(ExtensionServiceTest,
3451 DISABLED_WillNotLoadBlacklistedExtensionsFromDirectory) {
3452 scoped_refptr<FakeSafeBrowsingDatabaseManager> blacklist_db( 3448 scoped_refptr<FakeSafeBrowsingDatabaseManager> blacklist_db(
3453 new FakeSafeBrowsingDatabaseManager(true)); 3449 new FakeSafeBrowsingDatabaseManager(true));
3454 Blacklist::ScopedDatabaseManagerForTest scoped_blacklist_db(blacklist_db); 3450 Blacklist::ScopedDatabaseManagerForTest scoped_blacklist_db(blacklist_db);
3455 3451
3456 // A profile with 3 extensions installed: good0, good1, and good2. 3452 // A profile with 3 extensions installed: good0, good1, and good2.
3457 InitializeGoodInstalledExtensionService(); 3453 InitializeGoodInstalledExtensionService();
3458 3454
3459 // Blacklist good1 before the service initializes. 3455 // Blacklist good1 before the service initializes.
3460 blacklist_db->SetUnsafe(good1); 3456 blacklist_db->SetUnsafe(good1);
3461 3457
(...skipping 3076 matching lines...) Expand 10 before | Expand all | Expand 10 after
6538 // ReconcileKnownDisabled(). 6534 // ReconcileKnownDisabled().
6539 service_->EnableExtension(good2); 6535 service_->EnableExtension(good2);
6540 service_->ReconcileKnownDisabled(); 6536 service_->ReconcileKnownDisabled();
6541 expected_extensions.insert(good2); 6537 expected_extensions.insert(good2);
6542 expected_disabled_extensions.erase(good2); 6538 expected_disabled_extensions.erase(good2);
6543 6539
6544 EXPECT_EQ(expected_extensions, service_->extensions()->GetIDs()); 6540 EXPECT_EQ(expected_extensions, service_->extensions()->GetIDs());
6545 EXPECT_EQ(expected_disabled_extensions, 6541 EXPECT_EQ(expected_disabled_extensions,
6546 service_->disabled_extensions()->GetIDs()); 6542 service_->disabled_extensions()->GetIDs());
6547 } 6543 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698