Index: url/url_canon_unittest.cc |
diff --git a/url/url_canon_unittest.cc b/url/url_canon_unittest.cc |
index 0ccd6c93009efa94faf0be1a3a95a2b169e96158..4dd58ec06d581cbbdadf064a0bcd09ec04740d2e 100644 |
--- a/url/url_canon_unittest.cc |
+++ b/url/url_canon_unittest.cc |
@@ -1000,6 +1000,7 @@ TEST(URLCanonTest, Port) { |
TEST(URLCanonTest, Path) { |
DualComponentCase path_cases[] = { |
+#if 0 |
brettw
2015/09/21 22:28:34
Left by mistake?
Peter Kasting
2015/09/21 23:15:31
Yeah, oops :(
|
// ----- path collapsing tests ----- |
{"/././foo", L"/././foo", "/foo", Component(0, 4), true}, |
{"/./.foo", L"/./.foo", "/.foo", Component(0, 5), true}, |
@@ -1060,6 +1061,24 @@ TEST(URLCanonTest, Path) { |
{"/%7Ffp3%3Eju%3Dduvgw%3Dd", L"/%7Ffp3%3Eju%3Dduvgw%3Dd", "/%7Ffp3%3Eju%3Dduvgw%3Dd", Component(0, 24), true}, |
// @ should be passed through unchanged (escaped or unescaped). |
{"/@asdf%40", L"/@asdf%40", "/@asdf%40", Component(0, 9), true}, |
+ // Nested escape sequences should result in escaping the leading '%' if |
+ // unescaping would result in a new escape sequence. |
+ {"/%0%30", L"/%0%30", "/%2500", Component(0, 6), true}, |
brettw
2015/09/21 22:28:34
Can you make these cases use different characters
Peter Kasting
2015/09/21 23:15:30
Done.
|
+ {"/%%300", L"/%%300", "/%2500", Component(0, 6), true}, |
+ {"/%%30%30", L"/%%30%30", "/%2500", Component(0, 6), true}, |
+ // Make sure truncated "nested" escapes don't result in reading off the |
+ // string end. |
+ {"/%%30", L"/%%30", "/%0", Component(0, 3), true}, |
+ // Don't unescape the leading '%' if unescaping doesn't result in a valid |
+ // new escape sequence. |
+ {"/%%470", L"/%%470", "/%G0", Component(0, 4), true}, |
+ {"/%%2D%41", L"/%%2D%41", "/%-A", Component(0, 4), true}, |
+#endif |
+ // Don't erroneously downcast a UTF-16 charater in a way that makes it |
+ // look like part of an escape sequence. |
+ {NULL, L"/%%30\x0130", "/%0%C4%B0", Component(0, 9), true}, |
+#if 0 |
+ |
// ----- encoding tests ----- |
// Basic conversions |
@@ -1068,6 +1087,7 @@ TEST(URLCanonTest, Path) { |
// UTF-16 input, so this doesn't happen on 8-bit. |
{"/\xef\xb7\x90zyx", NULL, "/%EF%B7%90zyx", Component(0, 13), true}, |
{NULL, L"/\xfdd0zyx", "/%EF%BF%BDzyx", Component(0, 13), false}, |
+#endif |
}; |
for (size_t i = 0; i < arraysize(path_cases); i++) { |