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

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

Issue 1081403002: Refactor safe-browsing build-config definitions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again to fix collision Created 5 years, 8 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
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 #include "chrome/browser/supervised_user/supervised_user_service.h" 139 #include "chrome/browser/supervised_user/supervised_user_service.h"
140 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" 140 #include "chrome/browser/supervised_user/supervised_user_service_factory.h"
141 #endif 141 #endif
142 142
143 #if defined(OS_CHROMEOS) 143 #if defined(OS_CHROMEOS)
144 #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h" 144 #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h"
145 #include "chrome/browser/chromeos/settings/cros_settings.h" 145 #include "chrome/browser/chromeos/settings/cros_settings.h"
146 #include "chrome/browser/chromeos/settings/device_settings_service.h" 146 #include "chrome/browser/chromeos/settings/device_settings_service.h"
147 #endif 147 #endif
148 148
149 // The blacklist tests rely on safe browsing. 149 // The blacklist tests rely on the safe-browsing database.
150 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) 150 #if defined(SAFE_BROWSING_DB_LOCAL)
151 #define ENABLE_BLACKLIST_TESTS 151 #define ENABLE_BLACKLIST_TESTS
152 #endif 152 #endif
153 153
154 using base::DictionaryValue; 154 using base::DictionaryValue;
155 using base::ListValue; 155 using base::ListValue;
156 using base::Value; 156 using base::Value;
157 using content::BrowserContext; 157 using content::BrowserContext;
158 using content::BrowserThread; 158 using content::BrowserThread;
159 using content::DOMStorageContext; 159 using content::DOMStorageContext;
160 using content::IndexedDBContext; 160 using content::IndexedDBContext;
(...skipping 3463 matching lines...) Expand 10 before | Expand all | Expand 10 after
3624 registry()->blacklisted_extensions().GetIDs()); 3624 registry()->blacklisted_extensions().GetIDs());
3625 3625
3626 service()->ReloadExtension(good1); 3626 service()->ReloadExtension(good1);
3627 service()->ReloadExtension(good2); 3627 service()->ReloadExtension(good2);
3628 base::RunLoop().RunUntilIdle(); 3628 base::RunLoop().RunUntilIdle();
3629 3629
3630 EXPECT_EQ(StringSet(good0), registry()->enabled_extensions().GetIDs()); 3630 EXPECT_EQ(StringSet(good0), registry()->enabled_extensions().GetIDs());
3631 EXPECT_EQ(StringSet(good1, good2), 3631 EXPECT_EQ(StringSet(good1, good2),
3632 registry()->blacklisted_extensions().GetIDs()); 3632 registry()->blacklisted_extensions().GetIDs());
3633 } 3633 }
3634
3635 #endif // defined(ENABLE_BLACKLIST_TESTS) 3634 #endif // defined(ENABLE_BLACKLIST_TESTS)
3636 3635
3637 // Tests blocking then unblocking enabled extensions after the service has been 3636 // Tests blocking then unblocking enabled extensions after the service has been
3638 // initialized. 3637 // initialized.
3639 TEST_F(ExtensionServiceTest, BlockAndUnblockEnabledExtension) { 3638 TEST_F(ExtensionServiceTest, BlockAndUnblockEnabledExtension) {
3640 InitializeGoodInstalledExtensionService(); 3639 InitializeGoodInstalledExtensionService();
3641 service()->Init(); 3640 service()->Init();
3642 3641
3643 AssertExtensionBlocksAndUnblocks(true, good0); 3642 AssertExtensionBlocksAndUnblocks(true, good0);
3644 } 3643 }
(...skipping 4123 matching lines...) Expand 10 before | Expand all | Expand 10 after
7768 7767
7769 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED, 7768 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED,
7770 content::Source<Profile>(profile()), 7769 content::Source<Profile>(profile()),
7771 content::NotificationService::NoDetails()); 7770 content::NotificationService::NoDetails());
7772 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_); 7771 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_);
7773 EXPECT_EQ(0u, registry()->enabled_extensions().size()); 7772 EXPECT_EQ(0u, registry()->enabled_extensions().size());
7774 EXPECT_EQ(0u, registry()->disabled_extensions().size()); 7773 EXPECT_EQ(0u, registry()->disabled_extensions().size());
7775 EXPECT_EQ(0u, registry()->terminated_extensions().size()); 7774 EXPECT_EQ(0u, registry()->terminated_extensions().size());
7776 EXPECT_EQ(0u, registry()->blacklisted_extensions().size()); 7775 EXPECT_EQ(0u, registry()->blacklisted_extensions().size());
7777 } 7776 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/blacklist.cc ('k') | chrome/browser/profiles/off_the_record_profile_io_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698