OLD | NEW |
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/chromium/quic_chromium_client_stream.h" | 5 #include "net/quic/chromium/quic_chromium_client_stream.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 MockQuicConnectionHelper helper_; | 221 MockQuicConnectionHelper helper_; |
222 MockAlarmFactory alarm_factory_; | 222 MockAlarmFactory alarm_factory_; |
223 MockQuicClientSessionBase session_; | 223 MockQuicClientSessionBase session_; |
224 QuicChromiumClientStream* stream_; | 224 QuicChromiumClientStream* stream_; |
225 SpdyHeaderBlock headers_; | 225 SpdyHeaderBlock headers_; |
226 QuicClientPushPromiseIndex push_promise_index_; | 226 QuicClientPushPromiseIndex push_promise_index_; |
227 }; | 227 }; |
228 | 228 |
229 INSTANTIATE_TEST_CASE_P(Version, | 229 INSTANTIATE_TEST_CASE_P(Version, |
230 QuicChromiumClientStreamTest, | 230 QuicChromiumClientStreamTest, |
231 ::testing::ValuesIn(QuicSupportedVersions())); | 231 ::testing::ValuesIn(AllSupportedVersions())); |
232 | 232 |
233 TEST_P(QuicChromiumClientStreamTest, OnFinRead) { | 233 TEST_P(QuicChromiumClientStreamTest, OnFinRead) { |
234 InitializeHeaders(); | 234 InitializeHeaders(); |
235 std::string uncompressed_headers = | 235 std::string uncompressed_headers = |
236 SpdyUtils::SerializeUncompressedHeaders(headers_); | 236 SpdyUtils::SerializeUncompressedHeaders(headers_); |
237 QuicStreamOffset offset = 0; | 237 QuicStreamOffset offset = 0; |
238 stream_->OnStreamHeaders(uncompressed_headers); | 238 stream_->OnStreamHeaders(uncompressed_headers); |
239 stream_->OnStreamHeadersComplete(false, uncompressed_headers.length()); | 239 stream_->OnStreamHeadersComplete(false, uncompressed_headers.length()); |
240 | 240 |
241 EXPECT_CALL(delegate_, | 241 EXPECT_CALL(delegate_, |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 base::RunLoop().RunUntilIdle(); | 554 base::RunLoop().RunUntilIdle(); |
555 EXPECT_EQ(headers_, delegate_.headers_); | 555 EXPECT_EQ(headers_, delegate_.headers_); |
556 | 556 |
557 // Times(2) because OnClose will be called for stream and stream_. | 557 // Times(2) because OnClose will be called for stream and stream_. |
558 EXPECT_CALL(delegate_, OnClose()).Times(2); | 558 EXPECT_CALL(delegate_, OnClose()).Times(2); |
559 } | 559 } |
560 | 560 |
561 } // namespace | 561 } // namespace |
562 } // namespace test | 562 } // namespace test |
563 } // namespace net | 563 } // namespace net |
OLD | NEW |