blob: 81ae9519078fbceb7dcec4c2136940ede7e1a2e4 [file] [log] [blame]
Avi Drissman64595482022-09-14 20:52:291// Copyright 2019 The Chromium Authors
Victor Vasiliev7752898d2019-11-14 21:30:222// 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