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

Unified Diff: net/quic/quic_sustained_bandwidth_recorder_test.cc

Issue 2125303002: Use overloaded operators with QuicTime for addition, subtraction and scalar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@126402784
Patch Set: Created 4 years, 5 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
« no previous file with comments | « net/quic/quic_sustained_bandwidth_recorder.cc ('k') | net/quic/quic_time.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_sustained_bandwidth_recorder_test.cc
diff --git a/net/quic/quic_sustained_bandwidth_recorder_test.cc b/net/quic/quic_sustained_bandwidth_recorder_test.cc
index 91cff412927e85bf92b818b85ef4793607729618..c3699077dfa59b7a7c35c6884d81b4427b1dde6a 100644
--- a/net/quic/quic_sustained_bandwidth_recorder_test.cc
+++ b/net/quic/quic_sustained_bandwidth_recorder_test.cc
@@ -33,14 +33,14 @@ TEST(QuicSustainedBandwidthRecorderTest, BandwidthEstimates) {
// Send a second reading, again this should not result in a valid estimate,
// as not enough time has passed.
- estimate_time = estimate_time.Add(srtt);
+ estimate_time = estimate_time + srtt;
recorder.RecordEstimate(in_recovery, in_slow_start, bandwidth, estimate_time,
wall_time, srtt);
EXPECT_FALSE(recorder.HasEstimate());
// Now 3 * kSRTT has elapsed since first recording, expect a valid estimate.
- estimate_time = estimate_time.Add(srtt);
- estimate_time = estimate_time.Add(srtt);
+ estimate_time = estimate_time + srtt;
+ estimate_time = estimate_time + srtt;
recorder.RecordEstimate(in_recovery, in_slow_start, bandwidth, estimate_time,
wall_time, srtt);
EXPECT_TRUE(recorder.HasEstimate());
@@ -60,7 +60,7 @@ TEST(QuicSustainedBandwidthRecorderTest, BandwidthEstimates) {
wall_time, srtt);
EXPECT_EQ(recorder.BandwidthEstimate(), bandwidth);
- estimate_time = estimate_time.Add(srtt.Multiply(3));
+ estimate_time = estimate_time + 3 * srtt;
const int64_t kSeconds = 556677;
QuicWallTime second_bandwidth_wall_time =
QuicWallTime::FromUNIXSeconds(kSeconds);
@@ -80,7 +80,7 @@ TEST(QuicSustainedBandwidthRecorderTest, BandwidthEstimates) {
estimate_time, wall_time, srtt);
EXPECT_EQ(recorder.BandwidthEstimate(), third_bandwidth);
- estimate_time = estimate_time.Add(srtt.Multiply(3));
+ estimate_time = estimate_time + 3 * srtt;
recorder.RecordEstimate(in_recovery, in_slow_start, third_bandwidth,
estimate_time, wall_time, srtt);
EXPECT_EQ(recorder.BandwidthEstimate(), third_bandwidth);
@@ -111,14 +111,14 @@ TEST(QuicSustainedBandwidthRecorderTest, SlowStart) {
wall_time, srtt);
// Now 3 * kSRTT has elapsed since first recording, expect a valid estimate.
- estimate_time = estimate_time.Add(srtt.Multiply(3));
+ estimate_time = estimate_time + 3 * srtt;
recorder.RecordEstimate(in_recovery, in_slow_start, bandwidth, estimate_time,
wall_time, srtt);
EXPECT_TRUE(recorder.HasEstimate());
EXPECT_TRUE(recorder.EstimateRecordedDuringSlowStart());
// Now send another estimate, this time not in slow start.
- estimate_time = estimate_time.Add(srtt.Multiply(3));
+ estimate_time = estimate_time + 3 * srtt;
in_slow_start = false;
recorder.RecordEstimate(in_recovery, in_slow_start, bandwidth, estimate_time,
wall_time, srtt);
« no previous file with comments | « net/quic/quic_sustained_bandwidth_recorder.cc ('k') | net/quic/quic_time.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698