Index: url/url_util_unittest.cc |
diff --git a/url/url_util_unittest.cc b/url/url_util_unittest.cc |
index 9c3606cd0e6412b49d39529593b910781ce7b300..d6746cc04ab6e7f3a14dd0092fb517ecb865e032 100644 |
--- a/url/url_util_unittest.cc |
+++ b/url/url_util_unittest.cc |
@@ -374,23 +374,32 @@ TEST(URLUtilTest, TestNoRefComponent) { |
EXPECT_FALSE(resolved_parsed.ref.is_valid()); |
} |
-TEST(URLUtilTest, RelativeWhitespaceRemoved) { |
+TEST(URLUtilTest, PotentiallyDanglingMarkup) { |
struct ResolveRelativeCase { |
const char* base; |
const char* rel; |
- bool whitespace_removed; |
+ bool potentially_dangling_markup; |
const char* out; |
} cases[] = { |
- {"https://example.com/", "/path", false, "https://example.com/path"}, |
- {"https://example.com/", "\n/path", true, "https://example.com/path"}, |
- {"https://example.com/", "\r/path", true, "https://example.com/path"}, |
- {"https://example.com/", "\t/path", true, "https://example.com/path"}, |
- {"https://example.com/", "/pa\nth", true, "https://example.com/path"}, |
- {"https://example.com/", "/pa\rth", true, "https://example.com/path"}, |
- {"https://example.com/", "/pa\tth", true, "https://example.com/path"}, |
- {"https://example.com/", "/path\n", true, "https://example.com/path"}, |
- {"https://example.com/", "/path\r", true, "https://example.com/path"}, |
- {"https://example.com/", "/path\r", true, "https://example.com/path"}, |
+ {"https://example.com/", "/path<", false, "https://example.com/path%3C"}, |
+ {"https://example.com/", "\n/path<", true, "https://example.com/path%3C"}, |
+ {"https://example.com/", "\r/path<", true, "https://example.com/path%3C"}, |
+ {"https://example.com/", "\t/path<", true, "https://example.com/path%3C"}, |
+ {"https://example.com/", "/pa\nth<", true, "https://example.com/path%3C"}, |
+ {"https://example.com/", "/pa\rth<", true, "https://example.com/path%3C"}, |
+ {"https://example.com/", "/pa\tth<", true, "https://example.com/path%3C"}, |
+ {"https://example.com/", "/path\n<", true, "https://example.com/path%3C"}, |
+ {"https://example.com/", "/path\r<", true, "https://example.com/path%3C"}, |
+ {"https://example.com/", "/path\r<", true, "https://example.com/path%3C"}, |
+ {"https://example.com/", "\n/<path", true, "https://example.com/%3Cpath"}, |
+ {"https://example.com/", "\r/<path", true, "https://example.com/%3Cpath"}, |
+ {"https://example.com/", "\t/<path", true, "https://example.com/%3Cpath"}, |
+ {"https://example.com/", "/<pa\nth", true, "https://example.com/%3Cpath"}, |
+ {"https://example.com/", "/<pa\rth", true, "https://example.com/%3Cpath"}, |
+ {"https://example.com/", "/<pa\tth", true, "https://example.com/%3Cpath"}, |
+ {"https://example.com/", "/<path\n", true, "https://example.com/%3Cpath"}, |
+ {"https://example.com/", "/<path\r", true, "https://example.com/%3Cpath"}, |
+ {"https://example.com/", "/<path\r", true, "https://example.com/%3Cpath"}, |
}; |
for (const auto& test : cases) { |
@@ -407,7 +416,8 @@ TEST(URLUtilTest, RelativeWhitespaceRemoved) { |
ASSERT_TRUE(valid); |
output.Complete(); |
- EXPECT_EQ(test.whitespace_removed, resolved_parsed.whitespace_removed); |
+ EXPECT_EQ(test.potentially_dangling_markup, |
+ resolved_parsed.potentially_dangling_markup); |
EXPECT_EQ(test.out, resolved); |
} |
} |