Chromium Code Reviews| 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 40a28c55e53f7c6b7c6f6b608aa9dabc8df9d546..23db17734663537a0fab06588b7a7979f2e3eb74 100644 |
| --- a/net/nqe/network_quality_estimator_unittest.cc |
| +++ b/net/nqe/network_quality_estimator_unittest.cc |
| @@ -1812,4 +1812,39 @@ TEST(NetworkQualityEstimatorTest, NameConnectionTypeConversion) { |
| } |
| } |
| +TEST(NetworkQualityEstimatorTest, TestRecordNetworkIDAvailability) { |
| + base::HistogramTester histogram_tester; |
| + std::map<std::string, std::string> variation_params; |
| + TestNetworkQualityEstimator estimator(variation_params); |
| + |
| + // Network ID is recorded as available on Wi-Fi connection. |
|
bengr
2016/07/08 17:00:07
Network -> The network
tbansal1
2016/07/08 18:39:08
Done.
|
| + estimator.SimulateNetworkChangeTo( |
| + NetworkChangeNotifier::ConnectionType::CONNECTION_WIFI, "test-1"); |
| + histogram_tester.ExpectUniqueSample("NQE.NetworkIdAvailable", 1, 1); |
| + |
| + // Histogram is not recorded on unknown connection. |
|
bengr
2016/07/08 17:00:07
Histogram -> The histogram
on -> on an
tbansal1
2016/07/08 18:39:08
Done.
|
| + estimator.SimulateNetworkChangeTo( |
| + NetworkChangeNotifier::ConnectionType::CONNECTION_UNKNOWN, ""); |
| + histogram_tester.ExpectTotalCount("NQE.NetworkIdAvailable", 1); |
| + |
| + // Network ID is recorded as not available on Wi-Fi connection with empty |
|
bengr
2016/07/08 17:00:07
Network -> The network
not -> not being
on -> on a
tbansal1
2016/07/08 18:39:08
Done.
|
| + // SSID. |
| + estimator.SimulateNetworkChangeTo( |
| + NetworkChangeNotifier::ConnectionType::CONNECTION_WIFI, ""); |
| + histogram_tester.ExpectBucketCount("NQE.NetworkIdAvailable", 0, 1); |
| + histogram_tester.ExpectTotalCount("NQE.NetworkIdAvailable", 2); |
| + |
| + // Network ID is recorded as available on Wi-Fi connection. |
|
bengr
2016/07/08 17:00:07
Network -> The network
as -> as being
on -> on a
tbansal1
2016/07/08 18:39:08
Done.
|
| + estimator.SimulateNetworkChangeTo( |
| + NetworkChangeNotifier::ConnectionType::CONNECTION_WIFI, "test-1"); |
| + histogram_tester.ExpectBucketCount("NQE.NetworkIdAvailable", 1, 2); |
| + histogram_tester.ExpectTotalCount("NQE.NetworkIdAvailable", 3); |
| + |
| + // Network ID is recorded as available on cellular connection. |
|
bengr
2016/07/08 17:00:07
Network -> The network
as -> as being
on -> on a
tbansal1
2016/07/08 18:39:08
Done.
|
| + estimator.SimulateNetworkChangeTo( |
| + NetworkChangeNotifier::ConnectionType::CONNECTION_2G, "test-1"); |
| + histogram_tester.ExpectBucketCount("NQE.NetworkIdAvailable", 1, 3); |
| + histogram_tester.ExpectTotalCount("NQE.NetworkIdAvailable", 4); |
| +} |
| + |
| } // namespace net |