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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "net/proxy/proxy_server.h" | 6 #include "net/proxy/proxy_server.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 // Test the creation of ProxyServer using ProxyServer::FromURI, which parses | 9 // Test the creation of ProxyServer using ProxyServer::FromURI, which parses |
10 // inputs of the form [<scheme>"://"]<host>[":"<port>]. Verify that each part | 10 // inputs of the form [<scheme>"://"]<host>[":"<port>]. Verify that each part |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 }, | 107 }, |
108 { | 108 { |
109 "socks5://foopy:10", | 109 "socks5://foopy:10", |
110 "socks5://foopy:10", | 110 "socks5://foopy:10", |
111 net::ProxyServer::SCHEME_SOCKS5, | 111 net::ProxyServer::SCHEME_SOCKS5, |
112 "foopy", | 112 "foopy", |
113 10, | 113 10, |
114 "SOCKS5 foopy:10" | 114 "SOCKS5 foopy:10" |
115 }, | 115 }, |
116 | 116 |
117 // SOCKS proxy URIs (should default to SOCKS4) | 117 // SOCKS proxy URIs (should default to SOCKS5) |
118 { | 118 { |
119 "socks://foopy", // No port. | 119 "socks://foopy", // No port. |
120 "socks4://foopy:1080", | 120 "socks5://foopy:1080", |
121 net::ProxyServer::SCHEME_SOCKS4, | 121 net::ProxyServer::SCHEME_SOCKS5, |
122 "foopy", | 122 "foopy", |
123 1080, | 123 1080, |
124 "SOCKS foopy:1080" | 124 "SOCKS5 foopy:1080" |
125 }, | 125 }, |
126 { | 126 { |
127 "socks://foopy:10", | 127 "socks://foopy:10", |
128 "socks4://foopy:10", | 128 "socks5://foopy:10", |
129 net::ProxyServer::SCHEME_SOCKS4, | 129 net::ProxyServer::SCHEME_SOCKS5, |
130 "foopy", | 130 "foopy", |
131 10, | 131 10, |
132 "SOCKS foopy:10" | 132 "SOCKS5 foopy:10" |
133 }, | 133 }, |
134 | 134 |
135 // HTTPS proxy URIs: | 135 // HTTPS proxy URIs: |
136 { | 136 { |
137 "https://foopy", // No port | 137 "https://foopy", // No port |
138 "https://foopy:443", | 138 "https://foopy:443", |
139 net::ProxyServer::SCHEME_HTTPS, | 139 net::ProxyServer::SCHEME_HTTPS, |
140 "foopy", | 140 "foopy", |
141 443, | 141 443, |
142 "HTTPS foopy:443" | 142 "HTTPS foopy:443" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 case 1: | 359 case 1: |
360 EXPECT_FALSE(server1 < server2); | 360 EXPECT_FALSE(server1 < server2); |
361 EXPECT_TRUE(server2 < server1); | 361 EXPECT_TRUE(server2 < server1); |
362 EXPECT_FALSE(server2 == server1); | 362 EXPECT_FALSE(server2 == server1); |
363 break; | 363 break; |
364 default: | 364 default: |
365 FAIL() << "Invalid expectation. Can be only -1, 0, 1"; | 365 FAIL() << "Invalid expectation. Can be only -1, 0, 1"; |
366 } | 366 } |
367 } | 367 } |
368 } | 368 } |
OLD | NEW |