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

Unified Diff: net/nqe/network_quality_estimator_unittest.cc

Issue 2668403003: NQE: Do not record correlation if metric is missing (Closed)
Patch Set: ryansturm comments Created 3 years, 11 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 b31c5a4fa059f18f14644c707a8fe1bedbe8c8b9..3702c8f4b4bc55c9b1e153ce43d7d72fbbc15087 100644
--- a/net/nqe/network_quality_estimator_unittest.cc
+++ b/net/nqe/network_quality_estimator_unittest.cc
@@ -2325,6 +2325,27 @@ TEST(NetworkQualityEstimatorTest, CorrelationHistogram) {
3000 >> kTrimBits,
},
{
+ // Verify that the metric is not recorded if the HTTP RTT is
+ // unavailable.
+ false, 0.3, 0.4, base::TimeDelta::FromSeconds(1), 1000 >> kTrimBits,
+ nqe::internal::InvalidRTT(), 2000 >> kTrimBits, 3000,
+ 3000 >> kTrimBits,
+ },
+ {
+ // Verify that the metric is not recorded if the transport RTT is
+ // unavailable.
+ true, 0.3, 0.4, nqe::internal::InvalidRTT(), 1000 >> kTrimBits,
+ base::TimeDelta::FromSeconds(2), 2000 >> kTrimBits, 3000,
+ 3000 >> kTrimBits,
+ },
+ {
+ // Verify that the metric is not recorded if the throughput is
+ // unavailable.
+ false, 0.3, 0.4, base::TimeDelta::FromSeconds(1), 1000 >> kTrimBits,
+ base::TimeDelta::FromSeconds(2), 2000 >> kTrimBits,
+ nqe::internal::kInvalidThroughput, 3000 >> kTrimBits,
+ },
+ {
// Verify that the metric is recorded if the logging probability is
// set to 1.0.
false, 0.5, 1.0, base::TimeDelta::FromSeconds(1), 1000 >> kTrimBits,
@@ -2396,6 +2417,24 @@ TEST(NetworkQualityEstimatorTest, CorrelationHistogram) {
"NQE.Correlation.ResourceLoadTime.0Kb_128Kb", 0);
continue;
}
+ if (!test.use_transport_rtt &&
+ test.http_rtt == nqe::internal::InvalidRTT()) {
+ histogram_tester.ExpectTotalCount(
+ "NQE.Correlation.ResourceLoadTime.0Kb_128Kb", 0);
+ continue;
+ }
+ if (test.use_transport_rtt &&
+ test.transport_rtt == nqe::internal::InvalidRTT()) {
+ histogram_tester.ExpectTotalCount(
+ "NQE.Correlation.ResourceLoadTime.0Kb_128Kb", 0);
+ continue;
+ }
+ if (test.downstream_throughput_kbps == nqe::internal::kInvalidThroughput) {
+ histogram_tester.ExpectTotalCount(
+ "NQE.Correlation.ResourceLoadTime.0Kb_128Kb", 0);
+ continue;
+ }
+
histogram_tester.ExpectTotalCount(
"NQE.Correlation.ResourceLoadTime.0Kb_128Kb", 1);
std::vector<base::Bucket> buckets = histogram_tester.GetAllSamples(
« 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