| 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_framer.h" | 5 #include "net/quic/quic_framer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 2985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2996 string expected_error = "Unable to read stream_id."; | 2996 string expected_error = "Unable to read stream_id."; |
| 2997 CheckProcessingFails( | 2997 CheckProcessingFails( |
| 2998 packet, | 2998 packet, |
| 2999 i + GetPacketHeaderSize(PACKET_8BYTE_CONNECTION_ID, !kIncludeVersion, | 2999 i + GetPacketHeaderSize(PACKET_8BYTE_CONNECTION_ID, !kIncludeVersion, |
| 3000 PACKET_6BYTE_SEQUENCE_NUMBER, NOT_IN_FEC_GROUP), | 3000 PACKET_6BYTE_SEQUENCE_NUMBER, NOT_IN_FEC_GROUP), |
| 3001 expected_error, QUIC_INVALID_BLOCKED_DATA); | 3001 expected_error, QUIC_INVALID_BLOCKED_DATA); |
| 3002 } | 3002 } |
| 3003 } | 3003 } |
| 3004 | 3004 |
| 3005 TEST_P(QuicFramerTest, PingFrame) { | 3005 TEST_P(QuicFramerTest, PingFrame) { |
| 3006 if (version_ <= QUIC_VERSION_16) { | |
| 3007 return; | |
| 3008 } | |
| 3009 | |
| 3010 unsigned char packet[] = { | 3006 unsigned char packet[] = { |
| 3011 // public flags (8 byte connection_id) | 3007 // public flags (8 byte connection_id) |
| 3012 0x3C, | 3008 0x3C, |
| 3013 // connection_id | 3009 // connection_id |
| 3014 0x10, 0x32, 0x54, 0x76, | 3010 0x10, 0x32, 0x54, 0x76, |
| 3015 0x98, 0xBA, 0xDC, 0xFE, | 3011 0x98, 0xBA, 0xDC, 0xFE, |
| 3016 // packet sequence number | 3012 // packet sequence number |
| 3017 0xBC, 0x9A, 0x78, 0x56, | 3013 0xBC, 0x9A, 0x78, 0x56, |
| 3018 0x34, 0x12, | 3014 0x34, 0x12, |
| 3019 // private flags | 3015 // private flags |
| (...skipping 2049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5069 EXPECT_CALL(visitor, OnPacketComplete()); | 5065 EXPECT_CALL(visitor, OnPacketComplete()); |
| 5070 EXPECT_CALL(visitor, OnUnauthenticatedPublicHeader(_)).WillOnce(Return(true)); | 5066 EXPECT_CALL(visitor, OnUnauthenticatedPublicHeader(_)).WillOnce(Return(true)); |
| 5071 | 5067 |
| 5072 QuicEncryptedPacket encrypted(AsChars(packet), arraysize(packet), false); | 5068 QuicEncryptedPacket encrypted(AsChars(packet), arraysize(packet), false); |
| 5073 EXPECT_TRUE(framer_.ProcessPacket(encrypted)); | 5069 EXPECT_TRUE(framer_.ProcessPacket(encrypted)); |
| 5074 EXPECT_EQ(QUIC_NO_ERROR, framer_.error()); | 5070 EXPECT_EQ(QUIC_NO_ERROR, framer_.error()); |
| 5075 } | 5071 } |
| 5076 | 5072 |
| 5077 } // namespace test | 5073 } // namespace test |
| 5078 } // namespace net | 5074 } // namespace net |
| OLD | NEW |