diff options
author | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-16 20:11:07 +0000 |
---|---|---|
committer | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-16 20:11:07 +0000 |
commit | 578d748527882756aaf1c04ac76175ede8baed50 (patch) | |
tree | 6b7496abf60e88ae48a9d9c3c4191fb5f9293b06 /webkit/appcache | |
parent | 3b2638125f5702251315b70840301995de7dcd93 (diff) | |
download | chromium_src-578d748527882756aaf1c04ac76175ede8baed50.zip chromium_src-578d748527882756aaf1c04ac76175ede8baed50.tar.gz chromium_src-578d748527882756aaf1c04ac76175ede8baed50.tar.bz2 |
Fix a simple manifest parsing bug.
TEST=manifest_parser_unittest.cc
BUG=none
Review URL: http://codereview.chromium.org/400003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32079 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache')
-rw-r--r-- | webkit/appcache/manifest_parser.cc | 2 | ||||
-rw-r--r-- | webkit/appcache/manifest_parser_unittest.cc | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/webkit/appcache/manifest_parser.cc b/webkit/appcache/manifest_parser.cc index 652582a..0f794f6 100644 --- a/webkit/appcache/manifest_parser.cc +++ b/webkit/appcache/manifest_parser.cc @@ -135,7 +135,7 @@ bool ParseManifest(const GURL& manifest_url, const char* data, int length, const wchar_t *line_end = line_p + line.length(); // Look for whitespace separating the URL from subsequent ignored tokens. - while (line_p < line_end && *line_p != '\t' && *p != ' ') + while (line_p < line_end && *line_p != '\t' && *line_p != ' ') ++line_p; string16 url16; diff --git a/webkit/appcache/manifest_parser_unittest.cc b/webkit/appcache/manifest_parser_unittest.cc index 9fb42e0..e3e0ead 100644 --- a/webkit/appcache/manifest_parser_unittest.cc +++ b/webkit/appcache/manifest_parser_unittest.cc @@ -301,5 +301,17 @@ TEST(ManifestParserTest, UnusualUtf8) { EXPECT_TRUE(urls.find("http://bad.com/nonbmp%F1%84%AB%BC") != urls.end()); } +TEST(ManifestParserTest, IgnoreAfterSpace) { + Manifest manifest; + const GURL kUrl("http://smorg.borg"); + const std::string kData( + "CACHE MANIFEST\r" + "resource.txt this stuff after the white space should be ignored\r"); + EXPECT_TRUE(ParseManifest(kUrl, kData.c_str(), kData.length(), manifest)); + + base::hash_set<std::string> urls = manifest.explicit_urls; + EXPECT_TRUE(urls.find("http://smorg.borg/resource.txt") != urls.end()); +} + } // namespace appcache |