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 "net/tools/quic/quic_time_wait_list_manager.h" | 5 #include "net/tools/quic/quic_time_wait_list_manager.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 | 8 |
9 #include "net/quic/crypto/crypto_protocol.h" | 9 #include "net/quic/crypto/crypto_protocol.h" |
10 #include "net/quic/crypto/null_encrypter.h" | 10 #include "net/quic/crypto/null_encrypter.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 public: | 90 public: |
91 MOCK_METHOD2(RegisterAlarm, void(int64 timeout_in_us, | 91 MOCK_METHOD2(RegisterAlarm, void(int64 timeout_in_us, |
92 EpollAlarmCallbackInterface* alarm)); | 92 EpollAlarmCallbackInterface* alarm)); |
93 }; | 93 }; |
94 | 94 |
95 class QuicTimeWaitListManagerTest : public ::testing::Test { | 95 class QuicTimeWaitListManagerTest : public ::testing::Test { |
96 protected: | 96 protected: |
97 QuicTimeWaitListManagerTest() | 97 QuicTimeWaitListManagerTest() |
98 : helper_(&epoll_server_), | 98 : helper_(&epoll_server_), |
99 time_wait_list_manager_(&writer_, &visitor_, &helper_), | 99 time_wait_list_manager_(&writer_, &visitor_, &helper_), |
100 framer_(QuicSupportedVersions(), | |
101 QuicTime::Zero(), | |
102 Perspective::IS_SERVER), | |
103 connection_id_(45), | 100 connection_id_(45), |
104 client_address_(net::test::TestPeerIPAddress(), kTestPort), | 101 client_address_(net::test::TestPeerIPAddress(), kTestPort), |
105 writer_is_blocked_(false) {} | 102 writer_is_blocked_(false) {} |
106 | 103 |
107 ~QuicTimeWaitListManagerTest() override {} | 104 ~QuicTimeWaitListManagerTest() override {} |
108 | 105 |
109 void SetUp() override { | 106 void SetUp() override { |
110 EXPECT_CALL(writer_, IsWriteBlocked()) | 107 EXPECT_CALL(writer_, IsWriteBlocked()) |
111 .WillRepeatedly(ReturnPointee(&writer_is_blocked_)); | 108 .WillRepeatedly(ReturnPointee(&writer_is_blocked_)); |
112 EXPECT_CALL(writer_, IsWriteBlockedDataBuffered()) | 109 EXPECT_CALL(writer_, IsWriteBlockedDataBuffered()) |
113 .WillRepeatedly(Return(false)); | 110 .WillRepeatedly(Return(false)); |
114 } | 111 } |
115 | 112 |
116 void AddConnectionId(QuicConnectionId connection_id) { | 113 void AddConnectionId(QuicConnectionId connection_id) { |
117 AddConnectionId(connection_id, QuicVersionMax(), | 114 AddConnectionId(connection_id, QuicVersionMax(), |
118 /*connection_rejected_statelessly=*/false, nullptr); | 115 /*connection_rejected_statelessly=*/false, nullptr); |
119 } | 116 } |
120 | 117 |
121 void AddStatelessConnectionId(QuicConnectionId connection_id) { | 118 void AddStatelessConnectionId(QuicConnectionId connection_id) { |
| 119 std::vector<QuicEncryptedPacket*> termination_packets; |
| 120 termination_packets.push_back(new QuicEncryptedPacket(nullptr, 0, false)); |
122 time_wait_list_manager_.AddConnectionIdToTimeWait( | 121 time_wait_list_manager_.AddConnectionIdToTimeWait( |
123 connection_id, QuicVersionMax(), | 122 connection_id, QuicVersionMax(), |
124 /*connection_rejected_statelessly=*/true, nullptr); | 123 /*connection_rejected_statelessly=*/true, &termination_packets); |
125 } | 124 } |
126 | 125 |
127 void AddConnectionId(QuicConnectionId connection_id, | 126 void AddConnectionId(QuicConnectionId connection_id, |
128 QuicVersion version, | 127 QuicVersion version, |
129 bool connection_rejected_statelessly, | 128 bool connection_rejected_statelessly, |
130 QuicEncryptedPacket* packet) { | 129 std::vector<QuicEncryptedPacket*>* packets) { |
131 time_wait_list_manager_.AddConnectionIdToTimeWait( | 130 time_wait_list_manager_.AddConnectionIdToTimeWait( |
132 connection_id, version, connection_rejected_statelessly, packet); | 131 connection_id, version, connection_rejected_statelessly, packets); |
133 } | 132 } |
134 | 133 |
135 bool IsConnectionIdInTimeWait(QuicConnectionId connection_id) { | 134 bool IsConnectionIdInTimeWait(QuicConnectionId connection_id) { |
136 return time_wait_list_manager_.IsConnectionIdInTimeWait(connection_id); | 135 return time_wait_list_manager_.IsConnectionIdInTimeWait(connection_id); |
137 } | 136 } |
138 | 137 |
139 void ProcessPacket(QuicConnectionId connection_id, | 138 void ProcessPacket(QuicConnectionId connection_id, |
140 QuicPacketNumber packet_number) { | 139 QuicPacketNumber packet_number) { |
141 QuicEncryptedPacket packet(nullptr, 0); | 140 QuicEncryptedPacket packet(nullptr, 0); |
142 time_wait_list_manager_.ProcessPacket(server_address_, client_address_, | 141 time_wait_list_manager_.ProcessPacket(server_address_, client_address_, |
143 connection_id, packet_number, packet); | 142 connection_id, packet_number, packet); |
144 } | 143 } |
145 | 144 |
146 QuicEncryptedPacket* ConstructEncryptedPacket( | 145 QuicEncryptedPacket* ConstructEncryptedPacket( |
147 EncryptionLevel level, | |
148 QuicConnectionId connection_id, | 146 QuicConnectionId connection_id, |
149 QuicPacketNumber packet_number) { | 147 QuicPacketNumber packet_number) { |
150 QuicPacketHeader header; | 148 return net::test::ConstructEncryptedPacket(connection_id, false, false, |
151 header.public_header.connection_id = connection_id; | 149 packet_number, "data"); |
152 header.public_header.connection_id_length = PACKET_8BYTE_CONNECTION_ID; | |
153 header.public_header.version_flag = false; | |
154 header.public_header.reset_flag = false; | |
155 header.public_header.packet_number_length = PACKET_6BYTE_PACKET_NUMBER; | |
156 header.packet_number = packet_number; | |
157 header.entropy_flag = false; | |
158 header.entropy_hash = 0; | |
159 header.fec_flag = false; | |
160 header.is_in_fec_group = NOT_IN_FEC_GROUP; | |
161 header.fec_group = 0; | |
162 QuicStreamFrame stream_frame(1, false, 0, StringPiece("data")); | |
163 QuicFrame frame(&stream_frame); | |
164 QuicFrames frames; | |
165 frames.push_back(frame); | |
166 scoped_ptr<QuicPacket> packet( | |
167 BuildUnsizedDataPacket(&framer_, header, frames)); | |
168 EXPECT_TRUE(packet != nullptr); | |
169 char buffer[kMaxPacketSize]; | |
170 scoped_ptr<QuicEncryptedPacket> encrypted(framer_.EncryptPayload( | |
171 ENCRYPTION_NONE, packet_number, *packet, buffer, kMaxPacketSize)); | |
172 EXPECT_TRUE(encrypted != nullptr); | |
173 return encrypted->Clone(); | |
174 } | 150 } |
175 | 151 |
176 NiceMock<MockFakeTimeEpollServer> epoll_server_; | 152 NiceMock<MockFakeTimeEpollServer> epoll_server_; |
177 QuicEpollConnectionHelper helper_; | 153 QuicEpollConnectionHelper helper_; |
178 StrictMock<MockPacketWriter> writer_; | 154 StrictMock<MockPacketWriter> writer_; |
179 StrictMock<MockQuicServerSessionVisitor> visitor_; | 155 StrictMock<MockQuicServerSessionVisitor> visitor_; |
180 QuicTimeWaitListManager time_wait_list_manager_; | 156 QuicTimeWaitListManager time_wait_list_manager_; |
181 QuicFramer framer_; | |
182 QuicConnectionId connection_id_; | 157 QuicConnectionId connection_id_; |
183 IPEndPoint server_address_; | 158 IPEndPoint server_address_; |
184 IPEndPoint client_address_; | 159 IPEndPoint client_address_; |
185 bool writer_is_blocked_; | 160 bool writer_is_blocked_; |
186 }; | 161 }; |
187 | 162 |
188 class ValidatePublicResetPacketPredicate | 163 class ValidatePublicResetPacketPredicate |
189 : public MatcherInterface<const std::tr1::tuple<const char*, int> > { | 164 : public MatcherInterface<const std::tr1::tuple<const char*, int> > { |
190 public: | 165 public: |
191 explicit ValidatePublicResetPacketPredicate(QuicConnectionId connection_id, | 166 explicit ValidatePublicResetPacketPredicate(QuicConnectionId connection_id, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 EXPECT_FALSE(IsConnectionIdInTimeWait(connection_id_)); | 214 EXPECT_FALSE(IsConnectionIdInTimeWait(connection_id_)); |
240 EXPECT_CALL(visitor_, OnConnectionAddedToTimeWaitList(connection_id_)); | 215 EXPECT_CALL(visitor_, OnConnectionAddedToTimeWaitList(connection_id_)); |
241 AddStatelessConnectionId(connection_id_); | 216 AddStatelessConnectionId(connection_id_); |
242 EXPECT_EQ(1u, time_wait_list_manager_.num_connections()); | 217 EXPECT_EQ(1u, time_wait_list_manager_.num_connections()); |
243 EXPECT_TRUE(IsConnectionIdInTimeWait(connection_id_)); | 218 EXPECT_TRUE(IsConnectionIdInTimeWait(connection_id_)); |
244 } | 219 } |
245 | 220 |
246 TEST_F(QuicTimeWaitListManagerTest, SendConnectionClose) { | 221 TEST_F(QuicTimeWaitListManagerTest, SendConnectionClose) { |
247 const size_t kConnectionCloseLength = 100; | 222 const size_t kConnectionCloseLength = 100; |
248 EXPECT_CALL(visitor_, OnConnectionAddedToTimeWaitList(connection_id_)); | 223 EXPECT_CALL(visitor_, OnConnectionAddedToTimeWaitList(connection_id_)); |
| 224 std::vector<QuicEncryptedPacket*> termination_packets; |
| 225 termination_packets.push_back(new QuicEncryptedPacket( |
| 226 new char[kConnectionCloseLength], kConnectionCloseLength, true)); |
249 AddConnectionId(connection_id_, QuicVersionMax(), | 227 AddConnectionId(connection_id_, QuicVersionMax(), |
250 /*connection_rejected_statelessly=*/false, | 228 /*connection_rejected_statelessly=*/false, |
251 new QuicEncryptedPacket(new char[kConnectionCloseLength], | 229 &termination_packets); |
252 kConnectionCloseLength, true)); | |
253 const int kRandomSequenceNumber = 1; | 230 const int kRandomSequenceNumber = 1; |
254 EXPECT_CALL(writer_, WritePacket(_, kConnectionCloseLength, | 231 EXPECT_CALL(writer_, WritePacket(_, kConnectionCloseLength, |
255 server_address_.address(), | 232 server_address_.address(), |
256 client_address_)) | 233 client_address_)) |
257 .WillOnce(Return(WriteResult(WRITE_STATUS_OK, 1))); | 234 .WillOnce(Return(WriteResult(WRITE_STATUS_OK, 1))); |
258 | 235 |
259 ProcessPacket(connection_id_, kRandomSequenceNumber); | 236 ProcessPacket(connection_id_, kRandomSequenceNumber); |
260 } | 237 } |
261 | 238 |
| 239 TEST_F(QuicTimeWaitListManagerTest, SendTwoConnectionCloses) { |
| 240 const size_t kConnectionCloseLength = 100; |
| 241 EXPECT_CALL(visitor_, OnConnectionAddedToTimeWaitList(connection_id_)); |
| 242 std::vector<QuicEncryptedPacket*> termination_packets; |
| 243 termination_packets.push_back(new QuicEncryptedPacket( |
| 244 new char[kConnectionCloseLength], kConnectionCloseLength, true)); |
| 245 termination_packets.push_back(new QuicEncryptedPacket( |
| 246 new char[kConnectionCloseLength], kConnectionCloseLength, true)); |
| 247 AddConnectionId(connection_id_, QuicVersionMax(), |
| 248 /*connection_rejected_statelessly=*/false, |
| 249 &termination_packets); |
| 250 const int kRandomSequenceNumber = 1; |
| 251 EXPECT_CALL(writer_, WritePacket(_, kConnectionCloseLength, |
| 252 server_address_.address(), client_address_)) |
| 253 .Times(2) |
| 254 .WillRepeatedly(Return(WriteResult(WRITE_STATUS_OK, 1))); |
| 255 |
| 256 ProcessPacket(connection_id_, kRandomSequenceNumber); |
| 257 } |
| 258 |
262 TEST_F(QuicTimeWaitListManagerTest, SendPublicReset) { | 259 TEST_F(QuicTimeWaitListManagerTest, SendPublicReset) { |
263 EXPECT_CALL(visitor_, OnConnectionAddedToTimeWaitList(connection_id_)); | 260 EXPECT_CALL(visitor_, OnConnectionAddedToTimeWaitList(connection_id_)); |
264 AddConnectionId(connection_id_); | 261 AddConnectionId(connection_id_); |
265 const int kRandomSequenceNumber = 1; | 262 const int kRandomSequenceNumber = 1; |
266 EXPECT_CALL(writer_, WritePacket(_, _, | 263 EXPECT_CALL(writer_, WritePacket(_, _, |
267 server_address_.address(), | 264 server_address_.address(), |
268 client_address_)) | 265 client_address_)) |
269 .With(Args<0, 1>(PublicResetPacketEq(connection_id_, | 266 .With(Args<0, 1>(PublicResetPacketEq(connection_id_, |
270 kRandomSequenceNumber))) | 267 kRandomSequenceNumber))) |
271 .WillOnce(Return(WriteResult(WRITE_STATUS_OK, 0))); | 268 .WillOnce(Return(WriteResult(WRITE_STATUS_OK, 0))); |
(...skipping 19 matching lines...) Expand all Loading... |
291 EXPECT_FALSE(QuicTimeWaitListManagerPeer::ShouldSendResponse( | 288 EXPECT_FALSE(QuicTimeWaitListManagerPeer::ShouldSendResponse( |
292 &time_wait_list_manager_, packet_number)); | 289 &time_wait_list_manager_, packet_number)); |
293 } | 290 } |
294 } | 291 } |
295 } | 292 } |
296 | 293 |
297 TEST_F(QuicTimeWaitListManagerTest, NoPublicResetForStatelessConnections) { | 294 TEST_F(QuicTimeWaitListManagerTest, NoPublicResetForStatelessConnections) { |
298 EXPECT_CALL(visitor_, OnConnectionAddedToTimeWaitList(connection_id_)); | 295 EXPECT_CALL(visitor_, OnConnectionAddedToTimeWaitList(connection_id_)); |
299 AddStatelessConnectionId(connection_id_); | 296 AddStatelessConnectionId(connection_id_); |
300 const int kRandomSequenceNumber = 1; | 297 const int kRandomSequenceNumber = 1; |
| 298 |
| 299 EXPECT_CALL(writer_, |
| 300 WritePacket(_, _, server_address_.address(), client_address_)) |
| 301 .WillOnce(Return(WriteResult(WRITE_STATUS_OK, 1))); |
| 302 |
301 ProcessPacket(connection_id_, kRandomSequenceNumber); | 303 ProcessPacket(connection_id_, kRandomSequenceNumber); |
302 } | 304 } |
303 | 305 |
304 TEST_F(QuicTimeWaitListManagerTest, CleanUpOldConnectionIds) { | 306 TEST_F(QuicTimeWaitListManagerTest, CleanUpOldConnectionIds) { |
305 const size_t kConnectionIdCount = 100; | 307 const size_t kConnectionIdCount = 100; |
306 const size_t kOldConnectionIdCount = 31; | 308 const size_t kOldConnectionIdCount = 31; |
307 | 309 |
308 // Add connection_ids such that their expiry time is time_wait_period_. | 310 // Add connection_ids such that their expiry time is time_wait_period_. |
309 epoll_server_.set_now_in_usec(0); | 311 epoll_server_.set_now_in_usec(0); |
310 for (size_t connection_id = 1; connection_id <= kOldConnectionIdCount; | 312 for (size_t connection_id = 1; connection_id <= kOldConnectionIdCount; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 EXPECT_EQ(kConnectionIdCount - kOldConnectionIdCount, | 354 EXPECT_EQ(kConnectionIdCount - kOldConnectionIdCount, |
353 time_wait_list_manager_.num_connections()); | 355 time_wait_list_manager_.num_connections()); |
354 } | 356 } |
355 | 357 |
356 TEST_F(QuicTimeWaitListManagerTest, SendQueuedPackets) { | 358 TEST_F(QuicTimeWaitListManagerTest, SendQueuedPackets) { |
357 QuicConnectionId connection_id = 1; | 359 QuicConnectionId connection_id = 1; |
358 EXPECT_CALL(visitor_, OnConnectionAddedToTimeWaitList(connection_id)); | 360 EXPECT_CALL(visitor_, OnConnectionAddedToTimeWaitList(connection_id)); |
359 AddConnectionId(connection_id); | 361 AddConnectionId(connection_id); |
360 QuicPacketNumber packet_number = 234; | 362 QuicPacketNumber packet_number = 234; |
361 scoped_ptr<QuicEncryptedPacket> packet( | 363 scoped_ptr<QuicEncryptedPacket> packet( |
362 ConstructEncryptedPacket(ENCRYPTION_NONE, connection_id, packet_number)); | 364 ConstructEncryptedPacket(connection_id, packet_number)); |
363 // Let first write through. | 365 // Let first write through. |
364 EXPECT_CALL(writer_, | 366 EXPECT_CALL(writer_, |
365 WritePacket(_, _, server_address_.address(), client_address_)) | 367 WritePacket(_, _, server_address_.address(), client_address_)) |
366 .With(Args<0, 1>(PublicResetPacketEq(connection_id, packet_number))) | 368 .With(Args<0, 1>(PublicResetPacketEq(connection_id, packet_number))) |
367 .WillOnce(Return(WriteResult(WRITE_STATUS_OK, packet->length()))); | 369 .WillOnce(Return(WriteResult(WRITE_STATUS_OK, packet->length()))); |
368 ProcessPacket(connection_id, packet_number); | 370 ProcessPacket(connection_id, packet_number); |
369 | 371 |
370 // write block for the next packet. | 372 // write block for the next packet. |
371 EXPECT_CALL(writer_, | 373 EXPECT_CALL(writer_, |
372 WritePacket(_, _, server_address_.address(), client_address_)) | 374 WritePacket(_, _, server_address_.address(), client_address_)) |
373 .With(Args<0, 1>(PublicResetPacketEq(connection_id, packet_number))) | 375 .With(Args<0, 1>(PublicResetPacketEq(connection_id, packet_number))) |
374 .WillOnce(DoAll(Assign(&writer_is_blocked_, true), | 376 .WillOnce(DoAll(Assign(&writer_is_blocked_, true), |
375 Return(WriteResult(WRITE_STATUS_BLOCKED, EAGAIN)))); | 377 Return(WriteResult(WRITE_STATUS_BLOCKED, EAGAIN)))); |
376 EXPECT_CALL(visitor_, OnWriteBlocked(&time_wait_list_manager_)); | 378 EXPECT_CALL(visitor_, OnWriteBlocked(&time_wait_list_manager_)); |
377 ProcessPacket(connection_id, packet_number); | 379 ProcessPacket(connection_id, packet_number); |
378 // 3rd packet. No public reset should be sent; | 380 // 3rd packet. No public reset should be sent; |
379 ProcessPacket(connection_id, packet_number); | 381 ProcessPacket(connection_id, packet_number); |
380 | 382 |
381 // write packet should not be called since we are write blocked but the | 383 // write packet should not be called since we are write blocked but the |
382 // should be queued. | 384 // should be queued. |
383 QuicConnectionId other_connection_id = 2; | 385 QuicConnectionId other_connection_id = 2; |
384 EXPECT_CALL(visitor_, OnConnectionAddedToTimeWaitList(other_connection_id)); | 386 EXPECT_CALL(visitor_, OnConnectionAddedToTimeWaitList(other_connection_id)); |
385 AddConnectionId(other_connection_id); | 387 AddConnectionId(other_connection_id); |
386 QuicPacketNumber other_packet_number = 23423; | 388 QuicPacketNumber other_packet_number = 23423; |
387 scoped_ptr<QuicEncryptedPacket> other_packet(ConstructEncryptedPacket( | 389 scoped_ptr<QuicEncryptedPacket> other_packet( |
388 ENCRYPTION_NONE, other_connection_id, other_packet_number)); | 390 ConstructEncryptedPacket(other_connection_id, other_packet_number)); |
389 EXPECT_CALL(writer_, WritePacket(_, _, _, _)) | 391 EXPECT_CALL(writer_, WritePacket(_, _, _, _)) |
390 .Times(0); | 392 .Times(0); |
391 EXPECT_CALL(visitor_, OnWriteBlocked(&time_wait_list_manager_)); | 393 EXPECT_CALL(visitor_, OnWriteBlocked(&time_wait_list_manager_)); |
392 ProcessPacket(other_connection_id, other_packet_number); | 394 ProcessPacket(other_connection_id, other_packet_number); |
393 EXPECT_EQ(2u, time_wait_list_manager_.num_connections()); | 395 EXPECT_EQ(2u, time_wait_list_manager_.num_connections()); |
394 | 396 |
395 // Now expect all the write blocked public reset packets to be sent again. | 397 // Now expect all the write blocked public reset packets to be sent again. |
396 writer_is_blocked_ = false; | 398 writer_is_blocked_ = false; |
397 EXPECT_CALL(writer_, | 399 EXPECT_CALL(writer_, |
398 WritePacket(_, _, server_address_.address(), client_address_)) | 400 WritePacket(_, _, server_address_.address(), client_address_)) |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 &time_wait_list_manager_, kConnectionId3)); | 434 &time_wait_list_manager_, kConnectionId3)); |
433 } | 435 } |
434 | 436 |
435 TEST_F(QuicTimeWaitListManagerTest, AddConnectionIdTwice) { | 437 TEST_F(QuicTimeWaitListManagerTest, AddConnectionIdTwice) { |
436 // Add connection_ids such that their expiry time is time_wait_period_. | 438 // Add connection_ids such that their expiry time is time_wait_period_. |
437 epoll_server_.set_now_in_usec(0); | 439 epoll_server_.set_now_in_usec(0); |
438 EXPECT_CALL(visitor_, OnConnectionAddedToTimeWaitList(connection_id_)); | 440 EXPECT_CALL(visitor_, OnConnectionAddedToTimeWaitList(connection_id_)); |
439 AddConnectionId(connection_id_); | 441 AddConnectionId(connection_id_); |
440 EXPECT_TRUE(IsConnectionIdInTimeWait(connection_id_)); | 442 EXPECT_TRUE(IsConnectionIdInTimeWait(connection_id_)); |
441 const size_t kConnectionCloseLength = 100; | 443 const size_t kConnectionCloseLength = 100; |
| 444 std::vector<QuicEncryptedPacket*> termination_packets; |
| 445 termination_packets.push_back(new QuicEncryptedPacket( |
| 446 new char[kConnectionCloseLength], kConnectionCloseLength, true)); |
442 AddConnectionId(connection_id_, QuicVersionMax(), | 447 AddConnectionId(connection_id_, QuicVersionMax(), |
443 /*connection_rejected_statelessly=*/false, | 448 /*connection_rejected_statelessly=*/false, |
444 new QuicEncryptedPacket(new char[kConnectionCloseLength], | 449 &termination_packets); |
445 kConnectionCloseLength, true)); | |
446 EXPECT_TRUE(IsConnectionIdInTimeWait(connection_id_)); | 450 EXPECT_TRUE(IsConnectionIdInTimeWait(connection_id_)); |
447 EXPECT_EQ(1u, time_wait_list_manager_.num_connections()); | 451 EXPECT_EQ(1u, time_wait_list_manager_.num_connections()); |
448 | 452 |
449 EXPECT_CALL(writer_, WritePacket(_, | 453 EXPECT_CALL(writer_, WritePacket(_, |
450 kConnectionCloseLength, | 454 kConnectionCloseLength, |
451 server_address_.address(), | 455 server_address_.address(), |
452 client_address_)) | 456 client_address_)) |
453 .WillOnce(Return(WriteResult(WRITE_STATUS_OK, 1))); | 457 .WillOnce(Return(WriteResult(WRITE_STATUS_OK, 1))); |
454 | 458 |
455 const int kRandomSequenceNumber = 1; | 459 const int kRandomSequenceNumber = 1; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 time_wait_list_manager_.num_connections()); | 541 time_wait_list_manager_.num_connections()); |
538 EXPECT_FALSE(IsConnectionIdInTimeWait(id_to_evict)); | 542 EXPECT_FALSE(IsConnectionIdInTimeWait(id_to_evict)); |
539 EXPECT_TRUE(IsConnectionIdInTimeWait(current_connection_id)); | 543 EXPECT_TRUE(IsConnectionIdInTimeWait(current_connection_id)); |
540 } | 544 } |
541 } | 545 } |
542 | 546 |
543 } // namespace | 547 } // namespace |
544 } // namespace test | 548 } // namespace test |
545 } // namespace tools | 549 } // namespace tools |
546 } // namespace net | 550 } // namespace net |
OLD | NEW |