| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <sys/epoll.h> | 6 #include <sys/epoll.h> |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 bool client_supports_stateless_rejects; | 142 bool client_supports_stateless_rejects; |
| 143 bool server_uses_stateless_rejects_if_peer_supported; | 143 bool server_uses_stateless_rejects_if_peer_supported; |
| 144 QuicTag congestion_control_tag; | 144 QuicTag congestion_control_tag; |
| 145 bool disable_hpack_dynamic_table; | 145 bool disable_hpack_dynamic_table; |
| 146 bool force_hol_blocking; | 146 bool force_hol_blocking; |
| 147 bool use_cheap_stateless_reject; | 147 bool use_cheap_stateless_reject; |
| 148 bool buffer_packet_till_chlo; | 148 bool buffer_packet_till_chlo; |
| 149 }; | 149 }; |
| 150 | 150 |
| 151 // Constructs various test permutations. | 151 // Constructs various test permutations. |
| 152 vector<TestParams> GetTestParams() { | 152 std::vector<TestParams> GetTestParams() { |
| 153 // Divide the versions into buckets in which the intra-frame format | 153 // Divide the versions into buckets in which the intra-frame format |
| 154 // is compatible. When clients encounter QUIC version negotiation | 154 // is compatible. When clients encounter QUIC version negotiation |
| 155 // they simply retransmit all packets using the new version's | 155 // they simply retransmit all packets using the new version's |
| 156 // QUIC framing. However, they are unable to change the intra-frame | 156 // QUIC framing. However, they are unable to change the intra-frame |
| 157 // layout (for example to change HTTP2 headers to SPDY/3). So | 157 // layout (for example to change HTTP2 headers to SPDY/3). So |
| 158 // these tests need to ensure that clients are never attempting | 158 // these tests need to ensure that clients are never attempting |
| 159 // to do 0-RTT across incompatible versions. Chromium only supports | 159 // to do 0-RTT across incompatible versions. Chromium only supports |
| 160 // a single version at a time anyway. :) | 160 // a single version at a time anyway. :) |
| 161 QuicVersionVector all_supported_versions = AllSupportedVersions(); | 161 QuicVersionVector all_supported_versions = AllSupportedVersions(); |
| 162 QuicVersionVector version_buckets[3]; | 162 QuicVersionVector version_buckets[3]; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 175 // QUIC_VERSION_34 deprecates entropy and uses new ack and stop waiting | 175 // QUIC_VERSION_34 deprecates entropy and uses new ack and stop waiting |
| 176 // wire formats. | 176 // wire formats. |
| 177 version_buckets[2].push_back(version); | 177 version_buckets[2].push_back(version); |
| 178 } | 178 } |
| 179 } | 179 } |
| 180 | 180 |
| 181 // This must be kept in sync with the number of nested for-loops below as it | 181 // This must be kept in sync with the number of nested for-loops below as it |
| 182 // is used to prune the number of tests that are run. | 182 // is used to prune the number of tests that are run. |
| 183 const int kMaxEnabledOptions = 6; | 183 const int kMaxEnabledOptions = 6; |
| 184 int max_enabled_options = 0; | 184 int max_enabled_options = 0; |
| 185 vector<TestParams> params; | 185 std::vector<TestParams> params; |
| 186 for (bool server_uses_stateless_rejects_if_peer_supported : {true, false}) { | 186 for (bool server_uses_stateless_rejects_if_peer_supported : {true, false}) { |
| 187 for (bool client_supports_stateless_rejects : {true, false}) { | 187 for (bool client_supports_stateless_rejects : {true, false}) { |
| 188 for (const QuicTag congestion_control_tag : {kRENO, kQBIC}) { | 188 for (const QuicTag congestion_control_tag : {kRENO, kQBIC}) { |
| 189 for (bool disable_hpack_dynamic_table : {false}) { | 189 for (bool disable_hpack_dynamic_table : {false}) { |
| 190 for (bool force_hol_blocking : {true, false}) { | 190 for (bool force_hol_blocking : {true, false}) { |
| 191 for (bool use_cheap_stateless_reject : {true, false}) { | 191 for (bool use_cheap_stateless_reject : {true, false}) { |
| 192 for (bool buffer_packet_till_chlo : {true, false}) { | 192 for (bool buffer_packet_till_chlo : {true, false}) { |
| 193 if (!buffer_packet_till_chlo && use_cheap_stateless_reject) { | 193 if (!buffer_packet_till_chlo && use_cheap_stateless_reject) { |
| 194 // Doing stateless reject while not buffering packet | 194 // Doing stateless reject while not buffering packet |
| 195 // before CHLO is not allowed. | 195 // before CHLO is not allowed. |
| (...skipping 2788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2984 client_->WaitForResponse(); | 2984 client_->WaitForResponse(); |
| 2985 EXPECT_EQ(kBarResponseBody, client_->response_body()); | 2985 EXPECT_EQ(kBarResponseBody, client_->response_body()); |
| 2986 QuicConnectionStats client_stats = | 2986 QuicConnectionStats client_stats = |
| 2987 client_->client()->session()->connection()->GetStats(); | 2987 client_->client()->session()->connection()->GetStats(); |
| 2988 EXPECT_EQ(0u, client_stats.packets_lost); | 2988 EXPECT_EQ(0u, client_stats.packets_lost); |
| 2989 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); | 2989 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); |
| 2990 } | 2990 } |
| 2991 } // namespace | 2991 } // namespace |
| 2992 } // namespace test | 2992 } // namespace test |
| 2993 } // namespace net | 2993 } // namespace net |
| OLD | NEW |