| 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/quic_data_stream.h" | 5 #include "net/quic/quic_data_stream.h" |
| 6 | 6 |
| 7 #include "net/quic/quic_ack_notifier.h" | 7 #include "net/quic/quic_ack_notifier.h" |
| 8 #include "net/quic/quic_connection.h" | 8 #include "net/quic/quic_connection.h" |
| 9 #include "net/quic/quic_utils.h" | 9 #include "net/quic/quic_utils.h" |
| 10 #include "net/quic/quic_write_blocked_list.h" | 10 #include "net/quic/quic_write_blocked_list.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 using testing::InSequence; | 23 using testing::InSequence; |
| 24 using testing::Return; | 24 using testing::Return; |
| 25 using testing::SaveArg; | 25 using testing::SaveArg; |
| 26 using testing::StrictMock; | 26 using testing::StrictMock; |
| 27 using testing::_; | 27 using testing::_; |
| 28 | 28 |
| 29 namespace net { | 29 namespace net { |
| 30 namespace test { | 30 namespace test { |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 const bool kIsServer = true; | |
| 34 const bool kShouldProcessData = true; | 33 const bool kShouldProcessData = true; |
| 35 | 34 |
| 36 class TestStream : public QuicDataStream { | 35 class TestStream : public QuicDataStream { |
| 37 public: | 36 public: |
| 38 TestStream(QuicStreamId id, | 37 TestStream(QuicStreamId id, |
| 39 QuicSession* session, | 38 QuicSession* session, |
| 40 bool should_process_data) | 39 bool should_process_data) |
| 41 : QuicDataStream(id, session), | 40 : QuicDataStream(id, session), |
| 42 should_process_data_(should_process_data) {} | 41 should_process_data_(should_process_data) {} |
| 43 | 42 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 "Rgj3RWUoPumQVCxtSOBdX0GlJOEcDTNCzQIm9BSfetog_eP_TfYubKudt5eMsXmN6" | 85 "Rgj3RWUoPumQVCxtSOBdX0GlJOEcDTNCzQIm9BSfetog_eP_TfYubKudt5eMsXmN6" |
| 87 "QnyXHeGeK2UINUzJ-D30AFcpqYgH9_1BvYSpi7fc7_ydBU8TaD8ZRxvtnzXqj0RfG" | 86 "QnyXHeGeK2UINUzJ-D30AFcpqYgH9_1BvYSpi7fc7_ydBU8TaD8ZRxvtnzXqj0RfG" |
| 88 "tuHghmv3aD-uzSYJ75XDdzKdizZ86IG6Fbn1XFhYZM-fbHhm3mVEXnyRW4ZuNOLFk" | 87 "tuHghmv3aD-uzSYJ75XDdzKdizZ86IG6Fbn1XFhYZM-fbHhm3mVEXnyRW4ZuNOLFk" |
| 89 "Fas6LMcVC6Q8QLlHYbXBpdNFuGbuZGUnav5C-2I_-46lL0NGg3GewxGKGHvHEfoyn" | 88 "Fas6LMcVC6Q8QLlHYbXBpdNFuGbuZGUnav5C-2I_-46lL0NGg3GewxGKGHvHEfoyn" |
| 90 "EFFlEYHsBQ98rXImL8ySDycdLEFvBPdtctPmWCfTxwmoSMLHU2SCVDhbqMWU5b0yr" | 89 "EFFlEYHsBQ98rXImL8ySDycdLEFvBPdtctPmWCfTxwmoSMLHU2SCVDhbqMWU5b0yr" |
| 91 "JBCScs_ejbKaqBDoB7ZGxTvqlrB__2ZmnHHjCr8RgMRtKNtIeuZAo "; | 90 "JBCScs_ejbKaqBDoB7ZGxTvqlrB__2ZmnHHjCr8RgMRtKNtIeuZAo "; |
| 92 } | 91 } |
| 93 | 92 |
| 94 void Initialize(bool stream_should_process_data) { | 93 void Initialize(bool stream_should_process_data) { |
| 95 connection_ = new testing::StrictMock<MockConnection>( | 94 connection_ = new testing::StrictMock<MockConnection>( |
| 96 kIsServer, SupportedVersions(GetParam())); | 95 Perspective::IS_SERVER, SupportedVersions(GetParam())); |
| 97 session_.reset(new testing::StrictMock<MockSession>(connection_)); | 96 session_.reset(new testing::StrictMock<MockSession>(connection_)); |
| 98 stream_.reset(new TestStream(kClientDataStreamId1, session_.get(), | 97 stream_.reset(new TestStream(kClientDataStreamId1, session_.get(), |
| 99 stream_should_process_data)); | 98 stream_should_process_data)); |
| 100 stream2_.reset(new TestStream(kClientDataStreamId2, session_.get(), | 99 stream2_.reset(new TestStream(kClientDataStreamId2, session_.get(), |
| 101 stream_should_process_data)); | 100 stream_should_process_data)); |
| 102 write_blocked_list_ = | 101 write_blocked_list_ = |
| 103 QuicSessionPeer::GetWriteBlockedStreams(session_.get()); | 102 QuicSessionPeer::GetWriteBlockedStreams(session_.get()); |
| 104 } | 103 } |
| 105 | 104 |
| 106 protected: | 105 protected: |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 EXPECT_CALL(*connection_, SendBlocked(kClientDataStreamId1)).Times(0); | 528 EXPECT_CALL(*connection_, SendBlocked(kClientDataStreamId1)).Times(0); |
| 530 EXPECT_CALL(*session_, WritevData(kClientDataStreamId1, _, _, _, _, _)) | 529 EXPECT_CALL(*session_, WritevData(kClientDataStreamId1, _, _, _, _, _)) |
| 531 .WillOnce(Return(QuicConsumedData(0, fin))); | 530 .WillOnce(Return(QuicConsumedData(0, fin))); |
| 532 | 531 |
| 533 stream_->WriteOrBufferData(body, fin, nullptr); | 532 stream_->WriteOrBufferData(body, fin, nullptr); |
| 534 } | 533 } |
| 535 | 534 |
| 536 } // namespace | 535 } // namespace |
| 537 } // namespace test | 536 } // namespace test |
| 538 } // namespace net | 537 } // namespace net |
| OLD | NEW |