summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/extension_unpacker_unittest.cc
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-03 23:32:57 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-03 23:32:57 +0000
commitc5a7248b45656b1ca63f9ce35b60ca337f83d3d1 (patch)
tree0f6f50e96e99046d820d9b49ccea1294244b7c2a /chrome/common/extensions/extension_unpacker_unittest.cc
parentdf2c7403503b45467d3d76ddc2f42296fa53ac50 (diff)
downloadchromium_src-c5a7248b45656b1ca63f9ce35b60ca337f83d3d1.zip
chromium_src-c5a7248b45656b1ca63f9ce35b60ca337f83d3d1.tar.gz
chromium_src-c5a7248b45656b1ca63f9ce35b60ca337f83d3d1.tar.bz2
Fixes to the string MatchPattern functions:
1) Make it explicit that it only supports ASCII (since it iterates character by character). 2) Limit the recursion to 16 levels. We could allow more, but in the case of a ?, it has exponential complexity, so I figured 16 was a good stopping point. It seems rare that someone would have more than 16 '?' and '*'s. BUG=28645 Review URL: http://codereview.chromium.org/460047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33748 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/extension_unpacker_unittest.cc')
-rw-r--r--chrome/common/extensions/extension_unpacker_unittest.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/chrome/common/extensions/extension_unpacker_unittest.cc b/chrome/common/extensions/extension_unpacker_unittest.cc
index 747827d..362db24 100644
--- a/chrome/common/extensions/extension_unpacker_unittest.cc
+++ b/chrome/common/extensions/extension_unpacker_unittest.cc
@@ -71,7 +71,7 @@ TEST_F(ExtensionUnpackerTest, InvalidDefaultLocale) {
TEST_F(ExtensionUnpackerTest, InvalidMessagesFile) {
SetupUnpacker("invalid_messages_file.crx");
EXPECT_FALSE(unpacker_->Run());
- EXPECT_TRUE(MatchPattern(unpacker_->error_message(),
+ EXPECT_TRUE(MatchPatternASCII(unpacker_->error_message(),
std::string("*_locales?en_US?messages.json: Line: 2, column: 3,"
" Dictionary keys must be quoted.")));
}
@@ -92,7 +92,7 @@ TEST_F(ExtensionUnpackerTest, MissingDefaultLocaleHasLocalesFolder) {
TEST_F(ExtensionUnpackerTest, MissingMessagesFile) {
SetupUnpacker("missing_messages_file.crx");
EXPECT_FALSE(unpacker_->Run());
- EXPECT_TRUE(MatchPattern(unpacker_->error_message(),
+ EXPECT_TRUE(MatchPatternASCII(unpacker_->error_message(),
errors::kLocalesMessagesFileMissing +
std::string("*_locales?en_US?messages.json")));
}