OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/pickle.h" | 9 #include "base/pickle.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 2227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2238 "Chrome-Proxy: bypass=1799\n", | 2238 "Chrome-Proxy: bypass=1799\n", |
2239 net::ProxyService::SHORT_BYPASS, | 2239 net::ProxyService::SHORT_BYPASS, |
2240 }, | 2240 }, |
2241 { "HTTP/1.1 502 Bad Gateway\n", | 2241 { "HTTP/1.1 502 Bad Gateway\n", |
2242 net::ProxyService::INTERNAL_SERVER_ERROR_BYPASS, | 2242 net::ProxyService::INTERNAL_SERVER_ERROR_BYPASS, |
2243 }, | 2243 }, |
2244 { "HTTP/1.1 502 Bad Gateway\n" | 2244 { "HTTP/1.1 502 Bad Gateway\n" |
2245 "Chrome-Proxy: bypass=1799\n", | 2245 "Chrome-Proxy: bypass=1799\n", |
2246 net::ProxyService::SHORT_BYPASS, | 2246 net::ProxyService::SHORT_BYPASS, |
2247 }, | 2247 }, |
| 2248 { "HTTP/1.1 502 Bad Gateway\n" |
| 2249 "Chrome-Proxy: bypass=1799\n", |
| 2250 net::ProxyService::SHORT_BYPASS, |
| 2251 }, |
| 2252 { "HTTP/1.1 414 Request-URI Too Long\n", |
| 2253 net::ProxyService::PROXY_4XX_BYPASS, |
| 2254 }, |
| 2255 { "HTTP/1.1 414 Request-URI Too Long\n" |
| 2256 "Via: 1.1 Chrome-Compression-Proxy\n", |
| 2257 net::ProxyService::BYPASS_EVENT_TYPE_MAX, |
| 2258 } |
2248 }; | 2259 }; |
2249 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { | 2260 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { |
2250 std::string headers(tests[i].headers); | 2261 std::string headers(tests[i].headers); |
2251 HeadersToRaw(&headers); | 2262 HeadersToRaw(&headers); |
2252 scoped_refptr<net::HttpResponseHeaders> parsed( | 2263 scoped_refptr<net::HttpResponseHeaders> parsed( |
2253 new net::HttpResponseHeaders(headers)); | 2264 new net::HttpResponseHeaders(headers)); |
2254 net::HttpResponseHeaders::DataReductionProxyInfo chrome_proxy_info; | 2265 net::HttpResponseHeaders::DataReductionProxyInfo chrome_proxy_info; |
2255 EXPECT_EQ(tests[i].expected_result, | 2266 EXPECT_EQ(tests[i].expected_result, |
2256 parsed->GetDataReductionProxyBypassEventType(&chrome_proxy_info)); | 2267 parsed->GetDataReductionProxyBypassEventType(&chrome_proxy_info)); |
2257 } | 2268 } |
2258 } | 2269 } |
2259 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) | 2270 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) |
OLD | NEW |