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_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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 params.push_back(TestParams(version, Perspective::IS_SERVER, false)); | 126 params.push_back(TestParams(version, Perspective::IS_SERVER, false)); |
127 } | 127 } |
128 FLAGS_quic_supports_push_promise = true; | 128 FLAGS_quic_supports_push_promise = true; |
129 return params; | 129 return params; |
130 } | 130 } |
131 | 131 |
132 class QuicHeadersStreamTest : public ::testing::TestWithParam<TestParams> { | 132 class QuicHeadersStreamTest : public ::testing::TestWithParam<TestParams> { |
133 public: | 133 public: |
134 QuicHeadersStreamTest() | 134 QuicHeadersStreamTest() |
135 : connection_(new StrictMock<MockConnection>(&helper_, | 135 : connection_(new StrictMock<MockConnection>(&helper_, |
| 136 &alarm_factory_, |
136 perspective(), | 137 perspective(), |
137 GetVersion())), | 138 GetVersion())), |
138 session_(connection_), | 139 session_(connection_), |
139 headers_stream_(QuicSpdySessionPeer::GetHeadersStream(&session_)), | 140 headers_stream_(QuicSpdySessionPeer::GetHeadersStream(&session_)), |
140 body_("hello world"), | 141 body_("hello world"), |
141 stream_frame_(kHeadersStreamId, /*fin=*/false, /*offset=*/0, ""), | 142 stream_frame_(kHeadersStreamId, /*fin=*/false, /*offset=*/0, ""), |
142 next_promised_stream_id_(2) { | 143 next_promised_stream_id_(2) { |
143 FLAGS_quic_always_log_bugs_for_tests = true; | 144 FLAGS_quic_always_log_bugs_for_tests = true; |
144 headers_[":version"] = "HTTP/1.1"; | 145 headers_[":version"] = "HTTP/1.1"; |
145 headers_[":status"] = "200 Ok"; | 146 headers_[":status"] = "200 Ok"; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 void TearDownLocalConnectionState() { | 243 void TearDownLocalConnectionState() { |
243 QuicConnectionPeer::TearDownLocalConnectionState(connection_); | 244 QuicConnectionPeer::TearDownLocalConnectionState(connection_); |
244 } | 245 } |
245 | 246 |
246 QuicStreamId NextPromisedStreamId() { return next_promised_stream_id_ += 2; } | 247 QuicStreamId NextPromisedStreamId() { return next_promised_stream_id_ += 2; } |
247 | 248 |
248 static const bool kFrameComplete = true; | 249 static const bool kFrameComplete = true; |
249 static const bool kHasPriority = true; | 250 static const bool kHasPriority = true; |
250 | 251 |
251 MockConnectionHelper helper_; | 252 MockConnectionHelper helper_; |
| 253 MockAlarmFactory alarm_factory_; |
252 StrictMock<MockConnection>* connection_; | 254 StrictMock<MockConnection>* connection_; |
253 StrictMock<MockQuicSpdySession> session_; | 255 StrictMock<MockQuicSpdySession> session_; |
254 QuicHeadersStream* headers_stream_; | 256 QuicHeadersStream* headers_stream_; |
255 SpdyHeaderBlock headers_; | 257 SpdyHeaderBlock headers_; |
256 string body_; | 258 string body_; |
257 string saved_data_; | 259 string saved_data_; |
258 string saved_header_data_; | 260 string saved_header_data_; |
259 std::unique_ptr<SpdyFramer> framer_; | 261 std::unique_ptr<SpdyFramer> framer_; |
260 StrictMock<MockVisitor> visitor_; | 262 StrictMock<MockVisitor> visitor_; |
261 QuicStreamFrame stream_frame_; | 263 QuicStreamFrame stream_frame_; |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 } | 591 } |
590 | 592 |
591 TEST_P(QuicHeadersStreamTest, NoConnectionLevelFlowControl) { | 593 TEST_P(QuicHeadersStreamTest, NoConnectionLevelFlowControl) { |
592 EXPECT_FALSE(ReliableQuicStreamPeer::StreamContributesToConnectionFlowControl( | 594 EXPECT_FALSE(ReliableQuicStreamPeer::StreamContributesToConnectionFlowControl( |
593 headers_stream_)); | 595 headers_stream_)); |
594 } | 596 } |
595 | 597 |
596 } // namespace | 598 } // namespace |
597 } // namespace test | 599 } // namespace test |
598 } // namespace net | 600 } // namespace net |
OLD | NEW |