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

Unified Diff: net/nqe/network_quality_estimator_unittest.cc

Issue 2724403004: NQE: Add net log event if the metric changes substantially (Closed)
Patch Set: ryansturm comments Created 3 years, 10 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 4c68ae0fcf5ab01687cdff639eead29c8dc87c4f..d5cc4f6a8956245aa71d91c17f7a3e0a0f1705ea 100644
--- a/net/nqe/network_quality_estimator_unittest.cc
+++ b/net/nqe/network_quality_estimator_unittest.cc
@@ -226,7 +226,7 @@ TEST(NetworkQualityEstimatorTest, TestKbpsRTTUpdates) {
estimator.GetRecentTransportRTT(base::TimeTicks(), &transport_rtt));
// Verify the contents of the net log.
- EXPECT_EQ(
+ EXPECT_LE(
2, estimator.GetEntriesCount(NetLogEventType::NETWORK_QUALITY_CHANGED));
EXPECT_EQ(http_rtt.InMilliseconds(),
estimator.GetNetLogLastIntegerValue(
@@ -411,8 +411,10 @@ TEST(NetworkQualityEstimatorTest, Caching) {
// |observer| should be notified as soon as it is added.
base::RunLoop().RunUntilIdle();
EXPECT_EQ(1U, observer.effective_connection_types().size());
- EXPECT_EQ(
- 2, estimator.GetEntriesCount(NetLogEventType::NETWORK_QUALITY_CHANGED));
+
+ int num_net_log_entries =
+ estimator.GetEntriesCount(NetLogEventType::NETWORK_QUALITY_CHANGED);
+ EXPECT_LE(2, num_net_log_entries);
estimator.SimulateNetworkChange(
NetworkChangeNotifier::ConnectionType::CONNECTION_2G, "test");
@@ -425,7 +427,8 @@ TEST(NetworkQualityEstimatorTest, Caching) {
// Verify the contents of the net log.
EXPECT_LE(
- 3, estimator.GetEntriesCount(NetLogEventType::NETWORK_QUALITY_CHANGED));
+ 1, estimator.GetEntriesCount(NetLogEventType::NETWORK_QUALITY_CHANGED) -
+ num_net_log_entries);
EXPECT_NE(-1, estimator.GetNetLogLastIntegerValue(
NetLogEventType::NETWORK_QUALITY_CHANGED, "http_rtt_ms"));
EXPECT_EQ(-1,
@@ -1741,7 +1744,7 @@ TEST(NetworkQualityEstimatorTest, MAYBE_TestEffectiveConnectionTypeObserver) {
request->Start();
base::RunLoop().Run();
EXPECT_EQ(1U, observer.effective_connection_types().size());
- EXPECT_EQ(
+ EXPECT_LE(
1, estimator.GetEntriesCount(NetLogEventType::NETWORK_QUALITY_CHANGED));
// Verify the contents of the net log.
« 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