OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/data_reduction_proxy/browser/data_reduction_proxy_protocol.
h" | 5 #include "components/data_reduction_proxy/browser/data_reduction_proxy_protocol.
h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 std::string headers(tests[i].headers); | 344 std::string headers(tests[i].headers); |
345 HeadersToRaw(&headers); | 345 HeadersToRaw(&headers); |
346 scoped_refptr<HttpResponseHeaders> original_response_headers( | 346 scoped_refptr<HttpResponseHeaders> original_response_headers( |
347 new HttpResponseHeaders(headers)); | 347 new HttpResponseHeaders(headers)); |
348 scoped_refptr<HttpResponseHeaders> override_response_headers; | 348 scoped_refptr<HttpResponseHeaders> override_response_headers; |
349 TestDelegate test_delegate; | 349 TestDelegate test_delegate; |
350 net::TestURLRequest request(GURL("http://www.google.com/"), | 350 net::TestURLRequest request(GURL("http://www.google.com/"), |
351 net::DEFAULT_PRIORITY, | 351 net::DEFAULT_PRIORITY, |
352 NULL, | 352 NULL, |
353 &context); | 353 &context); |
354 OverrideResponseAsRedirect(&request, | 354 OverrideResponseAsRedirect( |
355 original_response_headers, | 355 &request, original_response_headers.get(), &override_response_headers); |
356 &override_response_headers); | |
357 int expected_flags = net::LOAD_DISABLE_CACHE | net::LOAD_BYPASS_PROXY; | 356 int expected_flags = net::LOAD_DISABLE_CACHE | net::LOAD_BYPASS_PROXY; |
358 EXPECT_EQ(expected_flags, request.load_flags()); | 357 EXPECT_EQ(expected_flags, request.load_flags()); |
359 std::string override_headers; | 358 std::string override_headers; |
360 override_response_headers->GetNormalizedHeaders(&override_headers); | 359 override_response_headers->GetNormalizedHeaders(&override_headers); |
361 EXPECT_EQ(std::string(tests[i].expected_headers), override_headers); | 360 EXPECT_EQ(std::string(tests[i].expected_headers), override_headers); |
362 } | 361 } |
363 } | 362 } |
364 | 363 |
365 | 364 |
366 // After each test, the proxy retry info will contain zero, one, or two of the | 365 // After each test, the proxy retry info will contain zero, one, or two of the |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 &other_proxy_info); | 912 &other_proxy_info); |
914 EXPECT_FALSE(other_proxy_info.is_direct()); | 913 EXPECT_FALSE(other_proxy_info.is_direct()); |
915 | 914 |
916 OnResolveProxyHandler(url, load_flags, data_reduction_proxy_config, | 915 OnResolveProxyHandler(url, load_flags, data_reduction_proxy_config, |
917 empty_proxy_retry_info, &test_params, | 916 empty_proxy_retry_info, &test_params, |
918 &data_reduction_proxy_info); | 917 &data_reduction_proxy_info); |
919 EXPECT_TRUE(data_reduction_proxy_info.is_direct()); | 918 EXPECT_TRUE(data_reduction_proxy_info.is_direct()); |
920 } | 919 } |
921 | 920 |
922 } // namespace data_reduction_proxy | 921 } // namespace data_reduction_proxy |
OLD | NEW |