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/strings/string_piece.h" | 13 #include "base/strings/string_piece.h" |
14 #include "net/quic/congestion_control/loss_detection_interface.h" | 14 #include "net/quic/congestion_control/loss_detection_interface.h" |
15 #include "net/quic/congestion_control/send_algorithm_interface.h" | 15 #include "net/quic/congestion_control/send_algorithm_interface.h" |
16 #include "net/quic/quic_ack_notifier.h" | 16 #include "net/quic/quic_ack_notifier.h" |
17 #include "net/quic/quic_client_session_base.h" | 17 #include "net/quic/quic_client_session_base.h" |
18 #include "net/quic/quic_connection.h" | 18 #include "net/quic/quic_connection.h" |
19 #include "net/quic/quic_framer.h" | 19 #include "net/quic/quic_framer.h" |
| 20 #include "net/quic/quic_sent_packet_manager.h" |
20 #include "net/quic/quic_session.h" | 21 #include "net/quic/quic_session.h" |
21 #include "net/quic/test_tools/mock_clock.h" | 22 #include "net/quic/test_tools/mock_clock.h" |
22 #include "net/quic/test_tools/mock_random.h" | 23 #include "net/quic/test_tools/mock_random.h" |
23 #include "net/spdy/spdy_framer.h" | 24 #include "net/spdy/spdy_framer.h" |
24 #include "testing/gmock/include/gmock/gmock.h" | 25 #include "testing/gmock/include/gmock/gmock.h" |
25 | 26 |
26 namespace net { | 27 namespace net { |
27 | 28 |
28 namespace test { | 29 namespace test { |
29 | 30 |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 QuicTime::Delta(QuicTime now, | 458 QuicTime::Delta(QuicTime now, |
458 QuicByteCount bytes_in_flight, | 459 QuicByteCount bytes_in_flight, |
459 HasRetransmittableData)); | 460 HasRetransmittableData)); |
460 MOCK_CONST_METHOD0(BandwidthEstimate, QuicBandwidth(void)); | 461 MOCK_CONST_METHOD0(BandwidthEstimate, QuicBandwidth(void)); |
461 MOCK_CONST_METHOD0(HasReliableBandwidthEstimate, bool()); | 462 MOCK_CONST_METHOD0(HasReliableBandwidthEstimate, bool()); |
462 MOCK_METHOD1(OnRttUpdated, void(QuicPacketSequenceNumber)); | 463 MOCK_METHOD1(OnRttUpdated, void(QuicPacketSequenceNumber)); |
463 MOCK_CONST_METHOD0(RetransmissionDelay, QuicTime::Delta(void)); | 464 MOCK_CONST_METHOD0(RetransmissionDelay, QuicTime::Delta(void)); |
464 MOCK_CONST_METHOD0(GetCongestionWindow, QuicByteCount()); | 465 MOCK_CONST_METHOD0(GetCongestionWindow, QuicByteCount()); |
465 MOCK_CONST_METHOD0(InSlowStart, bool()); | 466 MOCK_CONST_METHOD0(InSlowStart, bool()); |
466 MOCK_CONST_METHOD0(GetSlowStartThreshold, QuicByteCount()); | 467 MOCK_CONST_METHOD0(GetSlowStartThreshold, QuicByteCount()); |
| 468 MOCK_CONST_METHOD0(GetCongestionControlType, CongestionControlType()); |
467 | 469 |
468 private: | 470 private: |
469 DISALLOW_COPY_AND_ASSIGN(MockSendAlgorithm); | 471 DISALLOW_COPY_AND_ASSIGN(MockSendAlgorithm); |
470 }; | 472 }; |
471 | 473 |
472 class MockLossAlgorithm : public LossDetectionInterface { | 474 class MockLossAlgorithm : public LossDetectionInterface { |
473 public: | 475 public: |
474 MockLossAlgorithm(); | 476 MockLossAlgorithm(); |
475 virtual ~MockLossAlgorithm(); | 477 virtual ~MockLossAlgorithm(); |
476 | 478 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 QuicTime::Delta delta_largest_observed)); | 525 QuicTime::Delta delta_largest_observed)); |
524 | 526 |
525 protected: | 527 protected: |
526 // Object is ref counted. | 528 // Object is ref counted. |
527 virtual ~MockAckNotifierDelegate(); | 529 virtual ~MockAckNotifierDelegate(); |
528 | 530 |
529 private: | 531 private: |
530 DISALLOW_COPY_AND_ASSIGN(MockAckNotifierDelegate); | 532 DISALLOW_COPY_AND_ASSIGN(MockAckNotifierDelegate); |
531 }; | 533 }; |
532 | 534 |
| 535 class MockNetworkChangeVisitor : |
| 536 public QuicSentPacketManager::NetworkChangeVisitor { |
| 537 public: |
| 538 MockNetworkChangeVisitor(); |
| 539 virtual ~MockNetworkChangeVisitor(); |
| 540 |
| 541 MOCK_METHOD1(OnCongestionWindowChange, void(QuicByteCount)); |
| 542 |
| 543 private: |
| 544 DISALLOW_COPY_AND_ASSIGN(MockNetworkChangeVisitor); |
| 545 }; |
| 546 |
533 } // namespace test | 547 } // namespace test |
534 } // namespace net | 548 } // namespace net |
535 | 549 |
536 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 550 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
OLD | NEW |