| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 BalsaHeaders* mutable_headers() { | 57 BalsaHeaders* mutable_headers() { |
| 58 return &headers_; | 58 return &headers_; |
| 59 } | 59 } |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 namespace { | 62 namespace { |
| 63 | 63 |
| 64 class QuicSpdyServerStreamTest : public ::testing::Test { | 64 class QuicSpdyServerStreamTest : public ::testing::Test { |
| 65 public: | 65 public: |
| 66 QuicSpdyServerStreamTest() | 66 QuicSpdyServerStreamTest() |
| 67 : session_(new MockConnection(true), true), | 67 : session_(new MockConnection(true)), |
| 68 body_("hello world") { | 68 body_("hello world") { |
| 69 BalsaHeaders request_headers; | 69 BalsaHeaders request_headers; |
| 70 request_headers.SetRequestFirstlineFromStringPieces( | 70 request_headers.SetRequestFirstlineFromStringPieces( |
| 71 "POST", "https://www.google.com/", "HTTP/1.1"); | 71 "POST", "https://www.google.com/", "HTTP/1.1"); |
| 72 request_headers.ReplaceOrAppendHeader("content-length", "11"); | 72 request_headers.ReplaceOrAppendHeader("content-length", "11"); |
| 73 | 73 |
| 74 headers_string_ = SpdyUtils::SerializeRequestHeaders(request_headers); | 74 headers_string_ = SpdyUtils::SerializeRequestHeaders(request_headers); |
| 75 stream_.reset(new QuicSpdyServerStreamPeer(3, &session_)); | 75 stream_.reset(new QuicSpdyServerStreamPeer(3, &session_)); |
| 76 } | 76 } |
| 77 | 77 |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 QuicStreamFrame frame( | 268 QuicStreamFrame frame( |
| 269 stream_->id(), true, 0, MakeIOVector(StringPiece(arr, arraysize(arr)))); | 269 stream_->id(), true, 0, MakeIOVector(StringPiece(arr, arraysize(arr)))); |
| 270 // Verify that we don't crash when we get a invalid headers in stream frame. | 270 // Verify that we don't crash when we get a invalid headers in stream frame. |
| 271 stream_->OnStreamFrame(frame); | 271 stream_->OnStreamFrame(frame); |
| 272 } | 272 } |
| 273 | 273 |
| 274 } // namespace | 274 } // namespace |
| 275 } // namespace test | 275 } // namespace test |
| 276 } // namespace tools | 276 } // namespace tools |
| 277 } // namespace net | 277 } // namespace net |
| OLD | NEW |