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

Unified Diff: net/quic/test_tools/quic_test_utils.cc

Issue 14411004: Land Recent QUIC Changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use CONFIG_VERSION insteaf of VERSION Created 7 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 side-by-side diff with in-line comments
Download patch
Index: net/quic/test_tools/quic_test_utils.cc
diff --git a/net/quic/test_tools/quic_test_utils.cc b/net/quic/test_tools/quic_test_utils.cc
index 819637377076573f2c07ac54e888b8368289da34..aa8eb3748500db11bbafd6e7c815bc9d954f80fe 100644
--- a/net/quic/test_tools/quic_test_utils.cc
+++ b/net/quic/test_tools/quic_test_utils.cc
@@ -127,22 +127,34 @@ QuicRandom* MockHelper::GetRandomGenerator() {
return &random_generator_;
}
+void MockHelper::AdvanceTime(QuicTime::Delta delta) {
+ clock_.AdvanceTime(delta);
+}
+
MockConnection::MockConnection(QuicGuid guid,
IPEndPoint address,
bool is_server)
- : QuicConnection(guid, address, new MockHelper(), is_server) {
+ : QuicConnection(guid, address, new MockHelper(), is_server),
+ has_mock_helper_(true) {
}
MockConnection::MockConnection(QuicGuid guid,
IPEndPoint address,
QuicConnectionHelperInterface* helper,
bool is_server)
- : QuicConnection(guid, address, helper, is_server) {
+ : QuicConnection(guid, address, helper, is_server),
+ has_mock_helper_(false) {
}
MockConnection::~MockConnection() {
}
+void MockConnection::AdvanceTime(QuicTime::Delta delta) {
+ CHECK(has_mock_helper_) << "Cannot advance time unless a MockClock is being"
+ " used";
+ static_cast<MockHelper*>(helper())->AdvanceTime(delta);
+}
+
PacketSavingConnection::PacketSavingConnection(QuicGuid guid,
IPEndPoint address,
bool is_server)

Powered by Google App Engine
This is Rietveld 408576698