| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 QuicSpdyServerStream* stream) { | 43 QuicSpdyServerStream* stream) { |
| 44 return &(stream->headers_); | 44 return &(stream->headers_); |
| 45 } | 45 } |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 namespace { | 48 namespace { |
| 49 | 49 |
| 50 class QuicSpdyServerStreamTest : public ::testing::Test { | 50 class QuicSpdyServerStreamTest : public ::testing::Test { |
| 51 public: | 51 public: |
| 52 QuicSpdyServerStreamTest() | 52 QuicSpdyServerStreamTest() |
| 53 : session_(new MockConnection(1, IPEndPoint(), 0, &eps_, true), true), | 53 : session_(new MockConnection(1, IPEndPoint(), true), true), |
| 54 body_("hello world") { | 54 body_("hello world") { |
| 55 BalsaHeaders request_headers; | 55 BalsaHeaders request_headers; |
| 56 request_headers.SetRequestFirstlineFromStringPieces( | 56 request_headers.SetRequestFirstlineFromStringPieces( |
| 57 "POST", "https://www.google.com/", "HTTP/1.1"); | 57 "POST", "https://www.google.com/", "HTTP/1.1"); |
| 58 request_headers.ReplaceOrAppendHeader("content-length", "11"); | 58 request_headers.ReplaceOrAppendHeader("content-length", "11"); |
| 59 | 59 |
| 60 headers_string_ = SpdyUtils::SerializeRequestHeaders(request_headers); | 60 headers_string_ = SpdyUtils::SerializeRequestHeaders(request_headers); |
| 61 stream_.reset(new QuicSpdyServerStream(3, &session_)); | 61 stream_.reset(new QuicSpdyServerStream(3, &session_)); |
| 62 } | 62 } |
| 63 | 63 |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 QuicStreamFrame frame( | 255 QuicStreamFrame frame( |
| 256 stream_->id(), true, 0, MakeIOVector(StringPiece(arr, arraysize(arr)))); | 256 stream_->id(), true, 0, MakeIOVector(StringPiece(arr, arraysize(arr)))); |
| 257 // Verify that we don't crash when we get a invalid headers in stream frame. | 257 // Verify that we don't crash when we get a invalid headers in stream frame. |
| 258 stream_->OnStreamFrame(frame); | 258 stream_->OnStreamFrame(frame); |
| 259 } | 259 } |
| 260 | 260 |
| 261 } // namespace | 261 } // namespace |
| 262 } // namespace test | 262 } // namespace test |
| 263 } // namespace tools | 263 } // namespace tools |
| 264 } // namespace net | 264 } // namespace net |
| OLD | NEW |