| 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 // Common utilities for Quic tests | 5 // Common utilities for Quic tests |
| 6 | 6 |
| 7 #ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 7 #ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| 8 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 8 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| 9 | 9 |
| 10 #include "net/quic/congestion_control/quic_send_scheduler.h" | 10 #include "net/quic/congestion_control/quic_send_scheduler.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 MOCK_METHOD0(OnCanWrite, bool()); | 142 MOCK_METHOD0(OnCanWrite, bool()); |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 class PacketSavingConnection : public MockConnection { | 145 class PacketSavingConnection : public MockConnection { |
| 146 public: | 146 public: |
| 147 PacketSavingConnection(QuicGuid guid, IPEndPoint address); | 147 PacketSavingConnection(QuicGuid guid, IPEndPoint address); |
| 148 virtual ~PacketSavingConnection(); | 148 virtual ~PacketSavingConnection(); |
| 149 | 149 |
| 150 virtual bool SendPacket(QuicPacketSequenceNumber number, | 150 virtual bool SendPacket(QuicPacketSequenceNumber number, |
| 151 QuicPacket* packet, | 151 QuicPacket* packet, |
| 152 bool resend, | 152 bool should_resend, |
| 153 bool force) OVERRIDE; | 153 bool force, |
| 154 bool is_retransmit) OVERRIDE; |
| 154 | 155 |
| 155 std::vector<QuicPacket*> packets_; | 156 std::vector<QuicPacket*> packets_; |
| 156 }; | 157 }; |
| 157 | 158 |
| 158 class MockSession : public QuicSession { | 159 class MockSession : public QuicSession { |
| 159 public: | 160 public: |
| 160 MockSession(QuicConnection* connection, bool is_server); | 161 MockSession(QuicConnection* connection, bool is_server); |
| 161 ~MockSession(); | 162 ~MockSession(); |
| 162 | 163 |
| 163 MOCK_METHOD4(OnPacket, bool(const IPEndPoint& seld_address, | 164 MOCK_METHOD4(OnPacket, bool(const IPEndPoint& seld_address, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 174 MOCK_METHOD4(WriteData, int(QuicStreamId id, base::StringPiece data, | 175 MOCK_METHOD4(WriteData, int(QuicStreamId id, base::StringPiece data, |
| 175 QuicStreamOffset offset, bool fin)); | 176 QuicStreamOffset offset, bool fin)); |
| 176 MOCK_METHOD0(IsHandshakeComplete, bool()); | 177 MOCK_METHOD0(IsHandshakeComplete, bool()); |
| 177 }; | 178 }; |
| 178 | 179 |
| 179 } // namespace test | 180 } // namespace test |
| 180 | 181 |
| 181 } // namespace net | 182 } // namespace net |
| 182 | 183 |
| 183 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 184 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| OLD | NEW |