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

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

Issue 2336403002: Fix extension content verification out-of-band hash fetching (Closed)
Patch Set: review feedback Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service_unittest.cc
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index f1cb439b049ad8e91bb62a99fb9843b1be840596..43baccea70957ca4cbdf16287ef4bc42c4812bf5 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -6924,3 +6924,25 @@ TEST_F(ExtensionServiceTest, DestroyingProfileClearsExtensions) {
EXPECT_EQ(0u, registry()->terminated_extensions().size());
EXPECT_EQ(0u, registry()->blacklisted_extensions().size());
}
+
+// Test that updating a corrupt extension removes the DISABLE_CORRUPTED disable
+// reason.
+TEST_F(ExtensionServiceTest, CorruptExtensionUpdate) {
+ InitializeEmptyExtensionService();
+
+ base::FilePath v1_path = data_dir().AppendASCII("good.crx");
+ const Extension* v1 = InstallCRX(v1_path, INSTALL_NEW);
+ std::string id = v1->id();
+
+ service()->DisableExtension(id, Extension::DISABLE_CORRUPTED);
+
+ ExtensionPrefs* prefs = ExtensionPrefs::Get(profile());
+ EXPECT_TRUE(registry()->disabled_extensions().Contains(id));
+ EXPECT_TRUE(prefs->HasDisableReason(id, Extension::DISABLE_CORRUPTED));
+
+ base::FilePath v2_path = data_dir().AppendASCII("good2.crx");
+ UpdateExtension(id, v2_path, ENABLED);
+
+ EXPECT_FALSE(registry()->disabled_extensions().Contains(id));
+ EXPECT_FALSE(prefs->HasDisableReason(id, Extension::DISABLE_CORRUPTED));
+}
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698