| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/url_formatter/elide_url.h" | 5 #include "components/url_formatter/elide_url.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/ios/ios_util.h" | 9 #include "base/ios/ios_util.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 L"www...cyber"}, | 314 L"www...cyber"}, |
| 315 {"Invalid port 1", "https://173.194.65.103:000", | 315 {"Invalid port 1", "https://173.194.65.103:000", |
| 316 L"https://173.194.65.103:0", L"173.194.65.103:0"}, | 316 L"https://173.194.65.103:0", L"173.194.65.103:0"}, |
| 317 {"Invalid port 2", "https://173.194.65.103:gruffle", | 317 {"Invalid port 2", "https://173.194.65.103:gruffle", |
| 318 L"https://173.194.65.103:gruffle", L"https://173.194.65.103:gruffle"}, | 318 L"https://173.194.65.103:gruffle", L"https://173.194.65.103:gruffle"}, |
| 319 {"Invalid port 3", "https://173.194.65.103:/hello.aspx", | 319 {"Invalid port 3", "https://173.194.65.103:/hello.aspx", |
| 320 L"https://173.194.65.103", L"173.194.65.103"}, | 320 L"https://173.194.65.103", L"173.194.65.103"}, |
| 321 {"Trailing dot in DNS name", "https://www.example.com./get/goat", | 321 {"Trailing dot in DNS name", "https://www.example.com./get/goat", |
| 322 L"https://www.example.com.", L"www.example.com."}, | 322 L"https://www.example.com.", L"www.example.com."}, |
| 323 {"Blob URL", | 323 {"Blob URL", |
| 324 "blob:http%3A//www.html5rocks.com/4d4ff040-6d61-4446-86d3-13ca07ec9ab9", | 324 "blob:http://www.html5rocks.com/4d4ff040-6d61-4446-86d3-13ca07ec9ab9", |
| 325 L"blob:http%3A//www.html5rocks.com/" | 325 L"blob:http://www.html5rocks.com/" |
| 326 L"4d4ff040-6d61-4446-86d3-13ca07ec9ab9", | 326 L"4d4ff040-6d61-4446-86d3-13ca07ec9ab9", |
| 327 L"blob:http%3A//www.html5rocks.com/" | 327 L"blob:http://www.html5rocks.com/" |
| 328 L"4d4ff040-6d61-4446-86d3-13ca07ec9ab9"}}; | 328 L"4d4ff040-6d61-4446-86d3-13ca07ec9ab9"}}; |
| 329 | 329 |
| 330 const char languages[] = "zh-TW,en-US,en,am,ar-EG,ar"; | 330 const char languages[] = "zh-TW,en-US,en,am,ar-EG,ar"; |
| 331 for (size_t i = 0; i < arraysize(tests); ++i) { | 331 for (size_t i = 0; i < arraysize(tests); ++i) { |
| 332 base::string16 formatted = url_formatter::FormatUrlForSecurityDisplay( | 332 base::string16 formatted = url_formatter::FormatUrlForSecurityDisplay( |
| 333 GURL(tests[i].input), std::string()); | 333 GURL(tests[i].input), std::string()); |
| 334 EXPECT_EQ(base::WideToUTF16(tests[i].output), formatted) | 334 EXPECT_EQ(base::WideToUTF16(tests[i].output), formatted) |
| 335 << tests[i].description; | 335 << tests[i].description; |
| 336 | 336 |
| 337 base::string16 formatted_omit_scheme = | 337 base::string16 formatted_omit_scheme = |
| (...skipping 23 matching lines...) Expand all Loading... |
| 361 << "Explicitly test the 0-argument GURL constructor"; | 361 << "Explicitly test the 0-argument GURL constructor"; |
| 362 | 362 |
| 363 base::string16 formatted_omit_scheme = | 363 base::string16 formatted_omit_scheme = |
| 364 url_formatter::FormatUrlForSecurityDisplayOmitScheme(GURL(), | 364 url_formatter::FormatUrlForSecurityDisplayOmitScheme(GURL(), |
| 365 std::string()); | 365 std::string()); |
| 366 EXPECT_EQ(base::string16(), formatted_omit_scheme) | 366 EXPECT_EQ(base::string16(), formatted_omit_scheme) |
| 367 << "Explicitly test the 0-argument GURL constructor"; | 367 << "Explicitly test the 0-argument GURL constructor"; |
| 368 } | 368 } |
| 369 | 369 |
| 370 } // namespace | 370 } // namespace |
| OLD | NEW |