| 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/send_algorithm_interface.h" | 15 #include "net/quic/congestion_control/send_algorithm_interface.h" |
| 15 #include "net/quic/quic_ack_notifier.h" | 16 #include "net/quic/quic_ack_notifier.h" |
| 16 #include "net/quic/quic_connection.h" | 17 #include "net/quic/quic_connection.h" |
| 17 #include "net/quic/quic_framer.h" | 18 #include "net/quic/quic_framer.h" |
| 18 #include "net/quic/quic_session.h" | 19 #include "net/quic/quic_session.h" |
| 19 #include "net/quic/quic_spdy_decompressor.h" | 20 #include "net/quic/quic_spdy_decompressor.h" |
| 20 #include "net/quic/test_tools/mock_clock.h" | 21 #include "net/quic/test_tools/mock_clock.h" |
| 21 #include "net/quic/test_tools/mock_random.h" | 22 #include "net/quic/test_tools/mock_random.h" |
| 22 #include "net/spdy/spdy_framer.h" | 23 #include "net/spdy/spdy_framer.h" |
| 23 #include "testing/gmock/include/gmock/gmock.h" | 24 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 MOCK_CONST_METHOD0(BandwidthEstimate, QuicBandwidth(void)); | 431 MOCK_CONST_METHOD0(BandwidthEstimate, QuicBandwidth(void)); |
| 431 MOCK_METHOD1(UpdateRtt, void(QuicTime::Delta rtt_sample)); | 432 MOCK_METHOD1(UpdateRtt, void(QuicTime::Delta rtt_sample)); |
| 432 MOCK_CONST_METHOD0(SmoothedRtt, QuicTime::Delta(void)); | 433 MOCK_CONST_METHOD0(SmoothedRtt, QuicTime::Delta(void)); |
| 433 MOCK_CONST_METHOD0(RetransmissionDelay, QuicTime::Delta(void)); | 434 MOCK_CONST_METHOD0(RetransmissionDelay, QuicTime::Delta(void)); |
| 434 MOCK_CONST_METHOD0(GetCongestionWindow, QuicByteCount()); | 435 MOCK_CONST_METHOD0(GetCongestionWindow, QuicByteCount()); |
| 435 | 436 |
| 436 private: | 437 private: |
| 437 DISALLOW_COPY_AND_ASSIGN(MockSendAlgorithm); | 438 DISALLOW_COPY_AND_ASSIGN(MockSendAlgorithm); |
| 438 }; | 439 }; |
| 439 | 440 |
| 441 class MockLossAlgorithm : public LossDetectionInterface { |
| 442 public: |
| 443 MockLossAlgorithm(); |
| 444 virtual ~MockLossAlgorithm(); |
| 445 |
| 446 MOCK_METHOD4(DetectLostPackets, |
| 447 SequenceNumberSet(const QuicUnackedPacketMap& unacked_packets, |
| 448 const QuicTime& time, |
| 449 QuicPacketSequenceNumber largest_observed, |
| 450 QuicTime::Delta srtt)); |
| 451 MOCK_CONST_METHOD0(GetLossTimeout, QuicTime()); |
| 452 }; |
| 453 |
| 440 class TestEntropyCalculator : | 454 class TestEntropyCalculator : |
| 441 public QuicReceivedEntropyHashCalculatorInterface { | 455 public QuicReceivedEntropyHashCalculatorInterface { |
| 442 public: | 456 public: |
| 443 TestEntropyCalculator(); | 457 TestEntropyCalculator(); |
| 444 virtual ~TestEntropyCalculator(); | 458 virtual ~TestEntropyCalculator(); |
| 445 | 459 |
| 446 virtual QuicPacketEntropyHash EntropyHash( | 460 virtual QuicPacketEntropyHash EntropyHash( |
| 447 QuicPacketSequenceNumber sequence_number) const OVERRIDE; | 461 QuicPacketSequenceNumber sequence_number) const OVERRIDE; |
| 448 }; | 462 }; |
| 449 | 463 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 479 | 493 |
| 480 protected: | 494 protected: |
| 481 // Object is ref counted. | 495 // Object is ref counted. |
| 482 virtual ~MockAckNotifierDelegate(); | 496 virtual ~MockAckNotifierDelegate(); |
| 483 }; | 497 }; |
| 484 | 498 |
| 485 } // namespace test | 499 } // namespace test |
| 486 } // namespace net | 500 } // namespace net |
| 487 | 501 |
| 488 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 502 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| OLD | NEW |