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

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

Issue 1977153002: Rename various MockConnectionFoo classes to MockQuicConnectionFoo. No behavior change. This is cons… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@121576119
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/quic_flow_controller_test.cc ('k') | net/quic/quic_http_stream_test.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 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_headers_stream.h" 5 #include "net/quic/quic_headers_stream.h"
6 6
7 #include "net/quic/quic_utils.h" 7 #include "net/quic/quic_utils.h"
8 #include "net/quic/spdy_utils.h" 8 #include "net/quic/spdy_utils.h"
9 #include "net/quic/test_tools/quic_connection_peer.h" 9 #include "net/quic/test_tools/quic_connection_peer.h"
10 #include "net/quic/test_tools/quic_spdy_session_peer.h" 10 #include "net/quic/test_tools/quic_spdy_session_peer.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 params.push_back(TestParams(version, Perspective::IS_CLIENT)); 116 params.push_back(TestParams(version, Perspective::IS_CLIENT));
117 params.push_back(TestParams(version, Perspective::IS_SERVER)); 117 params.push_back(TestParams(version, Perspective::IS_SERVER));
118 } 118 }
119 FLAGS_quic_supports_push_promise = true; 119 FLAGS_quic_supports_push_promise = true;
120 return params; 120 return params;
121 } 121 }
122 122
123 class QuicHeadersStreamTest : public ::testing::TestWithParam<TestParams> { 123 class QuicHeadersStreamTest : public ::testing::TestWithParam<TestParams> {
124 public: 124 public:
125 QuicHeadersStreamTest() 125 QuicHeadersStreamTest()
126 : connection_(new StrictMock<MockConnection>(&helper_, 126 : connection_(new StrictMock<MockQuicConnection>(&helper_,
127 &alarm_factory_, 127 &alarm_factory_,
128 perspective(), 128 perspective(),
129 GetVersion())), 129 GetVersion())),
130 session_(connection_), 130 session_(connection_),
131 headers_stream_(QuicSpdySessionPeer::GetHeadersStream(&session_)), 131 headers_stream_(QuicSpdySessionPeer::GetHeadersStream(&session_)),
132 body_("hello world"), 132 body_("hello world"),
133 stream_frame_(kHeadersStreamId, /*fin=*/false, /*offset=*/0, ""), 133 stream_frame_(kHeadersStreamId, /*fin=*/false, /*offset=*/0, ""),
134 next_promised_stream_id_(2) { 134 next_promised_stream_id_(2) {
135 FLAGS_quic_always_log_bugs_for_tests = true; 135 FLAGS_quic_always_log_bugs_for_tests = true;
136 headers_[":version"] = "HTTP/1.1"; 136 headers_[":version"] = "HTTP/1.1";
137 headers_[":status"] = "200 Ok"; 137 headers_[":status"] = "200 Ok";
138 headers_["content-length"] = "11"; 138 headers_["content-length"] = "11";
139 framer_ = std::unique_ptr<SpdyFramer>(new SpdyFramer(HTTP2)); 139 framer_ = std::unique_ptr<SpdyFramer>(new SpdyFramer(HTTP2));
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 228
229 void TearDownLocalConnectionState() { 229 void TearDownLocalConnectionState() {
230 QuicConnectionPeer::TearDownLocalConnectionState(connection_); 230 QuicConnectionPeer::TearDownLocalConnectionState(connection_);
231 } 231 }
232 232
233 QuicStreamId NextPromisedStreamId() { return next_promised_stream_id_ += 2; } 233 QuicStreamId NextPromisedStreamId() { return next_promised_stream_id_ += 2; }
234 234
235 static const bool kFrameComplete = true; 235 static const bool kFrameComplete = true;
236 static const bool kHasPriority = true; 236 static const bool kHasPriority = true;
237 237
238 MockConnectionHelper helper_; 238 MockQuicConnectionHelper helper_;
239 MockAlarmFactory alarm_factory_; 239 MockAlarmFactory alarm_factory_;
240 StrictMock<MockConnection>* connection_; 240 StrictMock<MockQuicConnection>* connection_;
241 StrictMock<MockQuicSpdySession> session_; 241 StrictMock<MockQuicSpdySession> session_;
242 QuicHeadersStream* headers_stream_; 242 QuicHeadersStream* headers_stream_;
243 SpdyHeaderBlock headers_; 243 SpdyHeaderBlock headers_;
244 string body_; 244 string body_;
245 string saved_data_; 245 string saved_data_;
246 string saved_header_data_; 246 string saved_header_data_;
247 std::unique_ptr<SpdyFramer> framer_; 247 std::unique_ptr<SpdyFramer> framer_;
248 StrictMock<MockVisitor> visitor_; 248 StrictMock<MockVisitor> visitor_;
249 QuicStreamFrame stream_frame_; 249 QuicStreamFrame stream_frame_;
250 QuicStreamId next_promised_stream_id_; 250 QuicStreamId next_promised_stream_id_;
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 } 583 }
584 584
585 TEST_P(QuicHeadersStreamTest, NoConnectionLevelFlowControl) { 585 TEST_P(QuicHeadersStreamTest, NoConnectionLevelFlowControl) {
586 EXPECT_FALSE(ReliableQuicStreamPeer::StreamContributesToConnectionFlowControl( 586 EXPECT_FALSE(ReliableQuicStreamPeer::StreamContributesToConnectionFlowControl(
587 headers_stream_)); 587 headers_stream_));
588 } 588 }
589 589
590 } // namespace 590 } // namespace
591 } // namespace test 591 } // namespace test
592 } // namespace net 592 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_flow_controller_test.cc ('k') | net/quic/quic_http_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698