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_packet_generator.h" | 5 #include "net/quic/quic_packet_generator.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
| 9 #include "base/macros.h" |
9 #include "net/quic/crypto/crypto_protocol.h" | 10 #include "net/quic/crypto/crypto_protocol.h" |
10 #include "net/quic/crypto/null_encrypter.h" | 11 #include "net/quic/crypto/null_encrypter.h" |
11 #include "net/quic/crypto/quic_decrypter.h" | 12 #include "net/quic/crypto/quic_decrypter.h" |
12 #include "net/quic/crypto/quic_encrypter.h" | 13 #include "net/quic/crypto/quic_encrypter.h" |
13 #include "net/quic/quic_flags.h" | 14 #include "net/quic/quic_flags.h" |
14 #include "net/quic/quic_utils.h" | 15 #include "net/quic/quic_utils.h" |
15 #include "net/quic/test_tools/quic_packet_creator_peer.h" | 16 #include "net/quic/test_tools/quic_packet_creator_peer.h" |
16 #include "net/quic/test_tools/quic_packet_generator_peer.h" | 17 #include "net/quic/test_tools/quic_packet_generator_peer.h" |
17 #include "net/quic/test_tools/quic_test_utils.h" | 18 #include "net/quic/test_tools/quic_test_utils.h" |
18 #include "net/quic/test_tools/simple_quic_framer.h" | 19 #include "net/quic/test_tools/simple_quic_framer.h" |
19 #include "net/test/gtest_util.h" | 20 #include "net/test/gtest_util.h" |
20 #include "testing/gmock/include/gmock/gmock.h" | 21 #include "testing/gmock/include/gmock/gmock.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
22 | 23 |
23 using base::StringPiece; | 24 using base::StringPiece; |
24 using std::string; | 25 using std::string; |
25 using std::vector; | 26 using std::vector; |
26 using testing::InSequence; | 27 using testing::InSequence; |
27 using testing::Return; | 28 using testing::Return; |
28 using testing::StrictMock; | 29 using testing::StrictMock; |
29 using testing::_; | 30 using testing::_; |
30 | 31 |
31 namespace net { | 32 namespace net { |
32 namespace test { | 33 namespace test { |
33 namespace { | 34 namespace { |
34 | 35 |
35 const int64 kMinFecTimeoutMs = 5u; | 36 const int64_t kMinFecTimeoutMs = 5u; |
36 | 37 |
37 static const FecSendPolicy kFecSendPolicyList[] = { | 38 static const FecSendPolicy kFecSendPolicyList[] = { |
38 FEC_ANY_TRIGGER, FEC_ALARM_TRIGGER, | 39 FEC_ANY_TRIGGER, FEC_ALARM_TRIGGER, |
39 }; | 40 }; |
40 | 41 |
41 class MockDelegate : public QuicPacketGenerator::DelegateInterface { | 42 class MockDelegate : public QuicPacketGenerator::DelegateInterface { |
42 public: | 43 public: |
43 MockDelegate() {} | 44 MockDelegate() {} |
44 ~MockDelegate() override {} | 45 ~MockDelegate() override {} |
45 | 46 |
(...skipping 1656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1702 EXPECT_CALL(delegate_, OnSerializedPacket(_)) | 1703 EXPECT_CALL(delegate_, OnSerializedPacket(_)) |
1703 .WillOnce(Invoke(this, &QuicPacketGeneratorTest::SavePacket)); | 1704 .WillOnce(Invoke(this, &QuicPacketGeneratorTest::SavePacket)); |
1704 generator_.FlushAllQueuedFrames(); | 1705 generator_.FlushAllQueuedFrames(); |
1705 EXPECT_FALSE(generator_.HasQueuedFrames()); | 1706 EXPECT_FALSE(generator_.HasQueuedFrames()); |
1706 generator_.SetCurrentPath(kTestPathId1, 1, 0); | 1707 generator_.SetCurrentPath(kTestPathId1, 1, 0); |
1707 EXPECT_EQ(kTestPathId1, QuicPacketCreatorPeer::GetCurrentPath(creator_)); | 1708 EXPECT_EQ(kTestPathId1, QuicPacketCreatorPeer::GetCurrentPath(creator_)); |
1708 } | 1709 } |
1709 | 1710 |
1710 } // namespace test | 1711 } // namespace test |
1711 } // namespace net | 1712 } // namespace net |
OLD | NEW |