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

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

Issue 397853002: Refactor safe-browsing build-config definitions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup gn files Created 6 years, 5 months 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
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 <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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 #include "webkit/browser/database/database_tracker.h" 124 #include "webkit/browser/database/database_tracker.h"
125 #include "webkit/browser/quota/quota_manager.h" 125 #include "webkit/browser/quota/quota_manager.h"
126 #include "webkit/common/database/database_identifier.h" 126 #include "webkit/common/database/database_identifier.h"
127 127
128 #if defined(OS_CHROMEOS) 128 #if defined(OS_CHROMEOS)
129 #include "chrome/browser/chromeos/login/users/user_manager.h" 129 #include "chrome/browser/chromeos/login/users/user_manager.h"
130 #include "chrome/browser/chromeos/settings/cros_settings.h" 130 #include "chrome/browser/chromeos/settings/cros_settings.h"
131 #include "chrome/browser/chromeos/settings/device_settings_service.h" 131 #include "chrome/browser/chromeos/settings/device_settings_service.h"
132 #endif 132 #endif
133 133
134 // The blacklist tests rely on safe browsing. 134 // The blacklist tests rely on the safe-browsing database.
135 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) 135 #if defined(SAFE_BROWSING_DATABASE)
136 #define ENABLE_BLACKLIST_TESTS 136 #define ENABLE_BLACKLIST_TESTS
137 #endif 137 #endif
138 138
139 using base::DictionaryValue; 139 using base::DictionaryValue;
140 using base::ListValue; 140 using base::ListValue;
141 using base::Value; 141 using base::Value;
142 using content::BrowserContext; 142 using content::BrowserContext;
143 using content::BrowserThread; 143 using content::BrowserThread;
144 using content::DOMStorageContext; 144 using content::DOMStorageContext;
145 using content::IndexedDBContext; 145 using content::IndexedDBContext;
(...skipping 3384 matching lines...) Expand 10 before | Expand all | Expand 10 after
3530 registry()->blacklisted_extensions().GetIDs()); 3530 registry()->blacklisted_extensions().GetIDs());
3531 3531
3532 service()->ReloadExtension(good1); 3532 service()->ReloadExtension(good1);
3533 service()->ReloadExtension(good2); 3533 service()->ReloadExtension(good2);
3534 base::RunLoop().RunUntilIdle(); 3534 base::RunLoop().RunUntilIdle();
3535 3535
3536 EXPECT_EQ(StringSet(good0), registry()->enabled_extensions().GetIDs()); 3536 EXPECT_EQ(StringSet(good0), registry()->enabled_extensions().GetIDs());
3537 EXPECT_EQ(StringSet(good1, good2), 3537 EXPECT_EQ(StringSet(good1, good2),
3538 registry()->blacklisted_extensions().GetIDs()); 3538 registry()->blacklisted_extensions().GetIDs());
3539 } 3539 }
3540
3541 #endif // defined(ENABLE_BLACKLIST_TESTS) 3540 #endif // defined(ENABLE_BLACKLIST_TESTS)
3542 3541
3543 // Will not install extension blacklisted by policy. 3542 // Will not install extension blacklisted by policy.
3544 TEST_F(ExtensionServiceTest, BlacklistedByPolicyWillNotInstall) { 3543 TEST_F(ExtensionServiceTest, BlacklistedByPolicyWillNotInstall) {
3545 InitializeEmptyExtensionService(); 3544 InitializeEmptyExtensionService();
3546 3545
3547 // Blacklist everything. 3546 // Blacklist everything.
3548 { 3547 {
3549 ListPrefUpdate update(profile()->GetPrefs(), 3548 ListPrefUpdate update(profile()->GetPrefs(),
3550 extensions::pref_names::kInstallDenyList); 3549 extensions::pref_names::kInstallDenyList);
(...skipping 3395 matching lines...) Expand 10 before | Expand all | Expand 10 after
6946 6945
6947 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED, 6946 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED,
6948 content::Source<Profile>(profile()), 6947 content::Source<Profile>(profile()),
6949 content::NotificationService::NoDetails()); 6948 content::NotificationService::NoDetails());
6950 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_); 6949 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_);
6951 EXPECT_EQ(0u, registry()->enabled_extensions().size()); 6950 EXPECT_EQ(0u, registry()->enabled_extensions().size());
6952 EXPECT_EQ(0u, registry()->disabled_extensions().size()); 6951 EXPECT_EQ(0u, registry()->disabled_extensions().size());
6953 EXPECT_EQ(0u, registry()->terminated_extensions().size()); 6952 EXPECT_EQ(0u, registry()->terminated_extensions().size());
6954 EXPECT_EQ(0u, registry()->blacklisted_extensions().size()); 6953 EXPECT_EQ(0u, registry()->blacklisted_extensions().size());
6955 } 6954 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698