Index: url/url_util_unittest.cc |
diff --git a/url/url_util_unittest.cc b/url/url_util_unittest.cc |
index aba44e469157733236927072cdf2888443e5e8e7..17c1b0f6b254a1f8a55f6f29bb30b4cdbec725d4 100644 |
--- a/url/url_util_unittest.cc |
+++ b/url/url_util_unittest.cc |
@@ -295,4 +295,25 @@ TEST(URLUtilTest, TestResolveRelativeWithNonStandardBase) { |
} |
} |
+TEST(URLUtilTest, TestNoRefComponent) { |
+ // The hash-mark must be ignored when mailto: scheme is |
+ // parsed, even if the url has a base and relative part. |
+ const char* base = "mailto://to/"; |
+ const char* rel = "any#body"; |
+ |
+ Parsed base_parsed; |
+ ParsePathURL(base, strlen(base), false, &base_parsed); |
+ |
+ std::string resolved; |
+ StdStringCanonOutput output(&resolved); |
+ Parsed resolved_parsed; |
+ |
+ bool valid = ResolveRelative(base, strlen(base), |
+ base_parsed, rel, |
+ strlen(rel), NULL, &output, |
+ &resolved_parsed); |
+ EXPECT_TRUE(valid); |
+ EXPECT_FALSE(resolved_parsed.ref.is_valid()); |
+} |
+ |
} // namespace url |