| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "net/base/elements_upload_data_stream.h" | 10 #include "net/base/elements_upload_data_stream.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // Starts the QUIC server listening on a random port. | 145 // Starts the QUIC server listening on a random port. |
| 146 void StartServer() { | 146 void StartServer() { |
| 147 IPAddressNumber ip; | 147 IPAddressNumber ip; |
| 148 CHECK(ParseIPLiteralToNumber("127.0.0.1", &ip)); | 148 CHECK(ParseIPLiteralToNumber("127.0.0.1", &ip)); |
| 149 server_address_ = IPEndPoint(ip, 0); | 149 server_address_ = IPEndPoint(ip, 0); |
| 150 server_config_.SetInitialStreamFlowControlWindowToSend( | 150 server_config_.SetInitialStreamFlowControlWindowToSend( |
| 151 kInitialStreamFlowControlWindowForTest); | 151 kInitialStreamFlowControlWindowForTest); |
| 152 server_config_.SetInitialSessionFlowControlWindowToSend( | 152 server_config_.SetInitialSessionFlowControlWindowToSend( |
| 153 kInitialSessionFlowControlWindowForTest); | 153 kInitialSessionFlowControlWindowForTest); |
| 154 QuicServer* server = | 154 QuicServer* server = |
| 155 new QuicServer(server_config_, QuicSupportedVersions()); | 155 new QuicServer(CryptoTestUtils::ProofSourceForTesting(), server_config_, |
| 156 server_thread_.reset(new ServerThread(server, /*is_secure=*/true, | 156 QuicSupportedVersions()); |
| 157 server_address_, | 157 server_thread_.reset(new ServerThread(server, server_address_, |
| 158 strike_register_no_startup_period_)); | 158 strike_register_no_startup_period_)); |
| 159 server->SetProofSource(CryptoTestUtils::ProofSourceForTesting()); | |
| 160 server_thread_->Initialize(); | 159 server_thread_->Initialize(); |
| 161 server_address_ = IPEndPoint(server_address_.address(), | 160 server_address_ = IPEndPoint(server_address_.address(), |
| 162 server_thread_->GetPort()); | 161 server_thread_->GetPort()); |
| 163 server_thread_->Start(); | 162 server_thread_->Start(); |
| 164 server_started_ = true; | 163 server_started_ = true; |
| 165 } | 164 } |
| 166 | 165 |
| 167 // Stops the QUIC server. | 166 // Stops the QUIC server. |
| 168 void StopServer() { | 167 void StopServer() { |
| 169 if (!server_started_) { | 168 if (!server_started_) { |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 base::MessageLoop::current()->Run(); | 314 base::MessageLoop::current()->Run(); |
| 316 | 315 |
| 317 for (size_t i = 0; i < num_requests; ++i) { | 316 for (size_t i = 0; i < num_requests; ++i) { |
| 318 CheckResponse(*consumers[i], "HTTP/1.1 200 OK", kResponseBody); | 317 CheckResponse(*consumers[i], "HTTP/1.1 200 OK", kResponseBody); |
| 319 } | 318 } |
| 320 STLDeleteElements(&consumers); | 319 STLDeleteElements(&consumers); |
| 321 } | 320 } |
| 322 | 321 |
| 323 } // namespace test | 322 } // namespace test |
| 324 } // namespace net | 323 } // namespace net |
| OLD | NEW |