OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_server_stream.h" | 5 #include "net/tools/quic/quic_spdy_server_stream.h" |
6 | 6 |
7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "base/strings/string_piece.h" | 8 #include "base/strings/string_piece.h" |
9 #include "net/quic/quic_connection.h" | 9 #include "net/quic/quic_connection.h" |
10 #include "net/quic/quic_protocol.h" | 10 #include "net/quic/quic_protocol.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 static const BalsaHeaders& headers(QuicSpdyServerStream* stream) { | 65 static const BalsaHeaders& headers(QuicSpdyServerStream* stream) { |
66 return stream->headers_; | 66 return stream->headers_; |
67 } | 67 } |
68 }; | 68 }; |
69 | 69 |
70 namespace { | 70 namespace { |
71 | 71 |
72 class QuicSpdyServerStreamTest : public ::testing::TestWithParam<QuicVersion> { | 72 class QuicSpdyServerStreamTest : public ::testing::TestWithParam<QuicVersion> { |
73 public: | 73 public: |
74 QuicSpdyServerStreamTest() | 74 QuicSpdyServerStreamTest() |
75 : connection_(new StrictMock<MockConnection>( | 75 : connection_( |
76 true, SupportedVersions(GetParam()))), | 76 new StrictMock<MockConnection>(Perspective::IS_SERVER, |
| 77 SupportedVersions(GetParam()))), |
77 session_(connection_), | 78 session_(connection_), |
78 body_("hello world") { | 79 body_("hello world") { |
79 BalsaHeaders request_headers; | 80 BalsaHeaders request_headers; |
80 request_headers.SetRequestFirstlineFromStringPieces( | 81 request_headers.SetRequestFirstlineFromStringPieces( |
81 "POST", "https://www.google.com/", "HTTP/1.1"); | 82 "POST", "https://www.google.com/", "HTTP/1.1"); |
82 request_headers.ReplaceOrAppendHeader("content-length", "11"); | 83 request_headers.ReplaceOrAppendHeader("content-length", "11"); |
83 | 84 |
84 headers_string_ = SpdyUtils::SerializeRequestHeaders(request_headers); | 85 headers_string_ = SpdyUtils::SerializeRequestHeaders(request_headers); |
85 | 86 |
86 // New streams rely on having the peer's flow control receive window | 87 // New streams rely on having the peer's flow control receive window |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 StringPiece data(arr, arraysize(arr)); | 264 StringPiece data(arr, arraysize(arr)); |
264 QuicStreamFrame frame(stream_->id(), true, 0, MakeIOVector(data)); | 265 QuicStreamFrame frame(stream_->id(), true, 0, MakeIOVector(data)); |
265 // Verify that we don't crash when we get a invalid headers in stream frame. | 266 // Verify that we don't crash when we get a invalid headers in stream frame. |
266 stream_->OnStreamFrame(frame); | 267 stream_->OnStreamFrame(frame); |
267 } | 268 } |
268 | 269 |
269 } // namespace | 270 } // namespace |
270 } // namespace test | 271 } // namespace test |
271 } // namespace tools | 272 } // namespace tools |
272 } // namespace net | 273 } // namespace net |
OLD | NEW |