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 12 matching lines...) Expand all Loading... |
23 using net::test::MockSession; | 23 using net::test::MockSession; |
24 using net::test::SupportedVersions; | 24 using net::test::SupportedVersions; |
25 using net::tools::test::MockConnection; | 25 using net::tools::test::MockConnection; |
26 using std::string; | 26 using std::string; |
27 using testing::_; | 27 using testing::_; |
28 using testing::AnyNumber; | 28 using testing::AnyNumber; |
29 using testing::Invoke; | 29 using testing::Invoke; |
30 using testing::InvokeArgument; | 30 using testing::InvokeArgument; |
31 using testing::InSequence; | 31 using testing::InSequence; |
32 using testing::Return; | 32 using testing::Return; |
33 using testing::StrEq; | |
34 using testing::StrictMock; | 33 using testing::StrictMock; |
35 using testing::WithArgs; | 34 using testing::WithArgs; |
36 | 35 |
37 namespace net { | 36 namespace net { |
38 namespace tools { | 37 namespace tools { |
39 namespace test { | 38 namespace test { |
40 | 39 |
41 class QuicSpdyServerStreamPeer : public QuicSpdyServerStream { | 40 class QuicSpdyServerStreamPeer : public QuicSpdyServerStream { |
42 public: | 41 public: |
43 QuicSpdyServerStreamPeer(QuicStreamId stream_id, QuicSession* session) | 42 QuicSpdyServerStreamPeer(QuicStreamId stream_id, QuicSession* session) |
44 : QuicSpdyServerStream(stream_id, session) { | 43 : QuicSpdyServerStream(stream_id, session) { |
45 } | 44 } |
46 | 45 |
47 using QuicSpdyServerStream::SendResponse; | 46 using QuicSpdyServerStream::SendResponse; |
48 using QuicSpdyServerStream::SendErrorResponse; | 47 using QuicSpdyServerStream::SendErrorResponse; |
49 | 48 |
50 const string& body() { | |
51 return body_; | |
52 } | |
53 | |
54 const BalsaHeaders& headers() { | |
55 return headers_; | |
56 } | |
57 | |
58 BalsaHeaders* mutable_headers() { | 49 BalsaHeaders* mutable_headers() { |
59 return &headers_; | 50 return &headers_; |
60 } | 51 } |
61 | 52 |
62 static void SendResponse(QuicSpdyServerStream* stream) { | 53 static void SendResponse(QuicSpdyServerStream* stream) { |
63 stream->SendResponse(); | 54 stream->SendResponse(); |
64 } | 55 } |
65 | 56 |
66 static void SendErrorResponse(QuicSpdyServerStream* stream) { | 57 static void SendErrorResponse(QuicSpdyServerStream* stream) { |
67 stream->SendResponse(); | 58 stream->SendResponse(); |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 StringPiece data(arr + start, arraysize(arr) - start); | 296 StringPiece data(arr + start, arraysize(arr) - start); |
306 QuicStreamFrame frame(stream_->id(), true, 0, MakeIOVector(data)); | 297 QuicStreamFrame frame(stream_->id(), true, 0, MakeIOVector(data)); |
307 // Verify that we don't crash when we get a invalid headers in stream frame. | 298 // Verify that we don't crash when we get a invalid headers in stream frame. |
308 stream_->OnStreamFrame(frame); | 299 stream_->OnStreamFrame(frame); |
309 } | 300 } |
310 | 301 |
311 } // namespace | 302 } // namespace |
312 } // namespace test | 303 } // namespace test |
313 } // namespace tools | 304 } // namespace tools |
314 } // namespace net | 305 } // namespace net |
OLD | NEW |