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

Unified Diff: net/nqe/network_quality_estimator_unittest.cc

Issue 2911473002: Expose transport RTT estimate from Network Quality Estimator (NQE) (Closed)
Patch Set: ryansturm comment Created 3 years, 7 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/nqe/network_quality_estimator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/nqe/network_quality_estimator_unittest.cc
diff --git a/net/nqe/network_quality_estimator_unittest.cc b/net/nqe/network_quality_estimator_unittest.cc
index 754fc4cb9be786d70b40c1ae3a5e64b3bc9b8463..fe4d359d22a62c5c4aa5c04886dd9b3ae4692a32 100644
--- a/net/nqe/network_quality_estimator_unittest.cc
+++ b/net/nqe/network_quality_estimator_unittest.cc
@@ -224,6 +224,7 @@ TEST(NetworkQualityEstimatorTest, TestKbpsRTTUpdates) {
EXPECT_TRUE(
estimator.GetRecentDownlinkThroughputKbps(base::TimeTicks(), &kbps));
base::TimeDelta transport_rtt;
+ EXPECT_FALSE(estimator.GetTransportRTT());
EXPECT_FALSE(
estimator.GetRecentTransportRTT(base::TimeTicks(), &transport_rtt));
@@ -401,6 +402,7 @@ TEST(NetworkQualityEstimatorTest, Caching) {
EXPECT_NE(EFFECTIVE_CONNECTION_TYPE_UNKNOWN,
estimator.GetEffectiveConnectionType());
EXPECT_FALSE(estimator.GetRecentTransportRTT(base::TimeTicks(), &rtt));
+ EXPECT_FALSE(estimator.GetTransportRTT());
histogram_tester.ExpectBucketCount("NQE.CachedNetworkQualityAvailable", false,
1);
@@ -507,6 +509,7 @@ TEST(NetworkQualityEstimatorTest, CachingDisabled) {
EXPECT_NE(EFFECTIVE_CONNECTION_TYPE_UNKNOWN,
estimator.GetEffectiveConnectionType());
EXPECT_FALSE(estimator.GetRecentTransportRTT(base::TimeTicks(), &rtt));
+ EXPECT_FALSE(estimator.GetTransportRTT());
histogram_tester.ExpectTotalCount("NQE.CachedNetworkQualityAvailable", 0);
@@ -691,6 +694,7 @@ TEST(NetworkQualityEstimatorTest, DefaultObservations) {
EXPECT_EQ(base::TimeDelta::FromMilliseconds(115), rtt);
EXPECT_TRUE(estimator.GetRecentTransportRTT(base::TimeTicks(), &rtt));
EXPECT_EQ(base::TimeDelta::FromMilliseconds(55), rtt);
+ EXPECT_EQ(rtt, estimator.GetTransportRTT().value());
EXPECT_TRUE(
estimator.GetRecentDownlinkThroughputKbps(base::TimeTicks(), &kbps));
EXPECT_EQ(1961, kbps);
@@ -710,6 +714,7 @@ TEST(NetworkQualityEstimatorTest, DefaultObservations) {
EXPECT_EQ(base::TimeDelta::FromMilliseconds(272), rtt);
EXPECT_TRUE(estimator.GetRecentTransportRTT(base::TimeTicks(), &rtt));
EXPECT_EQ(base::TimeDelta::FromMilliseconds(209), rtt);
+ EXPECT_EQ(rtt, estimator.GetTransportRTT());
EXPECT_TRUE(
estimator.GetRecentDownlinkThroughputKbps(base::TimeTicks(), &kbps));
EXPECT_EQ(749, kbps);
@@ -785,6 +790,7 @@ TEST(NetworkQualityEstimatorTest, DefaultObservationsOverridden) {
EXPECT_EQ(base::TimeDelta::FromMilliseconds(1000), rtt);
EXPECT_TRUE(estimator.GetRecentTransportRTT(base::TimeTicks(), &rtt));
EXPECT_EQ(base::TimeDelta::FromMilliseconds(500), rtt);
+ EXPECT_EQ(rtt, estimator.GetTransportRTT().value());
EXPECT_TRUE(
estimator.GetRecentDownlinkThroughputKbps(base::TimeTicks(), &kbps));
EXPECT_EQ(100, kbps);
@@ -796,6 +802,7 @@ TEST(NetworkQualityEstimatorTest, DefaultObservationsOverridden) {
EXPECT_EQ(base::TimeDelta::FromMilliseconds(2000), rtt);
EXPECT_TRUE(estimator.GetRecentTransportRTT(base::TimeTicks(), &rtt));
EXPECT_EQ(base::TimeDelta::FromMilliseconds(1000), rtt);
+ EXPECT_EQ(rtt, estimator.GetTransportRTT().value());
EXPECT_TRUE(
estimator.GetRecentDownlinkThroughputKbps(base::TimeTicks(), &kbps));
EXPECT_EQ(200, kbps);
@@ -816,6 +823,7 @@ TEST(NetworkQualityEstimatorTest, DefaultObservationsOverridden) {
EXPECT_EQ(base::TimeDelta::FromMilliseconds(1726), rtt);
EXPECT_TRUE(estimator.GetRecentTransportRTT(base::TimeTicks(), &rtt));
EXPECT_EQ(base::TimeDelta::FromMilliseconds(1531), rtt);
+ EXPECT_EQ(rtt, estimator.GetTransportRTT().value());
EXPECT_TRUE(
estimator.GetRecentDownlinkThroughputKbps(base::TimeTicks(), &kbps));
EXPECT_EQ(300, kbps);
@@ -827,6 +835,7 @@ TEST(NetworkQualityEstimatorTest, DefaultObservationsOverridden) {
EXPECT_EQ(base::TimeDelta::FromMilliseconds(272), rtt);
EXPECT_TRUE(estimator.GetRecentTransportRTT(base::TimeTicks(), &rtt));
EXPECT_EQ(base::TimeDelta::FromMilliseconds(209), rtt);
+ EXPECT_EQ(rtt, estimator.GetTransportRTT().value());
EXPECT_TRUE(
estimator.GetRecentDownlinkThroughputKbps(base::TimeTicks(), &kbps));
EXPECT_EQ(749, kbps);
@@ -1525,6 +1534,7 @@ TEST(NetworkQualityEstimatorTest, TestExternalEstimateProvider) {
int32_t kbps;
EXPECT_TRUE(estimator.GetRecentHttpRTT(base::TimeTicks(), &rtt));
EXPECT_FALSE(estimator.GetRecentTransportRTT(base::TimeTicks(), &rtt));
+ EXPECT_FALSE(estimator.GetTransportRTT());
EXPECT_TRUE(
estimator.GetRecentDownlinkThroughputKbps(base::TimeTicks(), &kbps));
@@ -2159,6 +2169,7 @@ TEST(NetworkQualityEstimatorTest, MAYBE_TestTCPSocketRTT) {
base::TimeDelta rtt;
EXPECT_TRUE(estimator.GetRecentHttpRTT(base::TimeTicks(), &rtt));
EXPECT_TRUE(estimator.GetRecentTransportRTT(base::TimeTicks(), &rtt));
+ EXPECT_EQ(rtt, estimator.GetTransportRTT().value());
// Send two requests. Verify that the completion of each request generates at
// least one TCP RTT observation.
@@ -2190,6 +2201,7 @@ TEST(NetworkQualityEstimatorTest, MAYBE_TestTCPSocketRTT) {
}
EXPECT_TRUE(estimator.GetRecentHttpRTT(base::TimeTicks(), &rtt));
EXPECT_TRUE(estimator.GetRecentTransportRTT(base::TimeTicks(), &rtt));
+ EXPECT_EQ(rtt, estimator.GetTransportRTT().value());
estimator.SimulateNetworkChange(
NetworkChangeNotifier::ConnectionType::CONNECTION_WIFI, "test-1");
« no previous file with comments | « net/nqe/network_quality_estimator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698