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/common/data_reduction_proxy_heade
rs.h" | 5 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade
rs.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 #include <stdint.h> |
| 9 |
7 #include <vector> | 10 #include <vector> |
8 | 11 |
| 12 #include "base/macros.h" |
9 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_event
_creator.h" | 13 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_event
_creator.h" |
10 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_event
_storage_delegate_test_utils.h" | 14 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_event
_storage_delegate_test_utils.h" |
11 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade
rs_test_utils.h" | 15 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade
rs_test_utils.h" |
12 #include "net/http/http_response_headers.h" | 16 #include "net/http/http_response_headers.h" |
13 #include "net/proxy/proxy_service.h" | 17 #include "net/proxy/proxy_service.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
15 | 19 |
16 namespace data_reduction_proxy { | 20 namespace data_reduction_proxy { |
17 | 21 |
18 class DataReductionProxyHeadersTest : public testing::Test { | 22 class DataReductionProxyHeadersTest : public testing::Test { |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 if (has_action_key) { | 127 if (has_action_key) { |
124 EXPECT_EQ(tests[i].expected_action_value, action_value); | 128 EXPECT_EQ(tests[i].expected_action_value, action_value); |
125 } | 129 } |
126 } | 130 } |
127 } | 131 } |
128 | 132 |
129 TEST_F(DataReductionProxyHeadersTest, GetProxyBypassInfo) { | 133 TEST_F(DataReductionProxyHeadersTest, GetProxyBypassInfo) { |
130 const struct { | 134 const struct { |
131 const char* headers; | 135 const char* headers; |
132 bool expected_result; | 136 bool expected_result; |
133 int64 expected_retry_delay; | 137 int64_t expected_retry_delay; |
134 bool expected_bypass_all; | 138 bool expected_bypass_all; |
135 bool expected_mark_proxies_as_bad; | 139 bool expected_mark_proxies_as_bad; |
136 } tests[] = { | 140 } tests[] = { |
137 { "HTTP/1.1 200 OK\n" | 141 { "HTTP/1.1 200 OK\n" |
138 "Content-Length: 999\n", | 142 "Content-Length: 999\n", |
139 false, | 143 false, |
140 0, | 144 0, |
141 false, | 145 false, |
142 false, | 146 false, |
143 }, | 147 }, |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 std::string output_values_string; | 848 std::string output_values_string; |
845 for (size_t j = 0; j < output_values.size(); ++j) | 849 for (size_t j = 0; j < output_values.size(); ++j) |
846 output_values_string += output_values[j] + ","; | 850 output_values_string += output_values[j] + ","; |
847 | 851 |
848 EXPECT_EQ(test[i].expected_output_values_string, output_values_string) | 852 EXPECT_EQ(test[i].expected_output_values_string, output_values_string) |
849 << test[i].label; | 853 << test[i].label; |
850 } | 854 } |
851 } | 855 } |
852 | 856 |
853 } // namespace data_reduction_proxy | 857 } // namespace data_reduction_proxy |
OLD | NEW |