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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 vector<TestParams> GetTestParams() { | 155 vector<TestParams> GetTestParams() { |
156 // Divide the versions into buckets in which the intra-frame format | 156 // Divide the versions into buckets in which the intra-frame format |
157 // is compatible. When clients encounter QUIC version negotiation | 157 // is compatible. When clients encounter QUIC version negotiation |
158 // they simply retransmit all packets using the new version's | 158 // they simply retransmit all packets using the new version's |
159 // QUIC framing. However, they are unable to change the intra-frame | 159 // QUIC framing. However, they are unable to change the intra-frame |
160 // layout (for example to change HTTP2 headers to SPDY/3). So | 160 // layout (for example to change HTTP2 headers to SPDY/3). So |
161 // these tests need to ensure that clients are never attempting | 161 // these tests need to ensure that clients are never attempting |
162 // to do 0-RTT across incompatible versions. Chromium only supports | 162 // to do 0-RTT across incompatible versions. Chromium only supports |
163 // a single version at a time anyway. :) | 163 // a single version at a time anyway. :) |
164 QuicVersionVector all_supported_versions = AllSupportedVersions(); | 164 QuicVersionVector all_supported_versions = AllSupportedVersions(); |
165 QuicVersionVector version_buckets[4]; | 165 QuicVersionVector version_buckets[3]; |
166 | 166 |
167 for (const QuicVersion version : all_supported_versions) { | 167 for (const QuicVersion version : all_supported_versions) { |
168 if (version <= QUIC_VERSION_30) { | 168 if (version <= QUIC_VERSION_32) { |
169 // Versions: 30 | |
170 // v26 adds a hash of the expected leaf cert in the XLCT tag. | |
171 version_buckets[0].push_back(version); | |
172 } else if (version <= QUIC_VERSION_32) { | |
173 // Versions: 31-32 | 169 // Versions: 31-32 |
174 // v31 adds a hash of the CHLO into the proof signature. | 170 // v31 adds a hash of the CHLO into the proof signature. |
175 version_buckets[1].push_back(version); | 171 version_buckets[0].push_back(version); |
176 } else if (version <= QUIC_VERSION_33) { | 172 } else if (version <= QUIC_VERSION_33) { |
177 // Versions: 33 | 173 // Versions: 33 |
178 // v33 adds a diversification nonce into the hkdf. | 174 // v33 adds a diversification nonce into the hkdf. |
179 version_buckets[2].push_back(version); | 175 version_buckets[1].push_back(version); |
180 } else { | 176 } else { |
181 // Versions: 34+ | 177 // Versions: 34+ |
182 // QUIC_VERSION_34 deprecates entropy and uses new ack and stop waiting | 178 // QUIC_VERSION_34 deprecates entropy and uses new ack and stop waiting |
183 // wire formats. | 179 // wire formats. |
184 version_buckets[3].push_back(version); | 180 version_buckets[2].push_back(version); |
185 } | 181 } |
186 } | 182 } |
187 | 183 |
188 // This must be kept in sync with the number of nested for-loops below as it | 184 // This must be kept in sync with the number of nested for-loops below as it |
189 // is used to prune the number of tests that are run. | 185 // is used to prune the number of tests that are run. |
190 const int kMaxEnabledOptions = 7; | 186 const int kMaxEnabledOptions = 7; |
191 int max_enabled_options = 0; | 187 int max_enabled_options = 0; |
192 vector<TestParams> params; | 188 vector<TestParams> params; |
193 for (bool server_uses_stateless_rejects_if_peer_supported : {true, false}) { | 189 for (bool server_uses_stateless_rejects_if_peer_supported : {true, false}) { |
194 for (bool client_supports_stateless_rejects : {true, false}) { | 190 for (bool client_supports_stateless_rejects : {true, false}) { |
(...skipping 2764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2959 EXPECT_EQ(kBarResponseBody, client_->response_body()); | 2955 EXPECT_EQ(kBarResponseBody, client_->response_body()); |
2960 QuicConnectionStats client_stats = | 2956 QuicConnectionStats client_stats = |
2961 client_->client()->session()->connection()->GetStats(); | 2957 client_->client()->session()->connection()->GetStats(); |
2962 EXPECT_EQ(0u, client_stats.packets_lost); | 2958 EXPECT_EQ(0u, client_stats.packets_lost); |
2963 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); | 2959 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); |
2964 } | 2960 } |
2965 | 2961 |
2966 } // namespace | 2962 } // namespace |
2967 } // namespace test | 2963 } // namespace test |
2968 } // namespace net | 2964 } // namespace net |
OLD | NEW |