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 8641c84dcf4d7cb0c6d1211ff52545e04c5b8dea..b8748f2a5d470d38b2955ebe97fc88b3431be0b5 100644 |
--- a/net/base/network_quality_estimator_unittest.cc |
+++ b/net/base/network_quality_estimator_unittest.cc |
@@ -839,6 +839,7 @@ class InvalidExternalEstimateProvider : public ExternalEstimateProvider { |
// Tests if the RTT value from external estimate provider is discarded if the |
// external estimate provider is invalid. |
TEST(NetworkQualityEstimatorTest, InvalidExternalEstimateProvider) { |
+ base::HistogramTester histogram_tester; |
InvalidExternalEstimateProvider* invalid_external_estimate_provider = |
new InvalidExternalEstimateProvider(); |
scoped_ptr<ExternalEstimateProvider> external_estimate_provider( |
@@ -852,6 +853,17 @@ TEST(NetworkQualityEstimatorTest, InvalidExternalEstimateProvider) { |
EXPECT_EQ(1U, invalid_external_estimate_provider->get_rtt_count()); |
EXPECT_FALSE(estimator.GetURLRequestRTTEstimate(&rtt)); |
EXPECT_FALSE(estimator.GetDownlinkThroughputKbpsEstimate(&kbps)); |
+ histogram_tester.ExpectTotalCount("NQE.ExternalEstimateProviderStatus", 3); |
+ |
+ histogram_tester.ExpectBucketCount( |
+ "NQE.ExternalEstimateProviderStatus", |
+ 1 /*EXTERNAL_ESTIMATE_PROVIDER_STATUS_AVAILABLE*/, 1); |
bengr
2016/04/21 22:58:37
nit: Add spaces: /* EXTERNAL...AVAILABLE */, here
tbansal1
2016/04/26 21:25:28
Done.
|
+ histogram_tester.ExpectBucketCount( |
+ "NQE.ExternalEstimateProviderStatus", |
+ 2 /*EXTERNAL_ESTIMATE_PROVIDER_STATUS_QUERIED*/, 1); |
+ histogram_tester.ExpectBucketCount( |
+ "NQE.ExternalEstimateProviderStatus", |
+ 3 /*EXTERNAL_ESTIMATE_PROVIDER_STATUS_QUERY_SUCCESSFUL*/, 1); |
} |
class TestExternalEstimateProvider : public ExternalEstimateProvider { |
@@ -936,6 +948,7 @@ class TestExternalEstimateProvider : public ExternalEstimateProvider { |
// Tests if the external estimate provider is called in the constructor and |
// on network change notification. |
TEST(NetworkQualityEstimatorTest, TestExternalEstimateProvider) { |
+ base::HistogramTester histogram_tester; |
TestExternalEstimateProvider* test_external_estimate_provider = |
new TestExternalEstimateProvider(base::TimeDelta::FromMilliseconds(1), |
100); |
@@ -950,6 +963,24 @@ TEST(NetworkQualityEstimatorTest, TestExternalEstimateProvider) { |
EXPECT_TRUE(estimator.GetURLRequestRTTEstimate(&rtt)); |
EXPECT_TRUE(estimator.GetDownlinkThroughputKbpsEstimate(&kbps)); |
+ histogram_tester.ExpectTotalCount("NQE.ExternalEstimateProviderStatus", 5); |
+ |
+ histogram_tester.ExpectBucketCount( |
+ "NQE.ExternalEstimateProviderStatus", |
+ 1 /*EXTERNAL_ESTIMATE_PROVIDER_STATUS_AVAILABLE*/, 1); |
+ histogram_tester.ExpectBucketCount( |
+ "NQE.ExternalEstimateProviderStatus", |
+ 2 /*EXTERNAL_ESTIMATE_PROVIDER_STATUS_QUERIED*/, 1); |
+ histogram_tester.ExpectBucketCount( |
+ "NQE.ExternalEstimateProviderStatus", |
+ 3 /*EXTERNAL_ESTIMATE_PROVIDER_STATUS_QUERY_SUCCESSFUL*/, 1); |
+ histogram_tester.ExpectBucketCount( |
+ "NQE.ExternalEstimateProviderStatus", |
+ 5 /*EXTERNAL_ESTIMATE_PROVIDER_STATUS_RTT_AVAILABLE*/, 1); |
+ histogram_tester.ExpectBucketCount( |
+ "NQE.ExternalEstimateProviderStatus", |
+ 6 /*EXTERNAL_ESTIMATE_PROVIDER_STATUS_DOWNLINK_BANDWIDTH_AVAILABLE*/, 1); |
+ |
EXPECT_EQ( |
1U, test_external_estimate_provider->get_time_since_last_update_count()); |
EXPECT_EQ(1U, test_external_estimate_provider->get_rtt_count()); |