| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/core/quic_headers_stream.h" | 5 #include "net/quic/core/quic_headers_stream.h" |
| 6 | 6 |
| 7 #include <cstdint> | 7 #include <cstdint> |
| 8 #include <ostream> | 8 #include <ostream> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <tuple> | 10 #include <tuple> |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 SpdySerializedFrame frame(framer_->SerializeFrame(data)); | 532 SpdySerializedFrame frame(framer_->SerializeFrame(data)); |
| 533 stream_frame_.data_buffer = frame.data(); | 533 stream_frame_.data_buffer = frame.data(); |
| 534 stream_frame_.data_length = frame.size(); | 534 stream_frame_.data_length = frame.size(); |
| 535 if (perspective() == Perspective::IS_CLIENT) { | 535 if (perspective() == Perspective::IS_CLIENT) { |
| 536 EXPECT_CALL( | 536 EXPECT_CALL( |
| 537 *connection_, | 537 *connection_, |
| 538 CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA, | 538 CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA, |
| 539 "Unsupported field of HTTP/2 SETTINGS frame: 2", _)); | 539 "Unsupported field of HTTP/2 SETTINGS frame: 2", _)); |
| 540 } | 540 } |
| 541 headers_stream_->OnStreamFrame(stream_frame_); | 541 headers_stream_->OnStreamFrame(stream_frame_); |
| 542 EXPECT_EQ( | 542 EXPECT_EQ(session_.server_push_enabled(), |
| 543 session_.server_push_enabled(), | 543 perspective() == Perspective::IS_CLIENT); |
| 544 (perspective() == Perspective::IS_CLIENT && version() > QUIC_VERSION_34)); | |
| 545 } | 544 } |
| 546 | 545 |
| 547 TEST_P(QuicHeadersStreamTest, EmptyHeaderHOLBlockedTime) { | 546 TEST_P(QuicHeadersStreamTest, EmptyHeaderHOLBlockedTime) { |
| 548 EXPECT_CALL(session_, OnHeadersHeadOfLineBlocking(_)).Times(0); | 547 EXPECT_CALL(session_, OnHeadersHeadOfLineBlocking(_)).Times(0); |
| 549 InSequence seq; | 548 InSequence seq; |
| 550 bool fin = true; | 549 bool fin = true; |
| 551 for (int stream_num = 0; stream_num < 10; stream_num++) { | 550 for (int stream_num = 0; stream_num < 10; stream_num++) { |
| 552 QuicStreamId stream_id = QuicClientDataStreamId(stream_num); | 551 QuicStreamId stream_id = QuicClientDataStreamId(stream_num); |
| 553 // Replace with "WriteHeadersAndSaveData" | 552 // Replace with "WriteHeadersAndSaveData" |
| 554 SpdySerializedFrame frame; | 553 SpdySerializedFrame frame; |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 consumed_data = session_.WritevStreamData(id, MakeIOVector(data, &iov), | 1031 consumed_data = session_.WritevStreamData(id, MakeIOVector(data, &iov), |
| 1033 offset, fin, nullptr); | 1032 offset, fin, nullptr); |
| 1034 | 1033 |
| 1035 EXPECT_EQ(consumed_data.bytes_consumed, 0u); | 1034 EXPECT_EQ(consumed_data.bytes_consumed, 0u); |
| 1036 EXPECT_EQ(consumed_data.fin_consumed, false); | 1035 EXPECT_EQ(consumed_data.fin_consumed, false); |
| 1037 } | 1036 } |
| 1038 | 1037 |
| 1039 } // namespace | 1038 } // namespace |
| 1040 } // namespace test | 1039 } // namespace test |
| 1041 } // namespace net | 1040 } // namespace net |
| OLD | NEW |