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

Unified Diff: third_party/WebKit/Source/platform/weborigin/KURLTest.cpp

Issue 2643613002: Reduce the perf overhead of our dangling markup experiments. (Closed)
Patch Set: unittest Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/platform/weborigin/KURL.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/weborigin/KURLTest.cpp
diff --git a/third_party/WebKit/Source/platform/weborigin/KURLTest.cpp b/third_party/WebKit/Source/platform/weborigin/KURLTest.cpp
index 8746f2af4f989b0b28a9701d5cde37140a3782f3..896f65e332c3ef4787188c6b943f36739a1c3a08 100644
--- a/third_party/WebKit/Source/platform/weborigin/KURLTest.cpp
+++ b/third_party/WebKit/Source/platform/weborigin/KURLTest.cpp
@@ -302,6 +302,37 @@ TEST(KURLTest, EncodeWithURLEscapeSequences) {
EXPECT_EQ(encodeWithURLEscapeSequences(precomposed), "%C4%99");
}
+TEST(KURLTest, RemoveWhitespace) {
+ struct {
+ const char* input;
+ const char* expected;
+ } cases[] = {
+ {"ht\ntps://example.com/yay?boo#foo", "https://example.com/yay?boo#foo"},
+ {"ht\ttps://example.com/yay?boo#foo", "https://example.com/yay?boo#foo"},
+ {"ht\rtps://example.com/yay?boo#foo", "https://example.com/yay?boo#foo"},
+ {"https://exa\nmple.com/yay?boo#foo", "https://example.com/yay?boo#foo"},
+ {"https://exa\tmple.com/yay?boo#foo", "https://example.com/yay?boo#foo"},
+ {"https://exa\rmple.com/yay?boo#foo", "https://example.com/yay?boo#foo"},
+ {"https://example.com/y\nay?boo#foo", "https://example.com/yay?boo#foo"},
+ {"https://example.com/y\tay?boo#foo", "https://example.com/yay?boo#foo"},
+ {"https://example.com/y\ray?boo#foo", "https://example.com/yay?boo#foo"},
+ {"https://example.com/yay?b\noo#foo", "https://example.com/yay?boo#foo"},
+ {"https://example.com/yay?b\too#foo", "https://example.com/yay?boo#foo"},
+ {"https://example.com/yay?b\roo#foo", "https://example.com/yay?boo#foo"},
+ {"https://example.com/yay?boo#f\noo", "https://example.com/yay?boo#foo"},
+ {"https://example.com/yay?boo#f\too", "https://example.com/yay?boo#foo"},
+ {"https://example.com/yay?boo#f\roo", "https://example.com/yay?boo#foo"},
+ };
+
+ for (const auto& test : cases) {
+ const KURL input(ParsedURLString, test.input);
+ const KURL expected(ParsedURLString, test.expected);
+ EXPECT_EQ(input, expected);
+ EXPECT_TRUE(input.whitespaceRemoved());
+ EXPECT_FALSE(expected.whitespaceRemoved());
+ }
+}
+
TEST(KURLTest, ResolveEmpty) {
KURL emptyBase;
« no previous file with comments | « third_party/WebKit/Source/platform/weborigin/KURL.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698