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

Unified Diff: chrome/browser/extensions/extension_management_browsertest.cc

Issue 5535002: Decouple killbit testing from external extension providers (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: update Created 10 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_prefs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_management_browsertest.cc
diff --git a/chrome/browser/extensions/extension_management_browsertest.cc b/chrome/browser/extensions/extension_management_browsertest.cc
index 0b8a4699f2e8febcfd80381d109b8ec429c1f080..1efe2736325ef452547ca49a4b9e25c0530f1190 100644
--- a/chrome/browser/extensions/extension_management_browsertest.cc
+++ b/chrome/browser/extensions/extension_management_browsertest.cc
@@ -293,25 +293,33 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementTest, ExternalUrlUpdate) {
UninstallExtension(kExtensionId);
- std::set<std::string> killed_ids;
- service->extension_prefs()->GetKilledExtensionIds(&killed_ids);
- EXPECT_TRUE(killed_ids.end() != killed_ids.find(kExtensionId))
+ ExtensionPrefs* extension_prefs = service->extension_prefs();
+ EXPECT_TRUE(extension_prefs->IsExtensionKilled(kExtensionId))
<< "Uninstalling should set kill bit on externaly installed extension.";
+ // Try to install the extension again from an external source. It should fail
+ // because of the killbit.
+ service->AddPendingExtensionFromExternalUpdateUrl(
+ kExtensionId, GURL("http://localhost/autoupdate/manifest"),
+ Extension::EXTERNAL_PREF_DOWNLOAD);
+ const PendingExtensionMap& pending_extensions =
+ service->pending_extensions();
+ EXPECT_TRUE(
+ pending_extensions.find(kExtensionId) == pending_extensions.end())
+ << "External reinstall of a killed extension shouldn't work.";
+ EXPECT_TRUE(extension_prefs->IsExtensionKilled(kExtensionId))
+ << "External reinstall of a killed extension should leave it killed.";
+
// Installing from non-external source.
ASSERT_TRUE(InstallExtension(basedir.AppendASCII("v2.crx"), 1));
- killed_ids.clear();
- service->extension_prefs()->GetKilledExtensionIds(&killed_ids);
- EXPECT_TRUE(killed_ids.end() == killed_ids.find(kExtensionId))
+ EXPECT_FALSE(extension_prefs->IsExtensionKilled(kExtensionId))
<< "Reinstalling should clear the kill bit.";
// Uninstalling from a non-external source should not set the kill bit.
UninstallExtension(kExtensionId);
- killed_ids.clear();
- service->extension_prefs()->GetKilledExtensionIds(&killed_ids);
- EXPECT_TRUE(killed_ids.end() == killed_ids.find(kExtensionId))
+ EXPECT_FALSE(extension_prefs->IsExtensionKilled(kExtensionId))
<< "Uninstalling non-external extension should not set kill bit.";
}
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698