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 11 matching lines...) Expand all Loading... |
22 using net::test::MockSession; | 22 using net::test::MockSession; |
23 using net::test::SupportedVersions; | 23 using net::test::SupportedVersions; |
24 using net::tools::test::MockConnection; | 24 using net::tools::test::MockConnection; |
25 using std::string; | 25 using std::string; |
26 using testing::_; | 26 using testing::_; |
27 using testing::AnyNumber; | 27 using testing::AnyNumber; |
28 using testing::Invoke; | 28 using testing::Invoke; |
29 using testing::InvokeArgument; | 29 using testing::InvokeArgument; |
30 using testing::InSequence; | 30 using testing::InSequence; |
31 using testing::Return; | 31 using testing::Return; |
32 using testing::StrEq; | |
33 using testing::StrictMock; | 32 using testing::StrictMock; |
34 using testing::WithArgs; | 33 using testing::WithArgs; |
35 | 34 |
36 namespace net { | 35 namespace net { |
37 namespace tools { | 36 namespace tools { |
38 namespace test { | 37 namespace test { |
39 | 38 |
40 class QuicSpdyServerStreamPeer : public QuicSpdyServerStream { | 39 class QuicSpdyServerStreamPeer : public QuicSpdyServerStream { |
41 public: | 40 public: |
42 QuicSpdyServerStreamPeer(QuicStreamId stream_id, QuicSession* session) | 41 QuicSpdyServerStreamPeer(QuicStreamId stream_id, QuicSession* session) |
43 : QuicSpdyServerStream(stream_id, session) { | 42 : QuicSpdyServerStream(stream_id, session) { |
44 } | 43 } |
45 | 44 |
46 using QuicSpdyServerStream::SendResponse; | 45 using QuicSpdyServerStream::SendResponse; |
47 using QuicSpdyServerStream::SendErrorResponse; | 46 using QuicSpdyServerStream::SendErrorResponse; |
48 | 47 |
49 const string& body() { | |
50 return body_; | |
51 } | |
52 | |
53 const BalsaHeaders& headers() { | |
54 return headers_; | |
55 } | |
56 | |
57 BalsaHeaders* mutable_headers() { | 48 BalsaHeaders* mutable_headers() { |
58 return &headers_; | 49 return &headers_; |
59 } | 50 } |
60 | 51 |
61 static void SendResponse(QuicSpdyServerStream* stream) { | 52 static void SendResponse(QuicSpdyServerStream* stream) { |
62 stream->SendResponse(); | 53 stream->SendResponse(); |
63 } | 54 } |
64 | 55 |
65 static void SendErrorResponse(QuicSpdyServerStream* stream) { | 56 static void SendErrorResponse(QuicSpdyServerStream* stream) { |
66 stream->SendResponse(); | 57 stream->SendResponse(); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 StringPiece data(arr, arraysize(arr)); | 259 StringPiece data(arr, arraysize(arr)); |
269 QuicStreamFrame frame(stream_->id(), true, 0, MakeIOVector(data)); | 260 QuicStreamFrame frame(stream_->id(), true, 0, MakeIOVector(data)); |
270 // Verify that we don't crash when we get a invalid headers in stream frame. | 261 // Verify that we don't crash when we get a invalid headers in stream frame. |
271 stream_->OnStreamFrame(frame); | 262 stream_->OnStreamFrame(frame); |
272 } | 263 } |
273 | 264 |
274 } // namespace | 265 } // namespace |
275 } // namespace test | 266 } // namespace test |
276 } // namespace tools | 267 } // namespace tools |
277 } // namespace net | 268 } // namespace net |
OLD | NEW |