| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 virtual void TearDown() { | 126 virtual void TearDown() { |
| 127 StopServer(); | 127 StopServer(); |
| 128 QuicInMemoryCachePeer::ResetForTests(); | 128 QuicInMemoryCachePeer::ResetForTests(); |
| 129 } | 129 } |
| 130 | 130 |
| 131 // Starts the QUIC server listening on a random port. | 131 // Starts the QUIC server listening on a random port. |
| 132 void StartServer() { | 132 void StartServer() { |
| 133 net::IPAddressNumber ip; | 133 net::IPAddressNumber ip; |
| 134 CHECK(net::ParseIPLiteralToNumber("127.0.0.1", &ip)); | 134 CHECK(net::ParseIPLiteralToNumber("127.0.0.1", &ip)); |
| 135 server_address_ = IPEndPoint(ip, 0); | 135 server_address_ = IPEndPoint(ip, 0); |
| 136 server_config_.SetDefaults(); | |
| 137 server_config_.SetInitialFlowControlWindowToSend( | 136 server_config_.SetInitialFlowControlWindowToSend( |
| 138 kInitialSessionFlowControlWindowForTest); | 137 kInitialSessionFlowControlWindowForTest); |
| 139 server_config_.SetInitialStreamFlowControlWindowToSend( | 138 server_config_.SetInitialStreamFlowControlWindowToSend( |
| 140 kInitialStreamFlowControlWindowForTest); | 139 kInitialStreamFlowControlWindowForTest); |
| 141 server_config_.SetInitialSessionFlowControlWindowToSend( | 140 server_config_.SetInitialSessionFlowControlWindowToSend( |
| 142 kInitialSessionFlowControlWindowForTest); | 141 kInitialSessionFlowControlWindowForTest); |
| 143 server_thread_.reset(new ServerThread( | 142 server_thread_.reset(new ServerThread( |
| 144 new QuicServer(server_config_, QuicSupportedVersions()), | 143 new QuicServer(server_config_, QuicSupportedVersions()), |
| 145 server_address_, | 144 server_address_, |
| 146 strike_register_no_startup_period_)); | 145 strike_register_no_startup_period_)); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 base::MessageLoop::current()->Run(); | 305 base::MessageLoop::current()->Run(); |
| 307 | 306 |
| 308 for (size_t i = 0; i < num_requests; ++i) { | 307 for (size_t i = 0; i < num_requests; ++i) { |
| 309 CheckResponse(*consumers[i], "HTTP/1.1 200 OK", kResponseBody); | 308 CheckResponse(*consumers[i], "HTTP/1.1 200 OK", kResponseBody); |
| 310 } | 309 } |
| 311 STLDeleteElements(&consumers); | 310 STLDeleteElements(&consumers); |
| 312 } | 311 } |
| 313 | 312 |
| 314 } // namespace test | 313 } // namespace test |
| 315 } // namespace net | 314 } // namespace net |
| OLD | NEW |