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/core/browser/data_reduction_proxy_bypa
ss_protocol.h" | 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_bypa
ss_protocol.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 | 879 |
880 net::TestDelegate delegate; | 880 net::TestDelegate delegate; |
881 std::unique_ptr<net::URLRequest> url_request(context()->CreateRequest( | 881 std::unique_ptr<net::URLRequest> url_request(context()->CreateRequest( |
882 GURL("http://www.google.com"), net::IDLE, &delegate)); | 882 GURL("http://www.google.com"), net::IDLE, &delegate)); |
883 url_request->Start(); | 883 url_request->Start(); |
884 drp_test_context()->RunUntilIdle(); | 884 drp_test_context()->RunUntilIdle(); |
885 | 885 |
886 EXPECT_EQ(test.expected_bypass_type, | 886 EXPECT_EQ(test.expected_bypass_type, |
887 drp_test_context()->io_data()->bypass_stats()->GetBypassType()); | 887 drp_test_context()->io_data()->bypass_stats()->GetBypassType()); |
888 // Check the bad proxy list. | 888 // Check the bad proxy list. |
889 EXPECT_EQ( | 889 EXPECT_EQ(test.expected_bad_proxy, |
890 test.expected_bad_proxy, | 890 base::ContainsKey(context()->proxy_service()->proxy_retry_info(), |
891 ContainsKey(context()->proxy_service()->proxy_retry_info(), kPrimary)); | 891 kPrimary)); |
892 } | 892 } |
893 } | 893 } |
894 | 894 |
895 TEST_F(DataReductionProxyBypassProtocolEndToEndTest, | 895 TEST_F(DataReductionProxyBypassProtocolEndToEndTest, |
896 ResponseProxyServerStateHistogram) { | 896 ResponseProxyServerStateHistogram) { |
897 const struct { | 897 const struct { |
898 const char* proxy_rules; | 898 const char* proxy_rules; |
899 bool enable_data_reduction_proxy; | 899 bool enable_data_reduction_proxy; |
900 const char* response_headers; | 900 const char* response_headers; |
901 // |RESPONSE_PROXY_SERVER_STATUS_MAX| indicates no expected value. | 901 // |RESPONSE_PROXY_SERVER_STATUS_MAX| indicates no expected value. |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 EXPECT_EQ(net::URLRequestStatus::SUCCESS, r->status().status()); | 983 EXPECT_EQ(net::URLRequestStatus::SUCCESS, r->status().status()); |
984 EXPECT_EQ(net::OK, r->status().error()); | 984 EXPECT_EQ(net::OK, r->status().error()); |
985 | 985 |
986 EXPECT_EQ("Bypass message", d.data_received()); | 986 EXPECT_EQ("Bypass message", d.data_received()); |
987 | 987 |
988 // We should have no entries in our bad proxy list. | 988 // We should have no entries in our bad proxy list. |
989 TestBadProxies(0, -1, "", ""); | 989 TestBadProxies(0, -1, "", ""); |
990 } | 990 } |
991 | 991 |
992 } // namespace data_reduction_proxy | 992 } // namespace data_reduction_proxy |
OLD | NEW |