| 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/quic_session.h" | 5 #include "net/quic/quic_session.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| 11 #include "base/rand_util.h" | 11 #include "base/rand_util.h" |
| 12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 14 #include "net/quic/crypto/crypto_protocol.h" | 14 #include "net/quic/crypto/crypto_protocol.h" |
| 15 #include "net/quic/quic_crypto_stream.h" | 15 #include "net/quic/quic_crypto_stream.h" |
| 16 #include "net/quic/quic_flags.h" | 16 #include "net/quic/quic_flags.h" |
| 17 #include "net/quic/quic_protocol.h" | 17 #include "net/quic/quic_protocol.h" |
| 18 #include "net/quic/quic_utils.h" | 18 #include "net/quic/quic_utils.h" |
| 19 #include "net/quic/reliable_quic_stream.h" | 19 #include "net/quic/reliable_quic_stream.h" |
| 20 #include "net/quic/test_tools/quic_config_peer.h" | 20 #include "net/quic/test_tools/quic_config_peer.h" |
| 21 #include "net/quic/test_tools/quic_connection_peer.h" | 21 #include "net/quic/test_tools/quic_connection_peer.h" |
| 22 #include "net/quic/test_tools/quic_data_stream_peer.h" | |
| 23 #include "net/quic/test_tools/quic_flow_controller_peer.h" | 22 #include "net/quic/test_tools/quic_flow_controller_peer.h" |
| 24 #include "net/quic/test_tools/quic_session_peer.h" | 23 #include "net/quic/test_tools/quic_session_peer.h" |
| 25 #include "net/quic/test_tools/quic_spdy_session_peer.h" | 24 #include "net/quic/test_tools/quic_spdy_session_peer.h" |
| 25 #include "net/quic/test_tools/quic_spdy_stream_peer.h" |
| 26 #include "net/quic/test_tools/quic_test_utils.h" | 26 #include "net/quic/test_tools/quic_test_utils.h" |
| 27 #include "net/quic/test_tools/reliable_quic_stream_peer.h" | 27 #include "net/quic/test_tools/reliable_quic_stream_peer.h" |
| 28 #include "net/spdy/spdy_framer.h" | 28 #include "net/spdy/spdy_framer.h" |
| 29 #include "net/test/gtest_util.h" | 29 #include "net/test/gtest_util.h" |
| 30 #include "testing/gmock/include/gmock/gmock.h" | 30 #include "testing/gmock/include/gmock/gmock.h" |
| 31 #include "testing/gmock_mutant.h" | 31 #include "testing/gmock_mutant.h" |
| 32 #include "testing/gtest/include/gtest/gtest.h" | 32 #include "testing/gtest/include/gtest/gtest.h" |
| 33 | 33 |
| 34 using base::hash_map; | 34 using base::hash_map; |
| 35 using std::set; | 35 using std::set; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 class TestHeadersStream : public QuicHeadersStream { | 78 class TestHeadersStream : public QuicHeadersStream { |
| 79 public: | 79 public: |
| 80 explicit TestHeadersStream(QuicSpdySession* session) | 80 explicit TestHeadersStream(QuicSpdySession* session) |
| 81 : QuicHeadersStream(session) {} | 81 : QuicHeadersStream(session) {} |
| 82 | 82 |
| 83 MOCK_METHOD0(OnCanWrite, void()); | 83 MOCK_METHOD0(OnCanWrite, void()); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 class TestStream : public QuicDataStream { | 86 class TestStream : public QuicSpdyStream { |
| 87 public: | 87 public: |
| 88 TestStream(QuicStreamId id, QuicSpdySession* session) | 88 TestStream(QuicStreamId id, QuicSpdySession* session) |
| 89 : QuicDataStream(id, session) {} | 89 : QuicSpdyStream(id, session) {} |
| 90 | 90 |
| 91 using ReliableQuicStream::CloseWriteSide; | 91 using ReliableQuicStream::CloseWriteSide; |
| 92 | 92 |
| 93 void OnDataAvailable() override {} | 93 void OnDataAvailable() override {} |
| 94 | 94 |
| 95 void SendBody(const string& data, bool fin) { | 95 void SendBody(const string& data, bool fin) { |
| 96 WriteOrBufferData(data, fin, nullptr); | 96 WriteOrBufferData(data, fin, nullptr); |
| 97 } | 97 } |
| 98 | 98 |
| 99 MOCK_METHOD0(OnCanWrite, void()); | 99 MOCK_METHOD0(OnCanWrite, void()); |
| (...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 // Verify that there is no entry for the stream in | 1073 // Verify that there is no entry for the stream in |
| 1074 // locally_closed_streams_highest_offset_. | 1074 // locally_closed_streams_highest_offset_. |
| 1075 EXPECT_EQ( | 1075 EXPECT_EQ( |
| 1076 FLAGS_quic_fix_fin_accounting ? 0u : 1u, | 1076 FLAGS_quic_fix_fin_accounting ? 0u : 1u, |
| 1077 QuicSessionPeer::GetLocallyClosedStreamsHighestOffset(&session_).size()); | 1077 QuicSessionPeer::GetLocallyClosedStreamsHighestOffset(&session_).size()); |
| 1078 } | 1078 } |
| 1079 | 1079 |
| 1080 } // namespace | 1080 } // namespace |
| 1081 } // namespace test | 1081 } // namespace test |
| 1082 } // namespace net | 1082 } // namespace net |
| OLD | NEW |