| 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 <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" |
| 13 #include "base/strings/string_piece.h" | 14 #include "base/strings/string_piece.h" |
| 14 #include "net/quic/congestion_control/loss_detection_interface.h" | 15 #include "net/quic/congestion_control/loss_detection_interface.h" |
| 15 #include "net/quic/congestion_control/send_algorithm_interface.h" | 16 #include "net/quic/congestion_control/send_algorithm_interface.h" |
| 16 #include "net/quic/quic_ack_notifier.h" | 17 #include "net/quic/quic_ack_notifier.h" |
| 17 #include "net/quic/quic_client_session_base.h" | 18 #include "net/quic/quic_client_session_base.h" |
| 18 #include "net/quic/quic_connection.h" | 19 #include "net/quic/quic_connection.h" |
| 19 #include "net/quic/quic_dispatcher.h" | 20 #include "net/quic/quic_dispatcher.h" |
| 20 #include "net/quic/quic_framer.h" | 21 #include "net/quic/quic_framer.h" |
| 21 #include "net/quic/quic_per_connection_packet_writer.h" | 22 #include "net/quic/quic_per_connection_packet_writer.h" |
| 22 #include "net/quic/quic_sent_packet_manager.h" | 23 #include "net/quic/quic_sent_packet_manager.h" |
| 23 #include "net/quic/quic_session.h" | 24 #include "net/quic/quic_session.h" |
| 24 #include "net/quic/test_tools/mock_clock.h" | 25 #include "net/quic/test_tools/mock_clock.h" |
| 25 #include "net/quic/test_tools/mock_random.h" | 26 #include "net/quic/test_tools/mock_random.h" |
| 26 #include "net/spdy/spdy_framer.h" | 27 #include "net/spdy/spdy_framer.h" |
| 27 #include "testing/gmock/include/gmock/gmock.h" | 28 #include "testing/gmock/include/gmock/gmock.h" |
| 28 | 29 |
| 29 namespace net { | 30 namespace net { |
| 30 | 31 |
| 31 namespace test { | 32 namespace test { |
| 32 | 33 |
| 33 static const QuicConnectionId kTestConnectionId = 42; | 34 static const QuicConnectionId kTestConnectionId = 42; |
| 34 static const int kTestPort = 123; | 35 static const uint16 kTestPort = 123; |
| 35 static const uint32 kInitialStreamFlowControlWindowForTest = | 36 static const uint32 kInitialStreamFlowControlWindowForTest = |
| 36 32 * 1024; // 32 KB | 37 32 * 1024; // 32 KB |
| 37 static const uint32 kInitialSessionFlowControlWindowForTest = | 38 static const uint32 kInitialSessionFlowControlWindowForTest = |
| 38 64 * 1024; // 64 KB | 39 64 * 1024; // 64 KB |
| 39 | 40 |
| 40 // Data stream IDs start at 5: the crypto stream is 1, headers stream is 3. | 41 // Data stream IDs start at 5: the crypto stream is 1, headers stream is 3. |
| 41 static const QuicStreamId kClientDataStreamId1 = 5; | 42 static const QuicStreamId kClientDataStreamId1 = 5; |
| 42 static const QuicStreamId kClientDataStreamId2 = 7; | 43 static const QuicStreamId kClientDataStreamId2 = 7; |
| 43 static const QuicStreamId kClientDataStreamId3 = 9; | 44 static const QuicStreamId kClientDataStreamId3 = 9; |
| 44 static const QuicStreamId kClientDataStreamId4 = 11; | 45 static const QuicStreamId kClientDataStreamId4 = 11; |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 // clears the pointer to it to prevent use-after-free. | 597 // clears the pointer to it to prevent use-after-free. |
| 597 void Unregister(PerConnectionPacketWriter* writer); | 598 void Unregister(PerConnectionPacketWriter* writer); |
| 598 | 599 |
| 599 PerConnectionPacketWriter* current_writer_; | 600 PerConnectionPacketWriter* current_writer_; |
| 600 }; | 601 }; |
| 601 | 602 |
| 602 } // namespace test | 603 } // namespace test |
| 603 } // namespace net | 604 } // namespace net |
| 604 | 605 |
| 605 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 606 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| OLD | NEW |