| 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_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 7 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| 8 #define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 8 #define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 TestWriterFactory* factory_; | 214 TestWriterFactory* factory_; |
| 215 }; | 215 }; |
| 216 | 216 |
| 217 // If an asynchronous write is happening and |writer| gets deleted, this | 217 // If an asynchronous write is happening and |writer| gets deleted, this |
| 218 // clears the pointer to it to prevent use-after-free. | 218 // clears the pointer to it to prevent use-after-free. |
| 219 void Unregister(PerConnectionPacketWriter* writer); | 219 void Unregister(PerConnectionPacketWriter* writer); |
| 220 | 220 |
| 221 PerConnectionPacketWriter* current_writer_; | 221 PerConnectionPacketWriter* current_writer_; |
| 222 }; | 222 }; |
| 223 | 223 |
| 224 class MockTimeWaitListManager : public QuicTimeWaitListManager { |
| 225 public: |
| 226 MockTimeWaitListManager(QuicPacketWriter* writer, |
| 227 QuicServerSessionVisitor* visitor, |
| 228 EpollServer* eps); |
| 229 ~MockTimeWaitListManager() override; |
| 230 |
| 231 MOCK_METHOD5(ProcessPacket, |
| 232 void(const IPEndPoint& server_address, |
| 233 const IPEndPoint& client_address, |
| 234 QuicConnectionId connection_id, |
| 235 QuicPacketSequenceNumber sequence_number, |
| 236 const QuicEncryptedPacket& packet)); |
| 237 }; |
| 238 |
| 224 } // namespace test | 239 } // namespace test |
| 225 } // namespace tools | 240 } // namespace tools |
| 226 } // namespace net | 241 } // namespace net |
| 227 | 242 |
| 228 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 243 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| OLD | NEW |