Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: net/quic/reliable_quic_stream_test.cc

Issue 1979763002: Landing Recent QUIC changes until Sun May 8 00:39:29 2016 +0000 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/reliable_quic_stream.cc ('k') | net/quic/spdy_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/reliable_quic_stream.h" 5 #include "net/quic/reliable_quic_stream.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "net/quic/quic_connection.h" 9 #include "net/quic/quic_connection.h"
10 #include "net/quic/quic_flags.h" 10 #include "net/quic/quic_flags.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 "edlR9FsEdH6iujMcHkbE5l18ehJDwTWmBKBzVD87naobhMMrF6VvnDGxQVGp9Ir_b" 98 "edlR9FsEdH6iujMcHkbE5l18ehJDwTWmBKBzVD87naobhMMrF6VvnDGxQVGp9Ir_b"
99 "Rgj3RWUoPumQVCxtSOBdX0GlJOEcDTNCzQIm9BSfetog_eP_TfYubKudt5eMsXmN6" 99 "Rgj3RWUoPumQVCxtSOBdX0GlJOEcDTNCzQIm9BSfetog_eP_TfYubKudt5eMsXmN6"
100 "QnyXHeGeK2UINUzJ-D30AFcpqYgH9_1BvYSpi7fc7_ydBU8TaD8ZRxvtnzXqj0RfG" 100 "QnyXHeGeK2UINUzJ-D30AFcpqYgH9_1BvYSpi7fc7_ydBU8TaD8ZRxvtnzXqj0RfG"
101 "tuHghmv3aD-uzSYJ75XDdzKdizZ86IG6Fbn1XFhYZM-fbHhm3mVEXnyRW4ZuNOLFk" 101 "tuHghmv3aD-uzSYJ75XDdzKdizZ86IG6Fbn1XFhYZM-fbHhm3mVEXnyRW4ZuNOLFk"
102 "Fas6LMcVC6Q8QLlHYbXBpdNFuGbuZGUnav5C-2I_-46lL0NGg3GewxGKGHvHEfoyn" 102 "Fas6LMcVC6Q8QLlHYbXBpdNFuGbuZGUnav5C-2I_-46lL0NGg3GewxGKGHvHEfoyn"
103 "EFFlEYHsBQ98rXImL8ySDycdLEFvBPdtctPmWCfTxwmoSMLHU2SCVDhbqMWU5b0yr" 103 "EFFlEYHsBQ98rXImL8ySDycdLEFvBPdtctPmWCfTxwmoSMLHU2SCVDhbqMWU5b0yr"
104 "JBCScs_ejbKaqBDoB7ZGxTvqlrB__2ZmnHHjCr8RgMRtKNtIeuZAo "; 104 "JBCScs_ejbKaqBDoB7ZGxTvqlrB__2ZmnHHjCr8RgMRtKNtIeuZAo ";
105 } 105 }
106 106
107 void Initialize(bool stream_should_process_data) { 107 void Initialize(bool stream_should_process_data) {
108 connection_ = new StrictMock<MockConnection>( 108 connection_ = new StrictMock<MockQuicConnection>(
109 &helper_, &alarm_factory_, Perspective::IS_SERVER, supported_versions_); 109 &helper_, &alarm_factory_, Perspective::IS_SERVER, supported_versions_);
110 session_.reset(new StrictMock<MockQuicSession>(connection_)); 110 session_.reset(new StrictMock<MockQuicSession>(connection_));
111 111
112 // New streams rely on having the peer's flow control receive window 112 // New streams rely on having the peer's flow control receive window
113 // negotiated in the config. 113 // negotiated in the config.
114 QuicConfigPeer::SetReceivedInitialStreamFlowControlWindow( 114 QuicConfigPeer::SetReceivedInitialStreamFlowControlWindow(
115 session_->config(), initial_flow_control_window_bytes_); 115 session_->config(), initial_flow_control_window_bytes_);
116 116
117 stream_ = new TestStream(kTestStreamId, session_.get(), 117 stream_ = new TestStream(kTestStreamId, session_.get(),
118 stream_should_process_data); 118 stream_should_process_data);
(...skipping 23 matching lines...) Expand all
142 QuicStreamId id, 142 QuicStreamId id,
143 QuicIOVector /*iov*/, 143 QuicIOVector /*iov*/,
144 QuicStreamOffset /*offset*/, 144 QuicStreamOffset /*offset*/,
145 bool /*fin*/, 145 bool /*fin*/,
146 QuicAckListenerInterface* /*ack_notifier_delegate*/) { 146 QuicAckListenerInterface* /*ack_notifier_delegate*/) {
147 session_->CloseStream(id); 147 session_->CloseStream(id);
148 return QuicConsumedData(1, false); 148 return QuicConsumedData(1, false);
149 } 149 }
150 150
151 protected: 151 protected:
152 MockConnectionHelper helper_; 152 MockQuicConnectionHelper helper_;
153 MockAlarmFactory alarm_factory_; 153 MockAlarmFactory alarm_factory_;
154 MockConnection* connection_; 154 MockQuicConnection* connection_;
155 std::unique_ptr<MockQuicSession> session_; 155 std::unique_ptr<MockQuicSession> session_;
156 TestStream* stream_; 156 TestStream* stream_;
157 SpdyHeaderBlock headers_; 157 SpdyHeaderBlock headers_;
158 QuicWriteBlockedList* write_blocked_list_; 158 QuicWriteBlockedList* write_blocked_list_;
159 uint32_t initial_flow_control_window_bytes_; 159 uint32_t initial_flow_control_window_bytes_;
160 QuicTime::Delta zero_; 160 QuicTime::Delta zero_;
161 QuicVersionVector supported_versions_; 161 QuicVersionVector supported_versions_;
162 const QuicStreamId kTestStreamId = 5u; 162 const QuicStreamId kTestStreamId = 5u;
163 }; 163 };
164 164
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 // Receive remaining data and FIN for the request. 664 // Receive remaining data and FIN for the request.
665 QuicStreamFrame frame2(stream_->id(), true, 0, StringPiece("End")); 665 QuicStreamFrame frame2(stream_->id(), true, 0, StringPiece("End"));
666 stream_->OnStreamFrame(frame2); 666 stream_->OnStreamFrame(frame2);
667 EXPECT_TRUE(stream_->fin_received()); 667 EXPECT_TRUE(stream_->fin_received());
668 EXPECT_TRUE(stream_->HasFinalReceivedByteOffset()); 668 EXPECT_TRUE(stream_->HasFinalReceivedByteOffset());
669 } 669 }
670 670
671 } // namespace 671 } // namespace
672 } // namespace test 672 } // namespace test
673 } // namespace net 673 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/reliable_quic_stream.cc ('k') | net/quic/spdy_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698