1 // Copyright 2014 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 "quiche/quic/test_tools/quic_sustained_bandwidth_recorder_peer.h"
6 
7 #include "quiche/quic/core/quic_packets.h"
8 #include "quiche/quic/core/quic_sustained_bandwidth_recorder.h"
9 
10 namespace quic {
11 namespace test {
12 
13 // static
SetBandwidthEstimate(QuicSustainedBandwidthRecorder * bandwidth_recorder,int32_t bandwidth_estimate_kbytes_per_second)14 void QuicSustainedBandwidthRecorderPeer::SetBandwidthEstimate(
15     QuicSustainedBandwidthRecorder* bandwidth_recorder,
16     int32_t bandwidth_estimate_kbytes_per_second) {
17   bandwidth_recorder->has_estimate_ = true;
18   bandwidth_recorder->bandwidth_estimate_ =
19       QuicBandwidth::FromKBytesPerSecond(bandwidth_estimate_kbytes_per_second);
20 }
21 
22 // static
SetMaxBandwidthEstimate(QuicSustainedBandwidthRecorder * bandwidth_recorder,int32_t max_bandwidth_estimate_kbytes_per_second,int32_t max_bandwidth_timestamp)23 void QuicSustainedBandwidthRecorderPeer::SetMaxBandwidthEstimate(
24     QuicSustainedBandwidthRecorder* bandwidth_recorder,
25     int32_t max_bandwidth_estimate_kbytes_per_second,
26     int32_t max_bandwidth_timestamp) {
27   bandwidth_recorder->max_bandwidth_estimate_ =
28       QuicBandwidth::FromKBytesPerSecond(
29           max_bandwidth_estimate_kbytes_per_second);
30   bandwidth_recorder->max_bandwidth_timestamp_ = max_bandwidth_timestamp;
31 }
32 
33 }  // namespace test
34 }  // namespace quic
35