OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_simple_server.h" | 5 #include "net/tools/quic/quic_simple_server.h" |
6 | 6 |
7 #include "net/quic/core/crypto/quic_random.h" | 7 #include "net/quic/core/crypto/quic_random.h" |
8 #include "net/quic/core/quic_crypto_stream.h" | 8 #include "net/quic/core/quic_crypto_stream.h" |
9 #include "net/quic/core/quic_utils.h" | 9 #include "net/quic/core/quic_utils.h" |
10 #include "net/quic/test_tools/crypto_test_utils.h" | 10 #include "net/quic/test_tools/crypto_test_utils.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 TEST_F(QuicChromeServerDispatchPacketTest, DispatchPacket) { | 55 TEST_F(QuicChromeServerDispatchPacketTest, DispatchPacket) { |
56 unsigned char valid_packet[] = {// public flags (8 byte connection_id) | 56 unsigned char valid_packet[] = {// public flags (8 byte connection_id) |
57 0x3C, | 57 0x3C, |
58 // connection_id | 58 // connection_id |
59 0x10, 0x32, 0x54, 0x76, 0x98, 0xBA, 0xDC, | 59 0x10, 0x32, 0x54, 0x76, 0x98, 0xBA, 0xDC, |
60 0xFE, | 60 0xFE, |
61 // packet sequence number | 61 // packet sequence number |
62 0xBC, 0x9A, 0x78, 0x56, 0x34, 0x12, | 62 0xBC, 0x9A, 0x78, 0x56, 0x34, 0x12, |
63 // private flags | 63 // private flags |
64 0x00}; | 64 0x00}; |
65 QuicReceivedPacket encrypted_valid_packet(QuicUtils::AsChars(valid_packet), | 65 QuicReceivedPacket encrypted_valid_packet( |
66 arraysize(valid_packet), | 66 reinterpret_cast<char*>(valid_packet), arraysize(valid_packet), |
67 QuicTime::Zero(), false); | 67 QuicTime::Zero(), false); |
68 | 68 |
69 EXPECT_CALL(dispatcher_, ProcessPacket(_, _, _)).Times(1); | 69 EXPECT_CALL(dispatcher_, ProcessPacket(_, _, _)).Times(1); |
70 DispatchPacket(encrypted_valid_packet); | 70 DispatchPacket(encrypted_valid_packet); |
71 } | 71 } |
72 | 72 |
73 } // namespace test | 73 } // namespace test |
74 } // namespace net | 74 } // namespace net |
OLD | NEW |