diff options
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r-- | chrome/browser/extensions/extension_file_util.cc | 4 | ||||
-rw-r--r-- | chrome/browser/extensions/extensions_service_unittest.cc | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/chrome/browser/extensions/extension_file_util.cc b/chrome/browser/extensions/extension_file_util.cc index 1692c67..ac34470 100644 --- a/chrome/browser/extensions/extension_file_util.cc +++ b/chrome/browser/extensions/extension_file_util.cc @@ -366,8 +366,8 @@ bool CheckForIllegalFilenames(const FilePath& extension_path, if (reserved_underscore_names.find(filename) == reserved_underscore_names.end()) { *error = StringPrintf( - "Cannot load extension with file or directory name %s." - "Filenames starting with \"_\" are reserved for use by the system", + "Cannot load extension with file or directory name %s. " + "Filenames starting with \"_\" are reserved for use by the system.", filename.c_str()); return false; } diff --git a/chrome/browser/extensions/extensions_service_unittest.cc b/chrome/browser/extensions/extensions_service_unittest.cc index 28969d2..d380c90 100644 --- a/chrome/browser/extensions/extensions_service_unittest.cc +++ b/chrome/browser/extensions/extensions_service_unittest.cc @@ -715,6 +715,14 @@ TEST_F(ExtensionsServiceTest, InstallExtension) { InstallExtension(path, false); ValidatePrefKeyCount(pref_count); + // Extensions cannot have folders or files that have underscores except ofr in + // certain whitelisted cases (eg _locales). This is an example of a broader + // class of validation that we do to the directory structure of the extension. + // We did not used to handle this correctly for installation. + path = extensions_path.AppendASCII("bad_underscore.crx"); + InstallExtension(path, false); + ValidatePrefKeyCount(pref_count); + // TODO(erikkay): add more tests for many of the failure cases. // TODO(erikkay): add tests for upgrade cases. } |