OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/quic/core/quic_stream.h" | 5 #include "net/quic/core/quic_stream.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "net/quic/core/quic_connection.h" | 9 #include "net/quic/core/quic_connection.h" |
10 #include "net/quic/core/quic_utils.h" | 10 #include "net/quic/core/quic_utils.h" |
11 #include "net/quic/core/quic_write_blocked_list.h" | 11 #include "net/quic/core/quic_write_blocked_list.h" |
12 #include "net/quic/core/spdy_utils.h" | 12 #include "net/quic/core/spdy_utils.h" |
13 #include "net/quic/platform/api/quic_flags.h" | 13 #include "net/quic/platform/api/quic_flags.h" |
14 #include "net/quic/platform/api/quic_logging.h" | 14 #include "net/quic/platform/api/quic_logging.h" |
15 #include "net/quic/platform/api/quic_ptr_util.h" | 15 #include "net/quic/platform/api/quic_ptr_util.h" |
| 16 #include "net/quic/platform/api/quic_test.h" |
16 #include "net/quic/test_tools/quic_config_peer.h" | 17 #include "net/quic/test_tools/quic_config_peer.h" |
17 #include "net/quic/test_tools/quic_connection_peer.h" | 18 #include "net/quic/test_tools/quic_connection_peer.h" |
18 #include "net/quic/test_tools/quic_flow_controller_peer.h" | 19 #include "net/quic/test_tools/quic_flow_controller_peer.h" |
19 #include "net/quic/test_tools/quic_session_peer.h" | 20 #include "net/quic/test_tools/quic_session_peer.h" |
20 #include "net/quic/test_tools/quic_stream_peer.h" | 21 #include "net/quic/test_tools/quic_stream_peer.h" |
21 #include "net/quic/test_tools/quic_test_utils.h" | 22 #include "net/quic/test_tools/quic_test_utils.h" |
22 #include "net/test/gtest_util.h" | 23 #include "net/test/gtest_util.h" |
23 #include "testing/gmock/include/gmock/gmock.h" | |
24 #include "testing/gmock_mutant.h" | 24 #include "testing/gmock_mutant.h" |
25 | 25 |
26 using std::string; | 26 using std::string; |
27 using testing::AnyNumber; | 27 using testing::AnyNumber; |
28 using testing::AtLeast; | 28 using testing::AtLeast; |
29 using testing::CreateFunctor; | 29 using testing::CreateFunctor; |
30 using testing::InSequence; | 30 using testing::InSequence; |
31 using testing::Invoke; | 31 using testing::Invoke; |
32 using testing::DoAll; | 32 using testing::DoAll; |
33 using testing::Return; | 33 using testing::Return; |
(...skipping 27 matching lines...) Expand all Loading... |
61 | 61 |
62 using QuicStream::WriteOrBufferData; | 62 using QuicStream::WriteOrBufferData; |
63 using QuicStream::CloseWriteSide; | 63 using QuicStream::CloseWriteSide; |
64 using QuicStream::OnClose; | 64 using QuicStream::OnClose; |
65 | 65 |
66 private: | 66 private: |
67 bool should_process_data_; | 67 bool should_process_data_; |
68 string data_; | 68 string data_; |
69 }; | 69 }; |
70 | 70 |
71 class QuicStreamTest : public ::testing::TestWithParam<bool> { | 71 class QuicStreamTest : public QuicTestWithParam<bool> { |
72 public: | 72 public: |
73 QuicStreamTest() | 73 QuicStreamTest() |
74 : initial_flow_control_window_bytes_(kMaxPacketSize), | 74 : initial_flow_control_window_bytes_(kMaxPacketSize), |
75 zero_(QuicTime::Delta::Zero()), | 75 zero_(QuicTime::Delta::Zero()), |
76 supported_versions_(AllSupportedVersions()) { | 76 supported_versions_(AllSupportedVersions()) { |
77 headers_[":host"] = "www.google.com"; | 77 headers_[":host"] = "www.google.com"; |
78 headers_[":path"] = "/index.hml"; | 78 headers_[":path"] = "/index.hml"; |
79 headers_[":scheme"] = "https"; | 79 headers_[":scheme"] = "https"; |
80 headers_["cookie"] = | 80 headers_["cookie"] = |
81 "__utma=208381060.1228362404.1372200928.1372200928.1372200928.1; " | 81 "__utma=208381060.1228362404.1372200928.1372200928.1372200928.1; " |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 // Receive remaining data and FIN for the request. | 710 // Receive remaining data and FIN for the request. |
711 QuicStreamFrame frame2(stream_->id(), true, 0, QuicStringPiece("End")); | 711 QuicStreamFrame frame2(stream_->id(), true, 0, QuicStringPiece("End")); |
712 stream_->OnStreamFrame(frame2); | 712 stream_->OnStreamFrame(frame2); |
713 EXPECT_TRUE(stream_->fin_received()); | 713 EXPECT_TRUE(stream_->fin_received()); |
714 EXPECT_TRUE(stream_->HasFinalReceivedByteOffset()); | 714 EXPECT_TRUE(stream_->HasFinalReceivedByteOffset()); |
715 } | 715 } |
716 | 716 |
717 } // namespace | 717 } // namespace |
718 } // namespace test | 718 } // namespace test |
719 } // namespace net | 719 } // namespace net |
OLD | NEW |