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 <list> | 7 #include <list> |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "net/quic/core/quic_utils.h" | 11 #include "net/quic/core/quic_utils.h" |
12 #include "net/quic/core/spdy_utils.h" | 12 #include "net/quic/core/spdy_utils.h" |
13 #include "net/quic/platform/api/quic_ptr_util.h" | 13 #include "net/quic/platform/api/quic_ptr_util.h" |
14 #include "net/quic/platform/api/quic_socket_address.h" | 14 #include "net/quic/platform/api/quic_socket_address.h" |
| 15 #include "net/quic/platform/api/quic_test.h" |
15 #include "net/quic/test_tools/crypto_test_utils.h" | 16 #include "net/quic/test_tools/crypto_test_utils.h" |
16 #include "net/quic/test_tools/quic_stream_peer.h" | 17 #include "net/quic/test_tools/quic_stream_peer.h" |
17 #include "net/quic/test_tools/quic_test_utils.h" | 18 #include "net/quic/test_tools/quic_test_utils.h" |
18 #include "net/test/gtest_util.h" | 19 #include "net/test/gtest_util.h" |
19 #include "net/tools/quic/quic_http_response_cache.h" | 20 #include "net/tools/quic/quic_http_response_cache.h" |
20 #include "net/tools/quic/quic_simple_server_session.h" | 21 #include "net/tools/quic/quic_simple_server_session.h" |
21 #include "testing/gmock/include/gmock/gmock.h" | 22 #include "testing/gmock/include/gmock/gmock.h" |
22 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
23 | 24 |
24 using std::string; | 25 using std::string; |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 const SpdyHeaderBlock&)); | 158 const SpdyHeaderBlock&)); |
158 | 159 |
159 using QuicSession::ActivateStream; | 160 using QuicSession::ActivateStream; |
160 | 161 |
161 SpdyHeaderBlock original_request_headers_; | 162 SpdyHeaderBlock original_request_headers_; |
162 | 163 |
163 private: | 164 private: |
164 DISALLOW_COPY_AND_ASSIGN(MockQuicSimpleServerSession); | 165 DISALLOW_COPY_AND_ASSIGN(MockQuicSimpleServerSession); |
165 }; | 166 }; |
166 | 167 |
167 class QuicSimpleServerStreamTest | 168 class QuicSimpleServerStreamTest : public QuicTestWithParam<QuicVersion> { |
168 : public ::testing::TestWithParam<QuicVersion> { | |
169 public: | 169 public: |
170 QuicSimpleServerStreamTest() | 170 QuicSimpleServerStreamTest() |
171 : connection_( | 171 : connection_( |
172 new StrictMock<MockQuicConnection>(&helper_, | 172 new StrictMock<MockQuicConnection>(&helper_, |
173 &alarm_factory_, | 173 &alarm_factory_, |
174 Perspective::IS_SERVER, | 174 Perspective::IS_SERVER, |
175 SupportedVersions(GetParam()))), | 175 SupportedVersions(GetParam()))), |
176 crypto_config_(new QuicCryptoServerConfig( | 176 crypto_config_(new QuicCryptoServerConfig( |
177 QuicCryptoServerConfig::TESTING, | 177 QuicCryptoServerConfig::TESTING, |
178 QuicRandom::GetInstance(), | 178 QuicRandom::GetInstance(), |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 }; | 638 }; |
639 QuicStringPiece data(arr, arraysize(arr)); | 639 QuicStringPiece data(arr, arraysize(arr)); |
640 QuicStreamFrame frame(stream_->id(), true, 0, data); | 640 QuicStreamFrame frame(stream_->id(), true, 0, data); |
641 // Verify that we don't crash when we get a invalid headers in stream frame. | 641 // Verify that we don't crash when we get a invalid headers in stream frame. |
642 stream_->OnStreamFrame(frame); | 642 stream_->OnStreamFrame(frame); |
643 } | 643 } |
644 | 644 |
645 } // namespace | 645 } // namespace |
646 } // namespace test | 646 } // namespace test |
647 } // namespace net | 647 } // namespace net |
OLD | NEW |