OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 { | 547 { |
548 "http://username:password@google.com", | 548 "http://username:password@google.com", |
549 L"username", | 549 L"username", |
550 L"password", | 550 L"password", |
551 }, | 551 }, |
552 { // Test for http://crbug.com/19200 | 552 { // Test for http://crbug.com/19200 |
553 "http://username:p@ssword@google.com", | 553 "http://username:p@ssword@google.com", |
554 L"username", | 554 L"username", |
555 L"p@ssword", | 555 L"p@ssword", |
556 }, | 556 }, |
| 557 { // Special URL characters should be unescaped. |
| 558 "http://username:p%3fa%26s%2fs%23@google.com", |
| 559 L"username", |
| 560 L"p?a&s/s#", |
| 561 }, |
557 { // Username contains %20. | 562 { // Username contains %20. |
558 "http://use rname:password@google.com", | 563 "http://use rname:password@google.com", |
559 L"use rname", | 564 L"use rname", |
560 L"password", | 565 L"password", |
561 }, | 566 }, |
562 { // Keep %00 as is. | 567 { // Keep %00 as is. |
563 "http://use%00rname:password@google.com", | 568 "http://use%00rname:password@google.com", |
564 L"use%00rname", | 569 L"use%00rname", |
565 L"password", | 570 L"password", |
566 }, | 571 }, |
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1619 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(invalid); ++i) { | 1624 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(invalid); ++i) { |
1620 net::SetExplicitlyAllowedPorts(invalid[i]); | 1625 net::SetExplicitlyAllowedPorts(invalid[i]); |
1621 EXPECT_EQ(0, static_cast<int>(net::explicitly_allowed_ports.size())); | 1626 EXPECT_EQ(0, static_cast<int>(net::explicitly_allowed_ports.size())); |
1622 } | 1627 } |
1623 | 1628 |
1624 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(valid); ++i) { | 1629 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(valid); ++i) { |
1625 net::SetExplicitlyAllowedPorts(valid[i]); | 1630 net::SetExplicitlyAllowedPorts(valid[i]); |
1626 EXPECT_EQ(i, net::explicitly_allowed_ports.size()); | 1631 EXPECT_EQ(i, net::explicitly_allowed_ports.size()); |
1627 } | 1632 } |
1628 } | 1633 } |
OLD | NEW |