summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extensions_service_unittest.cc
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-25 22:02:49 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-25 22:02:49 +0000
commit99872e3d462aa75e4a73fd943567c38225a45c50 (patch)
tree42f63ecb7a0f36886441790c3f361be5fc093b6d /chrome/browser/extensions/extensions_service_unittest.cc
parentd0437d9953d748fd01b3cc551fc363f793666838 (diff)
downloadchromium_src-99872e3d462aa75e4a73fd943567c38225a45c50.zip
chromium_src-99872e3d462aa75e4a73fd943567c38225a45c50.tar.gz
chromium_src-99872e3d462aa75e4a73fd943567c38225a45c50.tar.bz2
Actually run directory validation code on install.
BUG=23084 TEST=Install extensions attached to referenced bug. You should get an error dialog, not a crash. Review URL: http://codereview.chromium.org/244012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27261 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extensions_service_unittest.cc')
-rw-r--r--chrome/browser/extensions/extensions_service_unittest.cc8
1 files changed, 8 insertions, 0 deletions
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.
}