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

Side by Side Diff: net/tools/quic/end_to_end_test.cc

Issue 344053002: Refactoring QuicClient so it doesn't own the epoll server it uses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « no previous file | net/tools/quic/quic_client.h » ('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 (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 <string> 6 #include <string>
7 #include <sys/epoll.h> 7 #include <sys/epoll.h>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 1058
1059 ASSERT_TRUE(Initialize()); 1059 ASSERT_TRUE(Initialize());
1060 1060
1061 EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo")); 1061 EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo"));
1062 EXPECT_EQ(200u, client_->response_headers()->parsed_response_code()); 1062 EXPECT_EQ(200u, client_->response_headers()->parsed_response_code());
1063 1063
1064 // Store the client address which was used to send the first request. 1064 // Store the client address which was used to send the first request.
1065 IPEndPoint old_address = client_->client()->client_address(); 1065 IPEndPoint old_address = client_->client()->client_address();
1066 1066
1067 // Stop listening on the old FD. 1067 // Stop listening on the old FD.
1068 EpollServer* eps = client_->client()->epoll_server(); 1068 EpollServer* eps = client_->epoll_server();
1069 int old_fd = client_->client()->fd(); 1069 int old_fd = client_->client()->fd();
1070 eps->UnregisterFD(old_fd); 1070 eps->UnregisterFD(old_fd);
1071 // Create a new socket before closing the old one, which will result in a new 1071 // Create a new socket before closing the old one, which will result in a new
1072 // ephemeral port. 1072 // ephemeral port.
1073 QuicClientPeer::CreateUDPSocket(client_->client()); 1073 QuicClientPeer::CreateUDPSocket(client_->client());
1074 close(old_fd); 1074 close(old_fd);
1075 1075
1076 // The packet writer needs to be updated to use the new FD. 1076 // The packet writer needs to be updated to use the new FD.
1077 client_->client()->CreateQuicPacketWriter(); 1077 client_->client()->CreateQuicPacketWriter();
1078 1078
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 QuicSession* session = dispatcher->session_map().begin()->second; 1133 QuicSession* session = dispatcher->session_map().begin()->second;
1134 EXPECT_EQ(kClientIFCW, 1134 EXPECT_EQ(kClientIFCW,
1135 session->config()->ReceivedInitialFlowControlWindowBytes()); 1135 session->config()->ReceivedInitialFlowControlWindowBytes());
1136 server_thread_->Resume(); 1136 server_thread_->Resume();
1137 } 1137 }
1138 1138
1139 } // namespace 1139 } // namespace
1140 } // namespace test 1140 } // namespace test
1141 } // namespace tools 1141 } // namespace tools
1142 } // namespace net 1142 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/tools/quic/quic_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698