| 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 <stddef.h> | 10 #include <stddef.h> |
| 11 #include <stdint.h> | 11 #include <stdint.h> |
| 12 | 12 |
| 13 #include <cstdint> | 13 #include <cstdint> |
| 14 #include <memory> | 14 #include <memory> |
| 15 #include <string> | 15 #include <string> |
| 16 #include <vector> | 16 #include <vector> |
| 17 | 17 |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/strings/string_piece.h" | 19 #include "base/strings/string_piece.h" |
| 20 #include "net/base/ip_address.h" | 20 #include "net/base/ip_address.h" |
| 21 #include "net/quic/congestion_control/loss_detection_interface.h" | 21 #include "net/quic/congestion_control/loss_detection_interface.h" |
| 22 #include "net/quic/congestion_control/send_algorithm_interface.h" | 22 #include "net/quic/congestion_control/send_algorithm_interface.h" |
| 23 #include "net/quic/quic_client_push_promise_index.h" | 23 #include "net/quic/quic_client_push_promise_index.h" |
| 24 #include "net/quic/quic_connection.h" | 24 #include "net/quic/quic_connection.h" |
| 25 #include "net/quic/quic_framer.h" | 25 #include "net/quic/quic_framer.h" |
| 26 #include "net/quic/quic_protocol.h" | 26 #include "net/quic/quic_protocol.h" |
| 27 #include "net/quic/quic_sent_packet_manager.h" | 27 #include "net/quic/quic_sent_packet_manager_interface.h" |
| 28 #include "net/quic/quic_session.h" | 28 #include "net/quic/quic_session.h" |
| 29 #include "net/quic/quic_simple_buffer_allocator.h" | 29 #include "net/quic/quic_simple_buffer_allocator.h" |
| 30 #include "net/quic/test_tools/mock_clock.h" | 30 #include "net/quic/test_tools/mock_clock.h" |
| 31 #include "net/quic/test_tools/mock_random.h" | 31 #include "net/quic/test_tools/mock_random.h" |
| 32 #include "net/spdy/spdy_framer.h" | 32 #include "net/spdy/spdy_framer.h" |
| 33 #include "net/tools/quic/quic_dispatcher.h" | 33 #include "net/tools/quic/quic_dispatcher.h" |
| 34 #include "net/tools/quic/quic_per_connection_packet_writer.h" | 34 #include "net/tools/quic/quic_per_connection_packet_writer.h" |
| 35 #include "net/tools/quic/quic_server_session_base.h" | 35 #include "net/tools/quic/quic_server_session_base.h" |
| 36 #include "net/tools/quic/test_tools/mock_quic_server_session_visitor.h" | 36 #include "net/tools/quic/test_tools/mock_quic_server_session_visitor.h" |
| 37 #include "testing/gmock/include/gmock/gmock.h" | 37 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 | 799 |
| 800 protected: | 800 protected: |
| 801 // Object is ref counted. | 801 // Object is ref counted. |
| 802 ~MockAckListener() override; | 802 ~MockAckListener() override; |
| 803 | 803 |
| 804 private: | 804 private: |
| 805 DISALLOW_COPY_AND_ASSIGN(MockAckListener); | 805 DISALLOW_COPY_AND_ASSIGN(MockAckListener); |
| 806 }; | 806 }; |
| 807 | 807 |
| 808 class MockNetworkChangeVisitor | 808 class MockNetworkChangeVisitor |
| 809 : public QuicSentPacketManager::NetworkChangeVisitor { | 809 : public QuicSentPacketManagerInterface::NetworkChangeVisitor { |
| 810 public: | 810 public: |
| 811 MockNetworkChangeVisitor(); | 811 MockNetworkChangeVisitor(); |
| 812 ~MockNetworkChangeVisitor() override; | 812 ~MockNetworkChangeVisitor() override; |
| 813 | 813 |
| 814 MOCK_METHOD0(OnCongestionChange, void()); | 814 MOCK_METHOD0(OnCongestionChange, void()); |
| 815 MOCK_METHOD0(OnPathDegrading, void()); | 815 MOCK_METHOD0(OnPathDegrading, void()); |
| 816 | 816 |
| 817 private: | 817 private: |
| 818 DISALLOW_COPY_AND_ASSIGN(MockNetworkChangeVisitor); | 818 DISALLOW_COPY_AND_ASSIGN(MockNetworkChangeVisitor); |
| 819 }; | 819 }; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 TestQuicSpdyServerSession** server_session); | 931 TestQuicSpdyServerSession** server_session); |
| 932 | 932 |
| 933 // Helper to generate client side stream ids, generalizes | 933 // Helper to generate client side stream ids, generalizes |
| 934 // kClientDataStreamId1 etc. above. | 934 // kClientDataStreamId1 etc. above. |
| 935 QuicStreamId QuicClientDataStreamId(int i); | 935 QuicStreamId QuicClientDataStreamId(int i); |
| 936 | 936 |
| 937 } // namespace test | 937 } // namespace test |
| 938 } // namespace net | 938 } // namespace net |
| 939 | 939 |
| 940 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 940 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| OLD | NEW |