| 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;
|
|
|
|
|