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

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

Issue 20142007: Catch the sign zip error earlier to prevent invalid private key crash Chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test case for packing extension with invalid private key. Created 7 years, 5 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_creator.cc ('k') | chrome/test/data/extensions/invalid.pem » ('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 e8f452b98cd7b8620428c98f007c2e24424ace7f..f7de3a706b5c851589097b57a00eb0cbf46613a0 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -2202,6 +2202,12 @@ TEST_F(ExtensionServiceTest, PackExtension) {
creator.reset(new ExtensionCreator());
ASSERT_FALSE(creator->Run(temp_dir2.path(), crx_path, privkey_path,
base::FilePath(), ExtensionCreator::kOverwriteCRX));
+
+ // Try packing with an invalid private key. Should fail.
+ base::FilePath invalid_private_key = data_dir_.AppendASCII("invalid.pem");
+ creator.reset(new ExtensionCreator());
+ ASSERT_FALSE(creator->Run(input_directory, crx_path, invalid_private_key,
+ base::FilePath(), ExtensionCreator::kOverwriteCRX));
}
// Test Packaging and installing an extension whose name contains punctuation.
« no previous file with comments | « chrome/browser/extensions/extension_creator.cc ('k') | chrome/test/data/extensions/invalid.pem » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698