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

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

Issue 12211029: Sanity tweaks to the extension blacklist: check all extensions at once on (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more test fixes Created 7 years, 10 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 3041 matching lines...) Expand 10 before | Expand all | Expand 10 after
3052 "v1"); 3052 "v1");
3053 3053
3054 // Make sure pref is updated 3054 // Make sure pref is updated
3055 loop_.RunUntilIdle(); 3055 loop_.RunUntilIdle();
3056 3056
3057 // Now, the good_crx is blacklisted. 3057 // Now, the good_crx is blacklisted.
3058 ValidateBooleanPref(good_crx, "blacklist", true); 3058 ValidateBooleanPref(good_crx, "blacklist", true);
3059 3059
3060 // We can not install good_crx. 3060 // We can not install good_crx.
3061 base::FilePath path = data_dir_.AppendASCII("good.crx"); 3061 base::FilePath path = data_dir_.AppendASCII("good.crx");
3062 InstallCRX(path, INSTALL_WITHOUT_LOAD); 3062 InstallCRX(path, INSTALL_FAILED);
3063 EXPECT_EQ(0u, service_->extensions()->size()); 3063 EXPECT_EQ(0u, service_->extensions()->size());
3064 ValidateBooleanPref(good_crx, "blacklist", true); 3064 ValidateBooleanPref(good_crx, "blacklist", true);
3065 } 3065 }
3066 3066
3067 // Unload blacklisted extension on policy change. 3067 // Unload blacklisted extension on policy change.
3068 TEST_F(ExtensionServiceTest, UnloadBlacklistedExtensionPolicy) { 3068 TEST_F(ExtensionServiceTest, UnloadBlacklistedExtensionPolicy) {
3069 InitializeEmptyExtensionService(); 3069 InitializeEmptyExtensionService();
3070 base::FilePath path = data_dir_.AppendASCII("good.crx"); 3070 base::FilePath path = data_dir_.AppendASCII("good.crx");
3071 3071
3072 const Extension* good = InstallCRX(path, INSTALL_NEW); 3072 const Extension* good = InstallCRX(path, INSTALL_NEW);
(...skipping 2783 matching lines...) Expand 10 before | Expand all | Expand 10 after
5856 EXPECT_FALSE(extensions::HasExternalInstallError(service_)); 5856 EXPECT_FALSE(extensions::HasExternalInstallError(service_));
5857 EXPECT_FALSE(service_->IsExtensionEnabled(good_crx)); 5857 EXPECT_FALSE(service_->IsExtensionEnabled(good_crx));
5858 EXPECT_TRUE(service_->IsExtensionEnabled(page_action)); 5858 EXPECT_TRUE(service_->IsExtensionEnabled(page_action));
5859 5859
5860 ExtensionPrefs* prefs = service_->extension_prefs(); 5860 ExtensionPrefs* prefs = service_->extension_prefs();
5861 EXPECT_NE(0, prefs->GetDisableReasons(good_crx) & 5861 EXPECT_NE(0, prefs->GetDisableReasons(good_crx) &
5862 Extension::DISABLE_SIDELOAD_WIPEOUT); 5862 Extension::DISABLE_SIDELOAD_WIPEOUT);
5863 EXPECT_EQ(0, prefs->GetDisableReasons(page_action) & 5863 EXPECT_EQ(0, prefs->GetDisableReasons(page_action) &
5864 Extension::DISABLE_SIDELOAD_WIPEOUT); 5864 Extension::DISABLE_SIDELOAD_WIPEOUT);
5865 } 5865 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/updater/extension_updater_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698