| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "net/base/net_util.h" | 5 #include "net/base/net_util.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
| (...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1368 {"view-source", | 1368 {"view-source", |
| 1369 "view-source:http://xn--qcka1pmc.jp/", L"ja", default_format_type, | 1369 "view-source:http://xn--qcka1pmc.jp/", L"ja", default_format_type, |
| 1370 UnescapeRule::NORMAL, L"view-source:http://\x30B0\x30FC\x30B0\x30EB.jp/", | 1370 UnescapeRule::NORMAL, L"view-source:http://\x30B0\x30FC\x30B0\x30EB.jp/", |
| 1371 12 + 7}, | 1371 12 + 7}, |
| 1372 | 1372 |
| 1373 {"view-source of view-source", | 1373 {"view-source of view-source", |
| 1374 "view-source:view-source:http://xn--qcka1pmc.jp/", L"ja", | 1374 "view-source:view-source:http://xn--qcka1pmc.jp/", L"ja", |
| 1375 default_format_type, UnescapeRule::NORMAL, | 1375 default_format_type, UnescapeRule::NORMAL, |
| 1376 L"view-source:view-source:http://xn--qcka1pmc.jp/", 12}, | 1376 L"view-source:view-source:http://xn--qcka1pmc.jp/", 12}, |
| 1377 | 1377 |
| 1378 // view-source should not omit http. |
| 1379 {"view-source omit http", |
| 1380 "view-source:http://a.b/c", L"en", net::kFormatUrlOmitAll, |
| 1381 UnescapeRule::NORMAL, L"view-source:http://a.b/c", |
| 1382 19}, |
| 1383 |
| 1378 // -------- omit http: -------- | 1384 // -------- omit http: -------- |
| 1379 {"omit http with user name", | 1385 {"omit http with user name", |
| 1380 "http://user@example.com/foo", L"", net::kFormatUrlOmitAll, | 1386 "http://user@example.com/foo", L"", net::kFormatUrlOmitAll, |
| 1381 UnescapeRule::NORMAL, L"example.com/foo", 0}, | 1387 UnescapeRule::NORMAL, L"example.com/foo", 0}, |
| 1382 | 1388 |
| 1383 {"omit http", | 1389 {"omit http", |
| 1384 "http://www.google.com/", L"en", net::kFormatUrlOmitHTTP, | 1390 "http://www.google.com/", L"en", net::kFormatUrlOmitHTTP, |
| 1385 UnescapeRule::NORMAL, L"www.google.com/", | 1391 UnescapeRule::NORMAL, L"www.google.com/", |
| 1386 0}, | 1392 0}, |
| 1387 | 1393 |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1750 } | 1756 } |
| 1751 | 1757 |
| 1752 TEST(NetUtilTest, GetHostOrSpecFromURL) { | 1758 TEST(NetUtilTest, GetHostOrSpecFromURL) { |
| 1753 EXPECT_EQ("example.com", | 1759 EXPECT_EQ("example.com", |
| 1754 net::GetHostOrSpecFromURL(GURL("http://example.com/test"))); | 1760 net::GetHostOrSpecFromURL(GURL("http://example.com/test"))); |
| 1755 EXPECT_EQ("example.com", | 1761 EXPECT_EQ("example.com", |
| 1756 net::GetHostOrSpecFromURL(GURL("http://example.com./test"))); | 1762 net::GetHostOrSpecFromURL(GURL("http://example.com./test"))); |
| 1757 EXPECT_EQ("file:///tmp/test.html", | 1763 EXPECT_EQ("file:///tmp/test.html", |
| 1758 net::GetHostOrSpecFromURL(GURL("file:///tmp/test.html"))); | 1764 net::GetHostOrSpecFromURL(GURL("file:///tmp/test.html"))); |
| 1759 } | 1765 } |
| OLD | NEW |