Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Side by Side Diff: net/quic/quic_end_to_end_unittest.cc

Issue 330333006: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix linus_tsan error - reverted the change to ConnectionMigrationClientPortChanged unitttest Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_dispatcher.cc ('k') | net/quic/quic_framer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/test_completion_callback.h" 10 #include "net/base/test_completion_callback.h"
11 #include "net/base/upload_bytes_element_reader.h" 11 #include "net/base/upload_bytes_element_reader.h"
12 #include "net/base/upload_data_stream.h" 12 #include "net/base/upload_data_stream.h"
13 #include "net/cert/mock_cert_verifier.h" 13 #include "net/cert/mock_cert_verifier.h"
14 #include "net/dns/mapped_host_resolver.h" 14 #include "net/dns/mapped_host_resolver.h"
15 #include "net/dns/mock_host_resolver.h" 15 #include "net/dns/mock_host_resolver.h"
16 #include "net/http/http_auth_handler_factory.h" 16 #include "net/http/http_auth_handler_factory.h"
17 #include "net/http/http_network_session.h" 17 #include "net/http/http_network_session.h"
18 #include "net/http/http_network_transaction.h" 18 #include "net/http/http_network_transaction.h"
19 #include "net/http/http_server_properties_impl.h" 19 #include "net/http/http_server_properties_impl.h"
20 #include "net/http/http_transaction_test_util.h" 20 #include "net/http/http_transaction_test_util.h"
21 #include "net/http/transport_security_state.h" 21 #include "net/http/transport_security_state.h"
22 #include "net/proxy/proxy_service.h" 22 #include "net/proxy/proxy_service.h"
23 #include "net/quic/test_tools/quic_test_utils.h" 23 #include "net/quic/test_tools/quic_test_utils.h"
24 #include "net/ssl/ssl_config_service_defaults.h" 24 #include "net/ssl/ssl_config_service_defaults.h"
25 #include "net/tools/quic/quic_in_memory_cache.h" 25 #include "net/tools/quic/quic_in_memory_cache.h"
26 #include "net/tools/quic/quic_server.h"
26 #include "net/tools/quic/test_tools/quic_in_memory_cache_peer.h" 27 #include "net/tools/quic/test_tools/quic_in_memory_cache_peer.h"
27 #include "net/tools/quic/test_tools/server_thread.h" 28 #include "net/tools/quic/test_tools/server_thread.h"
28 #include "testing/gtest/include/gtest/gtest.h" 29 #include "testing/gtest/include/gtest/gtest.h"
29 #include "testing/platform_test.h" 30 #include "testing/platform_test.h"
30 31
31 using base::StringPiece; 32 using base::StringPiece;
32 using net::tools::QuicInMemoryCache; 33 using net::tools::QuicInMemoryCache;
34 using net::tools::QuicServer;
33 using net::tools::test::QuicInMemoryCachePeer; 35 using net::tools::test::QuicInMemoryCachePeer;
34 using net::tools::test::ServerThread; 36 using net::tools::test::ServerThread;
35 37
36 namespace net { 38 namespace net {
37 namespace test { 39 namespace test {
38 40
39 namespace { 41 namespace {
40 42
41 const char kResponseBody[] = "some arbitrary response body"; 43 const char kResponseBody[] = "some arbitrary response body";
42 44
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 StopServer(); 128 StopServer();
127 QuicInMemoryCachePeer::ResetForTests(); 129 QuicInMemoryCachePeer::ResetForTests();
128 } 130 }
129 131
130 // Starts the QUIC server listening on a random port. 132 // Starts the QUIC server listening on a random port.
131 void StartServer() { 133 void StartServer() {
132 net::IPAddressNumber ip; 134 net::IPAddressNumber ip;
133 CHECK(net::ParseIPLiteralToNumber("127.0.0.1", &ip)); 135 CHECK(net::ParseIPLiteralToNumber("127.0.0.1", &ip));
134 server_address_ = IPEndPoint(ip, 0); 136 server_address_ = IPEndPoint(ip, 0);
135 server_config_.SetDefaults(); 137 server_config_.SetDefaults();
136 server_thread_.reset(new ServerThread(server_address_, server_config_, 138 server_config_.SetInitialFlowControlWindowToSend(
137 QuicSupportedVersions(), 139 kInitialFlowControlWindowForTest);
138 strike_register_no_startup_period_, 140 server_thread_.reset(new ServerThread(
139 kInitialFlowControlWindowForTest)); 141 new QuicServer(server_config_, QuicSupportedVersions()),
142 server_address_,
143 strike_register_no_startup_period_));
140 server_thread_->Initialize(); 144 server_thread_->Initialize();
141 server_address_ = IPEndPoint(server_address_.address(), 145 server_address_ = IPEndPoint(server_address_.address(),
142 server_thread_->GetPort()); 146 server_thread_->GetPort());
143 server_thread_->Start(); 147 server_thread_->Start();
144 server_started_ = true; 148 server_started_ = true;
145 } 149 }
146 150
147 // Stops the QUIC server. 151 // Stops the QUIC server.
148 void StopServer() { 152 void StopServer() {
149 if (!server_started_) { 153 if (!server_started_) {
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 base::MessageLoop::current()->Run(); 302 base::MessageLoop::current()->Run();
299 303
300 for (size_t i = 0; i < num_requests; ++i) { 304 for (size_t i = 0; i < num_requests; ++i) {
301 CheckResponse(*consumers[i], "HTTP/1.1 200 OK", kResponseBody); 305 CheckResponse(*consumers[i], "HTTP/1.1 200 OK", kResponseBody);
302 } 306 }
303 STLDeleteElements(&consumers); 307 STLDeleteElements(&consumers);
304 } 308 }
305 309
306 } // namespace test 310 } // namespace test
307 } // namespace net 311 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_dispatcher.cc ('k') | net/quic/quic_framer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698