Victor Vasiliev | 7752898d | 2019-11-14 21:30:22 | [diff] [blame^] | 1 | // 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 | |
| 7 | namespace net { |
| 8 | |
| 9 | MockQuicContext::MockQuicContext() |
| 10 | : QuicContext(std::make_unique<quic::test::MockQuicConnectionHelper>()) { |
| 11 | mock_helper_ = static_cast<quic::test::MockQuicConnectionHelper*>(helper()); |
| 12 | } |
| 13 | |
| 14 | void MockQuicContext::AdvanceTime(quic::QuicTime::Delta delta) { |
| 15 | mock_helper_->AdvanceTime(delta); |
| 16 | } |
| 17 | |
| 18 | quic::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 |