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_connection.h" | 5 #include "net/quic/quic_connection.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
(...skipping 1914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1925 | 1925 |
1926 connection_.SetEncrypter(ENCRYPTION_INITIAL, new TaggingEncrypter(0x02)); | 1926 connection_.SetEncrypter(ENCRYPTION_INITIAL, new TaggingEncrypter(0x02)); |
1927 connection_.SetDefaultEncryptionLevel(ENCRYPTION_INITIAL); | 1927 connection_.SetDefaultEncryptionLevel(ENCRYPTION_INITIAL); |
1928 SendStreamDataToPeer(1, "foo", 0, !kFin, NULL); | 1928 SendStreamDataToPeer(1, "foo", 0, !kFin, NULL); |
1929 EXPECT_EQ(0x02020202u, final_bytes_of_last_packet()); | 1929 EXPECT_EQ(0x02020202u, final_bytes_of_last_packet()); |
1930 | 1930 |
1931 EXPECT_EQ(default_retransmission_time, | 1931 EXPECT_EQ(default_retransmission_time, |
1932 connection_.GetRetransmissionAlarm()->deadline()); | 1932 connection_.GetRetransmissionAlarm()->deadline()); |
1933 { | 1933 { |
1934 InSequence s; | 1934 InSequence s; |
1935 EXPECT_CALL(*send_algorithm_, OnRetransmissionTimeout()); | |
1936 EXPECT_CALL(*send_algorithm_, OnPacketAbandoned(1, _)); | 1935 EXPECT_CALL(*send_algorithm_, OnPacketAbandoned(1, _)); |
1937 EXPECT_CALL(*send_algorithm_, OnPacketAbandoned(2, _)); | 1936 EXPECT_CALL(*send_algorithm_, OnPacketAbandoned(2, _)); |
| 1937 EXPECT_CALL(*send_algorithm_, OnRetransmissionTimeout()); |
1938 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, 3, _, RTO_RETRANSMISSION, _)); | 1938 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, 3, _, RTO_RETRANSMISSION, _)); |
1939 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, 4, _, RTO_RETRANSMISSION, _)); | 1939 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, 4, _, RTO_RETRANSMISSION, _)); |
1940 } | 1940 } |
1941 | 1941 |
1942 // Simulate the retransmission alarm firing. | 1942 // Simulate the retransmission alarm firing. |
1943 clock_.AdvanceTime(DefaultRetransmissionTime()); | 1943 clock_.AdvanceTime(DefaultRetransmissionTime()); |
1944 connection_.GetRetransmissionAlarm()->Fire(); | 1944 connection_.GetRetransmissionAlarm()->Fire(); |
1945 | 1945 |
1946 // Packet should have been sent with ENCRYPTION_NONE. | 1946 // Packet should have been sent with ENCRYPTION_NONE. |
1947 EXPECT_EQ(0x01010101u, final_bytes_of_previous_packet()); | 1947 EXPECT_EQ(0x01010101u, final_bytes_of_previous_packet()); |
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3316 true); | 3316 true); |
3317 TestConnection client(guid_, IPEndPoint(), helper_.get(), writer_.get(), | 3317 TestConnection client(guid_, IPEndPoint(), helper_.get(), writer_.get(), |
3318 false); | 3318 false); |
3319 EXPECT_TRUE(client.sent_packet_manager().using_pacing()); | 3319 EXPECT_TRUE(client.sent_packet_manager().using_pacing()); |
3320 EXPECT_FALSE(server.sent_packet_manager().using_pacing()); | 3320 EXPECT_FALSE(server.sent_packet_manager().using_pacing()); |
3321 } | 3321 } |
3322 | 3322 |
3323 } // namespace | 3323 } // namespace |
3324 } // namespace test | 3324 } // namespace test |
3325 } // namespace net | 3325 } // namespace net |
OLD | NEW |