OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <memory> | 5 #include <memory> |
6 #include <ostream> | 6 #include <ostream> |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 172 |
173 // Starts the QUIC server listening on a random port. | 173 // Starts the QUIC server listening on a random port. |
174 void StartServer() { | 174 void StartServer() { |
175 server_address_ = IPEndPoint(IPAddress(127, 0, 0, 1), 0); | 175 server_address_ = IPEndPoint(IPAddress(127, 0, 0, 1), 0); |
176 server_config_.SetInitialStreamFlowControlWindowToSend( | 176 server_config_.SetInitialStreamFlowControlWindowToSend( |
177 kInitialStreamFlowControlWindowForTest); | 177 kInitialStreamFlowControlWindowForTest); |
178 server_config_.SetInitialSessionFlowControlWindowToSend( | 178 server_config_.SetInitialSessionFlowControlWindowToSend( |
179 kInitialSessionFlowControlWindowForTest); | 179 kInitialSessionFlowControlWindowForTest); |
180 server_config_options_.token_binding_params = QuicTagVector{kTB10, kP256}; | 180 server_config_options_.token_binding_params = QuicTagVector{kTB10, kP256}; |
181 server_.reset(new QuicSimpleServer( | 181 server_.reset(new QuicSimpleServer( |
182 CryptoTestUtils::ProofSourceForTesting(), server_config_, | 182 crypto_test_utils::ProofSourceForTesting(), server_config_, |
183 server_config_options_, AllSupportedVersions(), &response_cache_)); | 183 server_config_options_, AllSupportedVersions(), &response_cache_)); |
184 server_->Listen(server_address_); | 184 server_->Listen(server_address_); |
185 server_address_ = server_->server_address(); | 185 server_address_ = server_->server_address(); |
186 server_->StartReading(); | 186 server_->StartReading(); |
187 server_started_ = true; | 187 server_started_ = true; |
188 } | 188 } |
189 | 189 |
190 // Adds an entry to the cache used by the QUIC server to serve | 190 // Adds an entry to the cache used by the QUIC server to serve |
191 // responses. | 191 // responses. |
192 void AddToCache(StringPiece path, | 192 void AddToCache(StringPiece path, |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 | 364 |
365 // Will terminate when the last consumer completes. | 365 // Will terminate when the last consumer completes. |
366 base::RunLoop().Run(); | 366 base::RunLoop().Run(); |
367 | 367 |
368 for (const auto& consumer : consumers) | 368 for (const auto& consumer : consumers) |
369 CheckResponse(*consumer.get(), "HTTP/1.1 200", kResponseBody); | 369 CheckResponse(*consumer.get(), "HTTP/1.1 200", kResponseBody); |
370 } | 370 } |
371 | 371 |
372 } // namespace test | 372 } // namespace test |
373 } // namespace net | 373 } // namespace net |
OLD | NEW |