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_simple_server_stream.h" | 5 #include "net/tools/quic/quic_simple_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_flags.h" | 10 #include "net/quic/quic_flags.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 public: | 84 public: |
85 const size_t kMaxStreamsForTest = 100; | 85 const size_t kMaxStreamsForTest = 100; |
86 | 86 |
87 explicit MockQuicSimpleServerSession(QuicConnection* connection, | 87 explicit MockQuicSimpleServerSession(QuicConnection* connection, |
88 MockQuicServerSessionVisitor* owner, | 88 MockQuicServerSessionVisitor* owner, |
89 QuicCryptoServerConfig* crypto_config) | 89 QuicCryptoServerConfig* crypto_config) |
90 : QuicSimpleServerSession(::net::test::DefaultQuicConfig(), | 90 : QuicSimpleServerSession(::net::test::DefaultQuicConfig(), |
91 connection, | 91 connection, |
92 owner, | 92 owner, |
93 crypto_config) { | 93 crypto_config) { |
94 set_max_open_streams(kMaxStreamsForTest); | 94 set_max_open_incoming_streams(kMaxStreamsForTest); |
| 95 set_max_open_outgoing_streams(kMaxStreamsForTest); |
95 ON_CALL(*this, WritevData(_, _, _, _, _, _)) | 96 ON_CALL(*this, WritevData(_, _, _, _, _, _)) |
96 .WillByDefault(testing::Return(QuicConsumedData(0, false))); | 97 .WillByDefault(testing::Return(QuicConsumedData(0, false))); |
97 } | 98 } |
98 | 99 |
99 ~MockQuicSimpleServerSession() override {} | 100 ~MockQuicSimpleServerSession() override {} |
100 | 101 |
101 MOCK_METHOD2(OnConnectionClosed, void(QuicErrorCode error, bool from_peer)); | 102 MOCK_METHOD2(OnConnectionClosed, void(QuicErrorCode error, bool from_peer)); |
102 MOCK_METHOD1(CreateIncomingDynamicStream, QuicSpdyStream*(QuicStreamId id)); | 103 MOCK_METHOD1(CreateIncomingDynamicStream, QuicSpdyStream*(QuicStreamId id)); |
103 MOCK_METHOD6(WritevData, | 104 MOCK_METHOD6(WritevData, |
104 QuicConsumedData(QuicStreamId id, | 105 QuicConsumedData(QuicStreamId id, |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 }; | 594 }; |
594 StringPiece data(arr, arraysize(arr)); | 595 StringPiece data(arr, arraysize(arr)); |
595 QuicStreamFrame frame(stream_->id(), true, 0, data); | 596 QuicStreamFrame frame(stream_->id(), true, 0, data); |
596 // Verify that we don't crash when we get a invalid headers in stream frame. | 597 // Verify that we don't crash when we get a invalid headers in stream frame. |
597 stream_->OnStreamFrame(frame); | 598 stream_->OnStreamFrame(frame); |
598 } | 599 } |
599 | 600 |
600 } // namespace | 601 } // namespace |
601 } // namespace test | 602 } // namespace test |
602 } // namespace net | 603 } // namespace net |
OLD | NEW |