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

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: improve comments 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
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 6120c73791992144815a35bad9fb8c4a624a29d5..b35adc5530a721f2b1b61881e55939dc9ab841b6 100644
--- a/chrome/browser/extensions/extension_management_browsertest.cc
+++ b/chrome/browser/extensions/extension_management_browsertest.cc
@@ -292,25 +292,31 @@ 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
+ // bacuse of the killbit.
Erik does not do reviews 2010/12/03 17:15:16 typo: because
gfeher 2010/12/03 21:10:09 Done.
+ service->AddPendingExtensionFromExternalUpdateUrl(
+ kExtensionId, GURL("http://localhost/autoupdate/manifest"),
+ Extension::EXTERNAL_PREF_DOWNLOAD);
+
+ EXPECT_EQ(0u, service->pending_extensions_.size())
+ << "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') | chrome/browser/extensions/extension_prefs.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698