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

Unified Diff: net/nqe/network_quality_estimator_unittest.cc

Issue 2145613003: NQE: Add accuracy histogram for external estimate provider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased 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/nqe/network_quality_estimator.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | 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 9b67bccf7602120cd3c3a94f5400b4d84a69348c..b381ce84649b52b55c8e071d1c1e47816f1a3f5b 100644
--- a/net/nqe/network_quality_estimator_unittest.cc
+++ b/net/nqe/network_quality_estimator_unittest.cc
@@ -1696,8 +1696,13 @@ TEST(NetworkQualityEstimatorTest, MAYBE_RecordAccuracy) {
base::SimpleTestTickClock* tick_clock_ptr = tick_clock.get();
tick_clock_ptr->Advance(base::TimeDelta::FromSeconds(1));
+ std::unique_ptr<ExternalEstimateProvider> external_estimate_provider(
+ new TestExternalEstimateProvider(test.rtt, 0));
+
std::map<std::string, std::string> variation_params;
- TestNetworkQualityEstimator estimator(variation_params);
+ TestNetworkQualityEstimator estimator(
+ variation_params, std::move(external_estimate_provider));
+
estimator.SetTickClockForTesting(std::move(tick_clock));
estimator.SimulateNetworkChangeTo(
NetworkChangeNotifier::ConnectionType::CONNECTION_WIFI, "test-1");
@@ -1790,6 +1795,15 @@ TEST(NetworkQualityEstimatorTest, MAYBE_RecordAccuracy) {
"NQE.Accuracy.TransportRTT.EstimatedObservedDiff." +
sign_suffix_with_zero_samples + "." + interval_value + ".60_140",
0);
+
+ histogram_tester.ExpectUniqueSample(
+ "NQE.ExternalEstimateProvider.RTT.Accuracy.EstimatedObservedDiff." +
+ sign_suffix_with_one_sample + "." + interval_value + ".60_140",
+ diff, 1);
+ histogram_tester.ExpectTotalCount(
+ "NQE.ExternalEstimateProvider.RTT.Accuracy.EstimatedObservedDiff." +
+ sign_suffix_with_zero_samples + "." + interval_value + ".60_140",
+ 0);
}
}
}
« no previous file with comments | « net/nqe/network_quality_estimator.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698