blob: 9c818a32fd1569fe6491adea0031731e243dbce0 [file] [log] [blame]
Victor Vasiliev7752898d2019-11-14 21:30:221// Copyright 2019 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "net/quic/mock_quic_context.h"
6
7namespace net {
8
9MockQuicContext::MockQuicContext()
10 : QuicContext(std::make_unique<quic::test::MockQuicConnectionHelper>()) {
11 mock_helper_ = static_cast<quic::test::MockQuicConnectionHelper*>(helper());
12}
13
14void MockQuicContext::AdvanceTime(quic::QuicTime::Delta delta) {
15 mock_helper_->AdvanceTime(delta);
16}
17
18quic::MockClock* MockQuicContext::mock_clock() {
19 // TODO(vasilvv): add a proper accessor to MockQuicConnectionHelper and delete
20 // the cast.
21 return const_cast<quic::MockClock*>(
22 static_cast<const quic::MockClock*>(mock_helper_->GetClock()));
23}
24
25} // namespace net