Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(870)

Side by Side Diff: net/http/http_response_headers_unittest.cc

Issue 298883011: Record errors that trigger a data reduction proxy bypass (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/http/http_response_headers.cc ('k') | net/http/http_stream_factory_impl_job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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)
OLDNEW
« no previous file with comments | « net/http/http_response_headers.cc ('k') | net/http/http_stream_factory_impl_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698