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/quic_reliable_client_stream.h" | 5 #include "net/quic/quic_reliable_client_stream.h" |
6 | 6 |
7 #include "net/base/net_errors.h" | 7 #include "net/base/net_errors.h" |
8 #include "net/base/test_completion_callback.h" | 8 #include "net/base/test_completion_callback.h" |
9 #include "net/quic/quic_client_session.h" | 9 #include "net/quic/quic_client_session.h" |
10 #include "net/quic/quic_utils.h" | 10 #include "net/quic/quic_utils.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 MOCK_METHOD0(HasSendHeadersComplete, bool()); | 35 MOCK_METHOD0(HasSendHeadersComplete, bool()); |
36 | 36 |
37 private: | 37 private: |
38 DISALLOW_COPY_AND_ASSIGN(MockDelegate); | 38 DISALLOW_COPY_AND_ASSIGN(MockDelegate); |
39 }; | 39 }; |
40 | 40 |
41 class QuicReliableClientStreamTest | 41 class QuicReliableClientStreamTest |
42 : public ::testing::TestWithParam<QuicVersion> { | 42 : public ::testing::TestWithParam<QuicVersion> { |
43 public: | 43 public: |
44 QuicReliableClientStreamTest() | 44 QuicReliableClientStreamTest() |
45 : session_(new MockConnection(false, SupportedVersions(GetParam()))) { | 45 : session_(new MockConnection(Perspective::IS_CLIENT, |
| 46 SupportedVersions(GetParam()))) { |
46 stream_ = new QuicReliableClientStream(kStreamId, &session_, BoundNetLog()); | 47 stream_ = new QuicReliableClientStream(kStreamId, &session_, BoundNetLog()); |
47 session_.ActivateStream(stream_); | 48 session_.ActivateStream(stream_); |
48 stream_->SetDelegate(&delegate_); | 49 stream_->SetDelegate(&delegate_); |
49 } | 50 } |
50 | 51 |
51 void InitializeHeaders() { | 52 void InitializeHeaders() { |
52 headers_[":host"] = "www.google.com"; | 53 headers_[":host"] = "www.google.com"; |
53 headers_[":path"] = "/index.hml"; | 54 headers_[":path"] = "/index.hml"; |
54 headers_[":scheme"] = "https"; | 55 headers_[":scheme"] = "https"; |
55 headers_["cookie"] = | 56 headers_["cookie"] = |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 EXPECT_CALL(session_, WritevData(stream_->id(), _, _, _, _, _)).WillOnce( | 165 EXPECT_CALL(session_, WritevData(stream_->id(), _, _, _, _, _)).WillOnce( |
165 Return(QuicConsumedData(kDataLen, true))); | 166 Return(QuicConsumedData(kDataLen, true))); |
166 stream_->OnCanWrite(); | 167 stream_->OnCanWrite(); |
167 ASSERT_TRUE(callback.have_result()); | 168 ASSERT_TRUE(callback.have_result()); |
168 EXPECT_EQ(OK, callback.WaitForResult()); | 169 EXPECT_EQ(OK, callback.WaitForResult()); |
169 } | 170 } |
170 | 171 |
171 } // namespace | 172 } // namespace |
172 } // namespace test | 173 } // namespace test |
173 } // namespace net | 174 } // namespace net |
OLD | NEW |