Chromium Code Reviews| Index: url/gurl_unittest.cc |
| diff --git a/url/gurl_unittest.cc b/url/gurl_unittest.cc |
| index abc3f10634766d9b0bdfc2810aa1a606d41be4c1..79a2350fd18f0b3a2457964f29c44dd7b5257e11 100644 |
| --- a/url/gurl_unittest.cc |
| +++ b/url/gurl_unittest.cc |
| @@ -401,13 +401,23 @@ TEST(GURLTest, Replacements) { |
| const char* ref; |
| const char* expected; |
| } replace_cases[] = { |
| - {"http://www.google.com/foo/bar.html?foo#bar", NULL, NULL, NULL, NULL, NULL, "/", "", "", "http://www.google.com/"}, |
| - {"http://www.google.com/foo/bar.html?foo#bar", "javascript", "", "", "", "", "window.open('foo');", "", "", "javascript:window.open('foo');"}, |
| - {"file:///C:/foo/bar.txt", "http", NULL, NULL, "www.google.com", "99", "/foo", "search", "ref", "http://www.google.com:99/foo?search#ref"}, |
| + {"http://www.google.com/foo/bar.html?foo#bar", NULL, NULL, NULL, NULL, |
| + NULL, "/", "", "", "http://www.google.com/"}, |
| + {"http://www.google.com/foo/bar.html?foo#bar", "javascript", "", "", "", |
| + "", "window.open('foo');", "", "", "javascript:window.open('foo');"}, |
| + {"file:///C:/foo/bar.txt", "http", NULL, NULL, "www.google.com", "99", |
| + "/foo", "search", "ref", "http://www.google.com:99/foo?search#ref"}, |
| #ifdef WIN32 |
| - {"http://www.google.com/foo/bar.html?foo#bar", "file", "", "", "", "", "c:\\", "", "", "file:///C:/"}, |
| + {"http://www.google.com/foo/bar.html?foo#bar", "file", "", "", "", "", |
| + "c:\\", "", "", "file:///C:/"}, |
| #endif |
| - {"filesystem:http://www.google.com/foo/bar.html?foo#bar", NULL, NULL, NULL, NULL, NULL, "/", "", "", "filesystem:http://www.google.com/foo/"}, |
| + {"filesystem:http://www.google.com/foo/bar.html?foo#bar", NULL, NULL, |
| + NULL, NULL, NULL, "/", "", "", "filesystem:http://www.google.com/foo/"}, |
| + // Lengthen the URL instead of shortening it, to test creation of |
| + // inner_url. |
| + {"filesystem:http://www.google.com/foo/", NULL, NULL, NULL, NULL, NULL, |
| + "bar.html", "foo", "bar", |
| + "filesystem:http://www.google.com/foo/bar.html?foo#bar"}, |
|
mmenke
2016/06/01 20:39:41
Other than the addition of the last test case, the
|
| }; |
| for (size_t i = 0; i < arraysize(replace_cases); i++) { |
| @@ -425,7 +435,10 @@ TEST(GURLTest, Replacements) { |
| GURL output = url.ReplaceComponents(repl); |
| EXPECT_EQ(replace_cases[i].expected, output.spec()); |
| + |
| EXPECT_EQ(output.SchemeIsFileSystem(), output.inner_url() != NULL); |
| + if (output.SchemeIsFileSystem()) |
| + EXPECT_EQ(replace_cases[i].expected, output.inner_url()->spec()); |
|
mmenke
2016/06/01 20:39:41
I'm not sure if the inner_url's spec is suppose to
|
| } |
| } |