Chromium Code Reviews| Index: components/url_formatter/url_formatter_unittest.cc |
| diff --git a/components/url_formatter/url_formatter_unittest.cc b/components/url_formatter/url_formatter_unittest.cc |
| index fc8011853aa6e1cee444d8e2003b0473430ab4c1..fecfd469a8e4dd983e594546de1ffb31083eb274 100644 |
| --- a/components/url_formatter/url_formatter_unittest.cc |
| +++ b/components/url_formatter/url_formatter_unittest.cc |
| @@ -838,6 +838,25 @@ TEST(UrlFormatterTest, FormatUrl) { |
| kFormatUrlOmitHTTP, net::UnescapeRule::NORMAL, L"http://ftp.google.com/", |
| 7}, |
| + // -------- omit https -------- |
|
Peter Kasting
2017/06/28 23:09:59
I kinda feel like this block should go after your
tommycli
2017/06/29 00:19:43
Done.
|
| + {"omit https", "http://www.google.com/", |
|
Peter Kasting
2017/06/28 23:09:59
This URL uses HTTP and not HTTPS, so it doesn't te
tommycli
2017/06/29 00:19:43
Done.
|
| + kFormatUrlOmitHTTP | kFormatUrlExperimentalOmitHTTPS, |
|
Peter Kasting
2017/06/28 23:09:59
Seems like we don't need (or, honestly, want) to p
tommycli
2017/06/29 00:19:43
Done.
Also testing username/password eliding to v
|
| + net::UnescapeRule::NORMAL, L"www.google.com/", 0}, |
| + |
| + {"omit https with user name", "https://user@example.com/foo", |
| + kFormatUrlOmitAll | kFormatUrlExperimentalOmitHTTPS, |
| + net::UnescapeRule::NORMAL, L"example.com/foo", 0}, |
| + |
| + {"omit https with user name and password", |
| + "https://user:password@example.com/foo", |
| + kFormatUrlOmitAll | kFormatUrlExperimentalOmitHTTPS, |
| + net::UnescapeRule::NORMAL, L"example.com/foo", 0}, |
| + |
| + {"omit https should not affect hosts starting with ftp.", |
| + "https://ftp.google.com/", |
| + kFormatUrlOmitHTTP | kFormatUrlExperimentalOmitHTTPS, |
| + net::UnescapeRule::NORMAL, L"https://ftp.google.com/", 8}, |
| + |
| // -------- omit trailing slash on bare hostname -------- |
| {"omit slash when it's the entire path", "http://www.google.com/", |
| kFormatUrlOmitTrailingSlashOnBareHostname, net::UnescapeRule::NORMAL, |
| @@ -1249,6 +1268,21 @@ TEST(UrlFormatterTest, FormatUrlWithOffsets) { |
| net::UnescapeRule::NORMAL, |
| omit_http_start_with_ftp_offsets); |
| + const size_t omit_https_offsets[] = { |
| + 0, kNpos, kNpos, kNpos, kNpos, kNpos, kNpos, kNpos, 0, 1, 2, 3, |
| + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; |
| + CheckAdjustedOffsets("https://www.google.com/", |
| + kFormatUrlExperimentalOmitHTTPS, |
| + net::UnescapeRule::NORMAL, omit_https_offsets); |
| + |
| + const size_t omit_https_with_auth_offsets[] = { |
| + 0, kNpos, kNpos, kNpos, kNpos, kNpos, kNpos, kNpos, 0, |
| + kNpos, kNpos, kNpos, 0, 1, 2, 3, 4, 5, |
| + 6, 7, 8, 9, 10, 11, 12, 13, 14}; |
| + CheckAdjustedOffsets("https://u:p@www.google.com/", |
| + kFormatUrlOmitAll | kFormatUrlExperimentalOmitHTTPS, |
| + net::UnescapeRule::NORMAL, omit_https_with_auth_offsets); |
| + |
| const size_t omit_all_offsets[] = { |
| 0, kNpos, kNpos, kNpos, kNpos, kNpos, kNpos, 0, kNpos, kNpos, kNpos, kNpos, |
| 0, 1, 2, 3, 4, 5, 6, 7 |