OLD | NEW |
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 "net/tools/quic/test_tools/quic_test_utils.h" | 5 #include "net/tools/quic/test_tools/quic_test_utils.h" |
6 | 6 |
7 #include "net/quic/quic_connection.h" | 7 #include "net/quic/quic_connection.h" |
8 #include "net/quic/test_tools/quic_connection_peer.h" | 8 #include "net/quic/test_tools/quic_connection_peer.h" |
9 #include "net/quic/test_tools/quic_test_utils.h" | 9 #include "net/quic/test_tools/quic_test_utils.h" |
10 #include "net/tools/epoll_server/epoll_server.h" | 10 #include "net/tools/epoll_server/epoll_server.h" |
11 #include "net/tools/quic/quic_epoll_connection_helper.h" | 11 #include "net/tools/quic/quic_epoll_connection_helper.h" |
12 | 12 |
13 using base::StringPiece; | 13 using base::StringPiece; |
14 using net::test::MakeAckFrame; | 14 using net::test::MakeAckFrame; |
15 using net::test::MockHelper; | 15 using net::test::MockHelper; |
16 using net::test::QuicConnectionPeer; | 16 using net::test::QuicConnectionPeer; |
| 17 using testing::_; |
| 18 using testing::AnyNumber; |
| 19 using testing::Invoke; |
17 | 20 |
18 namespace net { | 21 namespace net { |
19 namespace tools { | 22 namespace tools { |
20 namespace test { | 23 namespace test { |
21 | 24 |
22 using testing::_; | |
23 using testing::AnyNumber; | |
24 using testing::Invoke; | |
25 | |
26 QuicAckFrame MakeAckFrameWithNackRanges( | 25 QuicAckFrame MakeAckFrameWithNackRanges( |
27 size_t num_nack_ranges, QuicPacketSequenceNumber least_unacked) { | 26 size_t num_nack_ranges, QuicPacketSequenceNumber least_unacked) { |
28 QuicAckFrame ack = MakeAckFrame(2 * num_nack_ranges + least_unacked); | 27 QuicAckFrame ack = MakeAckFrame(2 * num_nack_ranges + least_unacked); |
29 // Add enough missing packets to get num_nack_ranges nack ranges. | 28 // Add enough missing packets to get num_nack_ranges nack ranges. |
30 for (QuicPacketSequenceNumber i = 1; i < 2 * num_nack_ranges; i += 2) { | 29 for (QuicPacketSequenceNumber i = 1; i < 2 * num_nack_ranges; i += 2) { |
31 ack.missing_packets.insert(least_unacked + i); | 30 ack.missing_packets.insert(least_unacked + i); |
32 } | 31 } |
33 return ack; | 32 return ack; |
34 } | 33 } |
35 | 34 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 &MockTimeWaitListManager:: | 130 &MockTimeWaitListManager:: |
132 QuicTimeWaitListManager_AddConnectionIdToTimeWait)); | 131 QuicTimeWaitListManager_AddConnectionIdToTimeWait)); |
133 } | 132 } |
134 | 133 |
135 MockTimeWaitListManager::~MockTimeWaitListManager() { | 134 MockTimeWaitListManager::~MockTimeWaitListManager() { |
136 } | 135 } |
137 | 136 |
138 } // namespace test | 137 } // namespace test |
139 } // namespace tools | 138 } // namespace tools |
140 } // namespace net | 139 } // namespace net |
OLD | NEW |