diff options
-rw-r--r-- | webkit/fileapi/file_system_util.cc | 8 | ||||
-rw-r--r-- | webkit/fileapi/file_system_util_unittest.cc | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/webkit/fileapi/file_system_util.cc b/webkit/fileapi/file_system_util.cc index 285351a..089e4e2 100644 --- a/webkit/fileapi/file_system_util.cc +++ b/webkit/fileapi/file_system_util.cc @@ -292,7 +292,13 @@ bool CrackIsolatedFileSystemName(const std::string& filesystem_name, // |filesystem_name| is of the form {origin}:isolated_{filesystem_id}. std::string start_token(":"); start_token = start_token.append(kIsolatedName).append("_"); - size_t pos = filesystem_name.find(start_token); + // WebKit uses different case in its constant for isolated file system + // names, so we do a case insensitive compare by converting both strings + // to uppercase. + // TODO(benwells): Remove this when WebKit uses the same constant. + start_token = StringToUpperASCII(start_token); + std::string filesystem_name_upper = StringToUpperASCII(filesystem_name); + size_t pos = filesystem_name_upper.find(start_token); if (pos == std::string::npos) return false; if (pos == 0) diff --git a/webkit/fileapi/file_system_util_unittest.cc b/webkit/fileapi/file_system_util_unittest.cc index 6ac85e4..2abecc0 100644 --- a/webkit/fileapi/file_system_util_unittest.cc +++ b/webkit/fileapi/file_system_util_unittest.cc @@ -167,6 +167,8 @@ TEST_F(FileSystemUtilTest, CrackIsolatedFileSystemName) { std::string fsid; EXPECT_TRUE(CrackIsolatedFileSystemName("foo:Isolated_bar", &fsid)); EXPECT_EQ("bar", fsid); + EXPECT_TRUE(CrackIsolatedFileSystemName("foo:isolated_bar", &fsid)); + EXPECT_EQ("bar", fsid); EXPECT_TRUE(CrackIsolatedFileSystemName("foo:Isolated__bar", &fsid)); EXPECT_EQ("_bar", fsid); EXPECT_TRUE(CrackIsolatedFileSystemName("foo::Isolated_bar", &fsid)); |