Index: net/base/network_quality_estimator_unittest.cc |
diff --git a/net/base/network_quality_estimator_unittest.cc b/net/base/network_quality_estimator_unittest.cc |
index 82e1bbaf3d23e58ce960121170ad5d917e83e6f9..84baac4501271d25d78832377d8c1326a4376e5c 100644 |
--- a/net/base/network_quality_estimator_unittest.cc |
+++ b/net/base/network_quality_estimator_unittest.cc |
@@ -32,9 +32,9 @@ TEST(NetworkQualityEstimatorTest, TestPeakKbpsFastestRTTUpdates) { |
// Enable requests to local host to be used for network quality estimation. |
NetworkQualityEstimator estimator(true); |
{ |
- NetworkQuality network_quality = estimator.GetEstimate(); |
- EXPECT_EQ(network_quality.fastest_rtt_confidence, 0); |
- EXPECT_EQ(network_quality.peak_throughput_kbps_confidence, 0); |
+ NetworkQuality network_quality = estimator.GetPeakEstimate(); |
+ EXPECT_EQ(network_quality.rtt(), base::TimeDelta()); |
+ EXPECT_EQ(network_quality.downlink_throughput_kbps(), 0U); |
} |
TestDelegate d; |
@@ -53,27 +53,25 @@ TEST(NetworkQualityEstimatorTest, TestPeakKbpsFastestRTTUpdates) { |
base::PlatformThread::Sleep(request_duration); |
- // With smaller transfer, |fastest_rtt| will be updated but not |
- // |peak_throughput_kbps|. |
- estimator.NotifyDataReceived(*(request.get()), |
+ // With smaller transfer, RTT will be updated but not the downlink |
+ // throughput. |
+ estimator.NotifyDataReceived(*(request.get()), min_transfer_size_in_bytes - 1, |
min_transfer_size_in_bytes - 1); |
{ |
- NetworkQuality network_quality = estimator.GetEstimate(); |
- EXPECT_GT(network_quality.fastest_rtt_confidence, 0); |
- EXPECT_EQ(network_quality.peak_throughput_kbps_confidence, 0); |
+ NetworkQuality network_quality = estimator.GetPeakEstimate(); |
+ EXPECT_GT(network_quality.rtt(), base::TimeDelta()); |
+ EXPECT_EQ(network_quality.downlink_throughput_kbps(), 0U); |
} |
- // With large transfer, both |fastest_rtt| and |peak_throughput_kbps| will be |
- // updated. |
- estimator.NotifyDataReceived(*(request.get()), min_transfer_size_in_bytes); |
+ // With large transfer, both RTT and downlink throughput will be updated. |
+ estimator.NotifyDataReceived(*(request.get()), min_transfer_size_in_bytes, |
+ min_transfer_size_in_bytes); |
{ |
- NetworkQuality network_quality = estimator.GetEstimate(); |
- EXPECT_GT(network_quality.fastest_rtt_confidence, 0); |
- EXPECT_GT(network_quality.peak_throughput_kbps_confidence, 0); |
- EXPECT_GE(network_quality.fastest_rtt, request_duration); |
- EXPECT_GT(network_quality.peak_throughput_kbps, uint32_t(0)); |
+ NetworkQuality network_quality = estimator.GetPeakEstimate(); |
+ EXPECT_GE(network_quality.rtt(), request_duration); |
+ EXPECT_GT(network_quality.downlink_throughput_kbps(), 0U); |
EXPECT_LE( |
- network_quality.peak_throughput_kbps, |
+ network_quality.downlink_throughput_kbps(), |
min_transfer_size_in_bytes * 8.0 / request_duration.InMilliseconds()); |
} |
EXPECT_EQ(estimator.bytes_read_since_last_connection_change_, true); |
@@ -88,11 +86,11 @@ TEST(NetworkQualityEstimatorTest, TestPeakKbpsFastestRTTUpdates) { |
histogram_tester.ExpectTotalCount("NQE.PeakKbps.Unknown", 1); |
histogram_tester.ExpectTotalCount("NQE.FastestRTT.Unknown", 1); |
{ |
- NetworkQuality network_quality = estimator.GetEstimate(); |
+ NetworkQuality network_quality = estimator.GetPeakEstimate(); |
EXPECT_EQ(estimator.current_connection_type_, |
NetworkChangeNotifier::ConnectionType::CONNECTION_WIFI); |
- EXPECT_EQ(network_quality.fastest_rtt_confidence, 0); |
- EXPECT_EQ(network_quality.peak_throughput_kbps_confidence, 0); |
+ EXPECT_EQ(network_quality.rtt(), base::TimeDelta()); |
+ EXPECT_EQ(network_quality.downlink_throughput_kbps(), 0U); |
} |
} |
#endif // !defined(OS_IOS) |