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/quic/quic_protocol.h" | 5 #include "net/quic/quic_protocol.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "net/quic/quic_flags.h" | 10 #include "net/quic/quic_flags.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 } | 182 } |
183 | 183 |
184 TEST(QuicProtocolTest, AckFrameToString) { | 184 TEST(QuicProtocolTest, AckFrameToString) { |
185 QuicAckFrame frame; | 185 QuicAckFrame frame; |
186 frame.entropy_hash = 1; | 186 frame.entropy_hash = 1; |
187 frame.largest_observed = 2; | 187 frame.largest_observed = 2; |
188 frame.ack_delay_time = QuicTime::Delta::FromMicroseconds(3); | 188 frame.ack_delay_time = QuicTime::Delta::FromMicroseconds(3); |
189 frame.packets.Add(4); | 189 frame.packets.Add(4); |
190 frame.packets.Add(5); | 190 frame.packets.Add(5); |
191 frame.received_packet_times = { | 191 frame.received_packet_times = { |
192 {6, QuicTime::Zero().Add(QuicTime::Delta::FromMicroseconds(7))}}; | 192 {6, QuicTime::Zero() + QuicTime::Delta::FromMicroseconds(7)}}; |
193 std::ostringstream stream; | 193 std::ostringstream stream; |
194 stream << frame; | 194 stream << frame; |
195 EXPECT_EQ( | 195 EXPECT_EQ( |
196 "{ entropy_hash: 1, largest_observed: 2, ack_delay_time: 3, " | 196 "{ entropy_hash: 1, largest_observed: 2, ack_delay_time: 3, " |
197 "packets: [ 4 5 ], is_truncated: 0, received_packets: [ 6 at 7 ] }\n", | 197 "packets: [ 4 5 ], is_truncated: 0, received_packets: [ 6 at 7 ] }\n", |
198 stream.str()); | 198 stream.str()); |
199 } | 199 } |
200 | 200 |
201 TEST(QuicProtocolTest, PaddingFrameToString) { | 201 TEST(QuicProtocolTest, PaddingFrameToString) { |
202 QuicPaddingFrame frame; | 202 QuicPaddingFrame frame; |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 EXPECT_EQ(10u, queue.LastIntervalLength()); | 396 EXPECT_EQ(10u, queue.LastIntervalLength()); |
397 queue.Remove(9, 21); | 397 queue.Remove(9, 21); |
398 EXPECT_EQ(3u, queue.NumIntervals()); | 398 EXPECT_EQ(3u, queue.NumIntervals()); |
399 EXPECT_FALSE(queue.Contains(9)); | 399 EXPECT_FALSE(queue.Contains(9)); |
400 EXPECT_FALSE(queue.Contains(20)); | 400 EXPECT_FALSE(queue.Contains(20)); |
401 } | 401 } |
402 | 402 |
403 } // namespace | 403 } // namespace |
404 } // namespace test | 404 } // namespace test |
405 } // namespace net | 405 } // namespace net |
OLD | NEW |