Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: net/quic/test_tools/quic_test_utils.h

Issue 1037643002: Land Recent QUIC Changes until 03/22/2015. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: deleted duplicated using statements in net/tools/quic/test_tools/quic_test_utils.cc Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/quic_time_wait_list_manager.cc ('k') | net/quic/test_tools/rtt_stats_peer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 MOCK_METHOD3(SendGoAway, 331 MOCK_METHOD3(SendGoAway,
332 void(QuicErrorCode error, 332 void(QuicErrorCode error,
333 QuicStreamId last_good_stream_id, 333 QuicStreamId last_good_stream_id,
334 const std::string& reason)); 334 const std::string& reason));
335 MOCK_METHOD1(SendBlocked, void(QuicStreamId id)); 335 MOCK_METHOD1(SendBlocked, void(QuicStreamId id));
336 MOCK_METHOD2(SendWindowUpdate, void(QuicStreamId id, 336 MOCK_METHOD2(SendWindowUpdate, void(QuicStreamId id,
337 QuicStreamOffset byte_offset)); 337 QuicStreamOffset byte_offset));
338 MOCK_METHOD0(OnCanWrite, void()); 338 MOCK_METHOD0(OnCanWrite, void());
339 339
340 MOCK_METHOD1(OnSendConnectionState, void(const CachedNetworkParameters&)); 340 MOCK_METHOD1(OnSendConnectionState, void(const CachedNetworkParameters&));
341 MOCK_METHOD1(ResumeConnectionState, bool(const CachedNetworkParameters&)); 341 MOCK_METHOD2(ResumeConnectionState,
342 bool(const CachedNetworkParameters&, bool));
342 343
343 void ReallyProcessUdpPacket(const IPEndPoint& self_address, 344 void ReallyProcessUdpPacket(const IPEndPoint& self_address,
344 const IPEndPoint& peer_address, 345 const IPEndPoint& peer_address,
345 const QuicEncryptedPacket& packet) { 346 const QuicEncryptedPacket& packet) {
346 QuicConnection::ProcessUdpPacket(self_address, peer_address, packet); 347 QuicConnection::ProcessUdpPacket(self_address, peer_address, packet);
347 } 348 }
348 349
349 bool OnProtocolVersionMismatch(QuicVersion version) override { 350 bool OnProtocolVersionMismatch(QuicVersion version) override {
350 return false; 351 return false;
351 } 352 }
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 class MockSendAlgorithm : public SendAlgorithmInterface { 471 class MockSendAlgorithm : public SendAlgorithmInterface {
471 public: 472 public:
472 MockSendAlgorithm(); 473 MockSendAlgorithm();
473 ~MockSendAlgorithm() override; 474 ~MockSendAlgorithm() override;
474 475
475 MOCK_METHOD3(SetFromConfig, 476 MOCK_METHOD3(SetFromConfig,
476 void(const QuicConfig& config, 477 void(const QuicConfig& config,
477 Perspective perspective, 478 Perspective perspective,
478 bool using_pacing)); 479 bool using_pacing));
479 MOCK_METHOD1(SetNumEmulatedConnections, void(int num_connections)); 480 MOCK_METHOD1(SetNumEmulatedConnections, void(int num_connections));
480 MOCK_METHOD1(SetMaxPacketSize, void(QuicByteCount max_packet_size)); 481 MOCK_METHOD1(SetMaxCongestionWindow,
482 void(QuicByteCount max_congestion_window));
481 MOCK_METHOD4(OnCongestionEvent, void(bool rtt_updated, 483 MOCK_METHOD4(OnCongestionEvent, void(bool rtt_updated,
482 QuicByteCount bytes_in_flight, 484 QuicByteCount bytes_in_flight,
483 const CongestionVector& acked_packets, 485 const CongestionVector& acked_packets,
484 const CongestionVector& lost_packets)); 486 const CongestionVector& lost_packets));
485 MOCK_METHOD5(OnPacketSent, 487 MOCK_METHOD5(OnPacketSent,
486 bool(QuicTime, QuicByteCount, QuicPacketSequenceNumber, 488 bool(QuicTime, QuicByteCount, QuicPacketSequenceNumber,
487 QuicByteCount, HasRetransmittableData)); 489 QuicByteCount, HasRetransmittableData));
488 MOCK_METHOD1(OnRetransmissionTimeout, void(bool)); 490 MOCK_METHOD1(OnRetransmissionTimeout, void(bool));
489 MOCK_METHOD0(RevertRetransmissionTimeout, void()); 491 MOCK_METHOD0(RevertRetransmissionTimeout, void());
490 MOCK_CONST_METHOD3(TimeUntilSend, 492 MOCK_CONST_METHOD3(TimeUntilSend,
491 QuicTime::Delta(QuicTime now, 493 QuicTime::Delta(QuicTime now,
492 QuicByteCount bytes_in_flight, 494 QuicByteCount bytes_in_flight,
493 HasRetransmittableData)); 495 HasRetransmittableData));
494 MOCK_CONST_METHOD0(PacingRate, QuicBandwidth(void)); 496 MOCK_CONST_METHOD0(PacingRate, QuicBandwidth(void));
495 MOCK_CONST_METHOD0(BandwidthEstimate, QuicBandwidth(void)); 497 MOCK_CONST_METHOD0(BandwidthEstimate, QuicBandwidth(void));
496 MOCK_CONST_METHOD0(HasReliableBandwidthEstimate, bool()); 498 MOCK_CONST_METHOD0(HasReliableBandwidthEstimate, bool());
497 MOCK_METHOD1(OnRttUpdated, void(QuicPacketSequenceNumber)); 499 MOCK_METHOD1(OnRttUpdated, void(QuicPacketSequenceNumber));
498 MOCK_CONST_METHOD0(RetransmissionDelay, QuicTime::Delta(void)); 500 MOCK_CONST_METHOD0(RetransmissionDelay, QuicTime::Delta(void));
499 MOCK_CONST_METHOD0(GetCongestionWindow, QuicByteCount()); 501 MOCK_CONST_METHOD0(GetCongestionWindow, QuicByteCount());
500 MOCK_CONST_METHOD0(InSlowStart, bool()); 502 MOCK_CONST_METHOD0(InSlowStart, bool());
501 MOCK_CONST_METHOD0(InRecovery, bool()); 503 MOCK_CONST_METHOD0(InRecovery, bool());
502 MOCK_CONST_METHOD0(GetSlowStartThreshold, QuicByteCount()); 504 MOCK_CONST_METHOD0(GetSlowStartThreshold, QuicByteCount());
503 MOCK_CONST_METHOD0(GetCongestionControlType, CongestionControlType()); 505 MOCK_CONST_METHOD0(GetCongestionControlType, CongestionControlType());
504 MOCK_METHOD1(ResumeConnectionState, bool(const CachedNetworkParameters&)); 506 MOCK_METHOD2(ResumeConnectionState,
507 bool(const CachedNetworkParameters&, bool));
505 508
506 private: 509 private:
507 DISALLOW_COPY_AND_ASSIGN(MockSendAlgorithm); 510 DISALLOW_COPY_AND_ASSIGN(MockSendAlgorithm);
508 }; 511 };
509 512
510 class MockLossAlgorithm : public LossDetectionInterface { 513 class MockLossAlgorithm : public LossDetectionInterface {
511 public: 514 public:
512 MockLossAlgorithm(); 515 MockLossAlgorithm();
513 ~MockLossAlgorithm() override; 516 ~MockLossAlgorithm() override;
514 517
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 // clears the pointer to it to prevent use-after-free. 619 // clears the pointer to it to prevent use-after-free.
617 void Unregister(PerConnectionPacketWriter* writer); 620 void Unregister(PerConnectionPacketWriter* writer);
618 621
619 PerConnectionPacketWriter* current_writer_; 622 PerConnectionPacketWriter* current_writer_;
620 }; 623 };
621 624
622 } // namespace test 625 } // namespace test
623 } // namespace net 626 } // namespace net
624 627
625 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ 628 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « net/quic/quic_time_wait_list_manager.cc ('k') | net/quic/test_tools/rtt_stats_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698