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_session.h" | 5 #include "net/quic/quic_session.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 309 |
310 TEST_P(QuicSessionTest, StreamIdTooLarge) { | 310 TEST_P(QuicSessionTest, StreamIdTooLarge) { |
311 QuicStreamId stream_id = kClientDataStreamId1; | 311 QuicStreamId stream_id = kClientDataStreamId1; |
312 session_.GetIncomingDataStream(stream_id); | 312 session_.GetIncomingDataStream(stream_id); |
313 EXPECT_CALL(*connection_, SendConnectionClose(QUIC_INVALID_STREAM_ID)); | 313 EXPECT_CALL(*connection_, SendConnectionClose(QUIC_INVALID_STREAM_ID)); |
314 session_.GetIncomingDataStream(stream_id + kMaxStreamIdDelta + 2); | 314 session_.GetIncomingDataStream(stream_id + kMaxStreamIdDelta + 2); |
315 } | 315 } |
316 | 316 |
317 TEST_P(QuicSessionTest, DecompressionError) { | 317 TEST_P(QuicSessionTest, DecompressionError) { |
318 QuicHeadersStream* stream = QuicSessionPeer::GetHeadersStream(&session_); | 318 QuicHeadersStream* stream = QuicSessionPeer::GetHeadersStream(&session_); |
| 319 if (version() > QUIC_VERSION_23) { |
| 320 // This test does not apply to HPACK compression. |
| 321 return; |
| 322 } |
319 const unsigned char data[] = { | 323 const unsigned char data[] = { |
320 0x80, 0x03, 0x00, 0x01, // SPDY/3 SYN_STREAM frame | 324 0x80, 0x03, 0x00, 0x01, // SPDY/3 SYN_STREAM frame |
321 0x00, 0x00, 0x00, 0x25, // flags/length | 325 0x00, 0x00, 0x00, 0x25, // flags/length |
322 0x00, 0x00, 0x00, 0x05, // stream id | 326 0x00, 0x00, 0x00, 0x05, // stream id |
323 0x00, 0x00, 0x00, 0x00, // associated stream id | 327 0x00, 0x00, 0x00, 0x00, // associated stream id |
324 0x00, 0x00, | 328 0x00, 0x00, |
325 'a', 'b', 'c', 'd' // invalid compressed data | 329 'a', 'b', 'c', 'd' // invalid compressed data |
326 }; | 330 }; |
327 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails( | 331 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails( |
328 QUIC_INVALID_HEADERS_STREAM_DATA, | 332 QUIC_INVALID_HEADERS_STREAM_DATA, |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 } | 967 } |
964 | 968 |
965 // Called after any new data is received by the session, and triggers the call | 969 // Called after any new data is received by the session, and triggers the call |
966 // to close the connection. | 970 // to close the connection. |
967 session_.PostProcessAfterData(); | 971 session_.PostProcessAfterData(); |
968 } | 972 } |
969 | 973 |
970 } // namespace | 974 } // namespace |
971 } // namespace test | 975 } // namespace test |
972 } // namespace net | 976 } // namespace net |
OLD | NEW |