Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: url/gurl_unittest.cc

Issue 2895953002: Update dangling markup mitigations. (Closed)
Patch Set: Test. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: url/gurl_unittest.cc
diff --git a/url/gurl_unittest.cc b/url/gurl_unittest.cc
index d3a59de830b36790db954cd935cfe17179aa492b..a20472d0aa33c284cac351f902f72ff00af34ac4 100644
--- a/url/gurl_unittest.cc
+++ b/url/gurl_unittest.cc
@@ -645,12 +645,26 @@ TEST(GURLTest, Newlines) {
// Constructor.
GURL url_1(" \t ht\ntp://\twww.goo\rgle.com/as\ndf \n ");
EXPECT_EQ("http://www.google.com/asdf", url_1.spec());
- EXPECT_TRUE(url_1.parsed_for_possibly_invalid_spec().whitespace_removed);
+ EXPECT_FALSE(
+ url_1.parsed_for_possibly_invalid_spec().potentially_dangling_markup);
// Relative path resolver.
GURL url_2 = url_1.Resolve(" \n /fo\to\r ");
EXPECT_EQ("http://www.google.com/foo", url_2.spec());
- EXPECT_TRUE(url_2.parsed_for_possibly_invalid_spec().whitespace_removed);
+ EXPECT_FALSE(
+ url_2.parsed_for_possibly_invalid_spec().potentially_dangling_markup);
+
+ // Constructor.
+ GURL url_3(" \t ht\ntp://\twww.goo\rgle.com/as\ndf< \n ");
+ EXPECT_EQ("http://www.google.com/asdf%3C", url_3.spec());
+ EXPECT_TRUE(
+ url_3.parsed_for_possibly_invalid_spec().potentially_dangling_markup);
+
+ // Relative path resolver.
+ GURL url_4 = url_1.Resolve(" \n /fo\to<\r ");
+ EXPECT_EQ("http://www.google.com/foo%3C", url_4.spec());
+ EXPECT_TRUE(
+ url_4.parsed_for_possibly_invalid_spec().potentially_dangling_markup);
// Note that newlines are NOT stripped from ReplaceComponents.
}

Powered by Google App Engine
This is Rietveld 408576698