| 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 3395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3542 registry()->blacklisted_extensions().GetIDs()); | 3542 registry()->blacklisted_extensions().GetIDs()); |
| 3543 | 3543 |
| 3544 service()->ReloadExtension(good1); | 3544 service()->ReloadExtension(good1); |
| 3545 service()->ReloadExtension(good2); | 3545 service()->ReloadExtension(good2); |
| 3546 base::RunLoop().RunUntilIdle(); | 3546 base::RunLoop().RunUntilIdle(); |
| 3547 | 3547 |
| 3548 EXPECT_EQ(StringSet(good0), registry()->enabled_extensions().GetIDs()); | 3548 EXPECT_EQ(StringSet(good0), registry()->enabled_extensions().GetIDs()); |
| 3549 EXPECT_EQ(StringSet(good1, good2), | 3549 EXPECT_EQ(StringSet(good1, good2), |
| 3550 registry()->blacklisted_extensions().GetIDs()); | 3550 registry()->blacklisted_extensions().GetIDs()); |
| 3551 } | 3551 } |
| 3552 | |
| 3553 #endif // defined(ENABLE_BLACKLIST_TESTS) | 3552 #endif // defined(ENABLE_BLACKLIST_TESTS) |
| 3554 | 3553 |
| 3555 // Will not install extension blacklisted by policy. | 3554 // Will not install extension blacklisted by policy. |
| 3556 TEST_F(ExtensionServiceTest, BlacklistedByPolicyWillNotInstall) { | 3555 TEST_F(ExtensionServiceTest, BlacklistedByPolicyWillNotInstall) { |
| 3557 InitializeEmptyExtensionService(); | 3556 InitializeEmptyExtensionService(); |
| 3558 | 3557 |
| 3559 // Blacklist everything. | 3558 // Blacklist everything. |
| 3560 { | 3559 { |
| 3561 ListPrefUpdate update(profile()->GetPrefs(), | 3560 ListPrefUpdate update(profile()->GetPrefs(), |
| 3562 extensions::pref_names::kInstallDenyList); | 3561 extensions::pref_names::kInstallDenyList); |
| (...skipping 3459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7022 | 7021 |
| 7023 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED, | 7022 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED, |
| 7024 content::Source<Profile>(profile()), | 7023 content::Source<Profile>(profile()), |
| 7025 content::NotificationService::NoDetails()); | 7024 content::NotificationService::NoDetails()); |
| 7026 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_); | 7025 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_); |
| 7027 EXPECT_EQ(0u, registry()->enabled_extensions().size()); | 7026 EXPECT_EQ(0u, registry()->enabled_extensions().size()); |
| 7028 EXPECT_EQ(0u, registry()->disabled_extensions().size()); | 7027 EXPECT_EQ(0u, registry()->disabled_extensions().size()); |
| 7029 EXPECT_EQ(0u, registry()->terminated_extensions().size()); | 7028 EXPECT_EQ(0u, registry()->terminated_extensions().size()); |
| 7030 EXPECT_EQ(0u, registry()->blacklisted_extensions().size()); | 7029 EXPECT_EQ(0u, registry()->blacklisted_extensions().size()); |
| 7031 } | 7030 } |
| OLD | NEW |