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/tools/quic/quic_spdy_client_stream.h" | 5 #include "net/tools/quic/quic_spdy_client_stream.h" |
6 | 6 |
7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "net/quic/quic_utils.h" | 8 #include "net/quic/quic_utils.h" |
9 #include "net/quic/test_tools/quic_test_utils.h" | 9 #include "net/quic/test_tools/quic_test_utils.h" |
10 #include "net/tools/quic/quic_client_session.h" | 10 #include "net/tools/quic/quic_client_session.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 using testing::TestWithParam; | 22 using testing::TestWithParam; |
23 | 23 |
24 namespace net { | 24 namespace net { |
25 namespace tools { | 25 namespace tools { |
26 namespace test { | 26 namespace test { |
27 namespace { | 27 namespace { |
28 | 28 |
29 class QuicSpdyClientStreamTest : public TestWithParam<QuicVersion> { | 29 class QuicSpdyClientStreamTest : public TestWithParam<QuicVersion> { |
30 public: | 30 public: |
31 QuicSpdyClientStreamTest() | 31 QuicSpdyClientStreamTest() |
32 : connection_(new StrictMock<MockConnection>( | 32 : connection_( |
33 false, SupportedVersions(GetParam()))), | 33 new StrictMock<MockConnection>(Perspective::IS_CLIENT, |
| 34 SupportedVersions(GetParam()))), |
34 session_(DefaultQuicConfig(), connection_), | 35 session_(DefaultQuicConfig(), connection_), |
35 body_("hello world") { | 36 body_("hello world") { |
36 session_.InitializeSession( | 37 session_.InitializeSession( |
37 QuicServerId("example.com", 80, false, PRIVACY_MODE_DISABLED), | 38 QuicServerId("example.com", 80, false, PRIVACY_MODE_DISABLED), |
38 &crypto_config_); | 39 &crypto_config_); |
39 | 40 |
40 headers_.SetResponseFirstlineFromStringPieces("HTTP/1.1", "200", "Ok"); | 41 headers_.SetResponseFirstlineFromStringPieces("HTTP/1.1", "200", "Ok"); |
41 headers_.ReplaceOrAppendHeader("content-length", "11"); | 42 headers_.ReplaceOrAppendHeader("content-length", "11"); |
42 | 43 |
43 headers_string_ = SpdyUtils::SerializeResponseHeaders(headers_); | 44 headers_string_ = SpdyUtils::SerializeResponseHeaders(headers_); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 103 |
103 EXPECT_FALSE(stream_->write_side_closed()); | 104 EXPECT_FALSE(stream_->write_side_closed()); |
104 stream_->OnStreamFrame(frame); | 105 stream_->OnStreamFrame(frame); |
105 EXPECT_TRUE(stream_->write_side_closed()); | 106 EXPECT_TRUE(stream_->write_side_closed()); |
106 } | 107 } |
107 | 108 |
108 } // namespace | 109 } // namespace |
109 } // namespace test | 110 } // namespace test |
110 } // namespace tools | 111 } // namespace tools |
111 } // namespace net | 112 } // namespace net |
OLD | NEW |