| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <set> | 6 #include <set> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 #include "webkit/browser/database/database_tracker.h" | 125 #include "webkit/browser/database/database_tracker.h" |
| 126 #include "webkit/browser/quota/quota_manager.h" | 126 #include "webkit/browser/quota/quota_manager.h" |
| 127 #include "webkit/common/database/database_identifier.h" | 127 #include "webkit/common/database/database_identifier.h" |
| 128 | 128 |
| 129 #if defined(OS_CHROMEOS) | 129 #if defined(OS_CHROMEOS) |
| 130 #include "chrome/browser/chromeos/login/users/user_manager.h" | 130 #include "chrome/browser/chromeos/login/users/user_manager.h" |
| 131 #include "chrome/browser/chromeos/settings/cros_settings.h" | 131 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 132 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 132 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
| 133 #endif | 133 #endif |
| 134 | 134 |
| 135 // The blacklist tests rely on safe browsing. | 135 // The blacklist tests rely on the safe-browsing database. |
| 136 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) | 136 #if defined(SAFE_BROWSING_DATABASE) |
| 137 #define ENABLE_BLACKLIST_TESTS | 137 #define ENABLE_BLACKLIST_TESTS |
| 138 #endif | 138 #endif |
| 139 | 139 |
| 140 using base::DictionaryValue; | 140 using base::DictionaryValue; |
| 141 using base::ListValue; | 141 using base::ListValue; |
| 142 using base::Value; | 142 using base::Value; |
| 143 using content::BrowserContext; | 143 using content::BrowserContext; |
| 144 using content::BrowserThread; | 144 using content::BrowserThread; |
| 145 using content::DOMStorageContext; | 145 using content::DOMStorageContext; |
| 146 using content::IndexedDBContext; | 146 using content::IndexedDBContext; |
| (...skipping 3400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3547 registry()->blacklisted_extensions().GetIDs()); | 3547 registry()->blacklisted_extensions().GetIDs()); |
| 3548 | 3548 |
| 3549 service()->ReloadExtension(good1); | 3549 service()->ReloadExtension(good1); |
| 3550 service()->ReloadExtension(good2); | 3550 service()->ReloadExtension(good2); |
| 3551 base::RunLoop().RunUntilIdle(); | 3551 base::RunLoop().RunUntilIdle(); |
| 3552 | 3552 |
| 3553 EXPECT_EQ(StringSet(good0), registry()->enabled_extensions().GetIDs()); | 3553 EXPECT_EQ(StringSet(good0), registry()->enabled_extensions().GetIDs()); |
| 3554 EXPECT_EQ(StringSet(good1, good2), | 3554 EXPECT_EQ(StringSet(good1, good2), |
| 3555 registry()->blacklisted_extensions().GetIDs()); | 3555 registry()->blacklisted_extensions().GetIDs()); |
| 3556 } | 3556 } |
| 3557 | |
| 3558 #endif // defined(ENABLE_BLACKLIST_TESTS) | 3557 #endif // defined(ENABLE_BLACKLIST_TESTS) |
| 3559 | 3558 |
| 3560 // Will not install extension blacklisted by policy. | 3559 // Will not install extension blacklisted by policy. |
| 3561 TEST_F(ExtensionServiceTest, BlacklistedByPolicyWillNotInstall) { | 3560 TEST_F(ExtensionServiceTest, BlacklistedByPolicyWillNotInstall) { |
| 3562 InitializeEmptyExtensionService(); | 3561 InitializeEmptyExtensionService(); |
| 3563 | 3562 |
| 3564 // Blacklist everything. | 3563 // Blacklist everything. |
| 3565 { | 3564 { |
| 3566 ListPrefUpdate update(profile()->GetPrefs(), | 3565 ListPrefUpdate update(profile()->GetPrefs(), |
| 3567 extensions::pref_names::kInstallDenyList); | 3566 extensions::pref_names::kInstallDenyList); |
| (...skipping 3471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7039 | 7038 |
| 7040 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED, | 7039 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED, |
| 7041 content::Source<Profile>(profile()), | 7040 content::Source<Profile>(profile()), |
| 7042 content::NotificationService::NoDetails()); | 7041 content::NotificationService::NoDetails()); |
| 7043 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_); | 7042 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_); |
| 7044 EXPECT_EQ(0u, registry()->enabled_extensions().size()); | 7043 EXPECT_EQ(0u, registry()->enabled_extensions().size()); |
| 7045 EXPECT_EQ(0u, registry()->disabled_extensions().size()); | 7044 EXPECT_EQ(0u, registry()->disabled_extensions().size()); |
| 7046 EXPECT_EQ(0u, registry()->terminated_extensions().size()); | 7045 EXPECT_EQ(0u, registry()->terminated_extensions().size()); |
| 7047 EXPECT_EQ(0u, registry()->blacklisted_extensions().size()); | 7046 EXPECT_EQ(0u, registry()->blacklisted_extensions().size()); |
| 7048 } | 7047 } |
| OLD | NEW |