| Index: src/url_util_unittest.cc
|
| ===================================================================
|
| --- src/url_util_unittest.cc (revision 127)
|
| +++ src/url_util_unittest.cc (working copy)
|
| @@ -64,6 +64,13 @@
|
| // But when there is no scheme, it should fail.
|
| EXPECT_FALSE(url_util::FindAndCompareScheme("", 0, "", &found_scheme));
|
| EXPECT_TRUE(found_scheme == url_parse::Component());
|
| +
|
| + // When there is a ctrl char in scheme, it should canonicalize the url before
|
| + // comparison.
|
| + const char ctrlStr[] = " \r\n\tjav\ra\nscri\tpt:alert(1)";
|
| + EXPECT_TRUE(url_util::FindAndCompareScheme(
|
| + ctrlStr, static_cast<int>(strlen(ctrlStr)), "javascript", &found_scheme));
|
| + EXPECT_TRUE(found_scheme == url_parse::Component(1, 10));
|
| }
|
|
|
| TEST(URLUtilTest, ReplaceComponents) {
|
|
|