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

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

Issue 1905843003: Split out QuicAlarm creation from QuicConnectionHelper to new QuicAlarmFactory. No behavior change,… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@119753783
Patch Set: Rebase Created 4 years, 8 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/quic_stream_sequencer_test.cc ('k') | net/quic/test_tools/crypto_test_utils.h » ('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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
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<MockConnection>(
109 &helper_, Perspective::IS_SERVER, supported_versions_); 109 &helper_, &alarm_factory_, Perspective::IS_SERVER, supported_versions_);
110 session_.reset(new StrictMock<MockQuicSpdySession>(connection_)); 110 session_.reset(new StrictMock<MockQuicSpdySession>(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);
119 // session_ now owns stream_. 119 // session_ now owns stream_.
(...skipping 23 matching lines...) Expand all
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 MockConnectionHelper helper_;
153 MockAlarmFactory alarm_factory_;
153 MockConnection* connection_; 154 MockConnection* connection_;
154 std::unique_ptr<MockQuicSpdySession> session_; 155 std::unique_ptr<MockQuicSpdySession> session_;
155 TestStream* stream_; 156 TestStream* stream_;
156 SpdyHeaderBlock headers_; 157 SpdyHeaderBlock headers_;
157 QuicWriteBlockedList* write_blocked_list_; 158 QuicWriteBlockedList* write_blocked_list_;
158 uint32_t initial_flow_control_window_bytes_; 159 uint32_t initial_flow_control_window_bytes_;
159 QuicTime::Delta zero_; 160 QuicTime::Delta zero_;
160 QuicVersionVector supported_versions_; 161 QuicVersionVector supported_versions_;
161 const QuicStreamId kTestStreamId = 5u; 162 const QuicStreamId kTestStreamId = 5u;
162 }; 163 };
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 // Receive remaining data and FIN for the request. 660 // Receive remaining data and FIN for the request.
660 QuicStreamFrame frame2(stream_->id(), true, 0, StringPiece("End")); 661 QuicStreamFrame frame2(stream_->id(), true, 0, StringPiece("End"));
661 stream_->OnStreamFrame(frame2); 662 stream_->OnStreamFrame(frame2);
662 EXPECT_TRUE(stream_->fin_received()); 663 EXPECT_TRUE(stream_->fin_received());
663 EXPECT_TRUE(stream_->HasFinalReceivedByteOffset()); 664 EXPECT_TRUE(stream_->HasFinalReceivedByteOffset());
664 } 665 }
665 666
666 } // namespace 667 } // namespace
667 } // namespace test 668 } // namespace test
668 } // namespace net 669 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_stream_sequencer_test.cc ('k') | net/quic/test_tools/crypto_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698