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

Unified Diff: net/nqe/network_quality_estimator_unittest.cc

Issue 2064763003: Add function that converts string connection type to ECT (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed bengr comments Created 4 years, 6 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 52d5bf7b81646c31193df6016d0e377591a97eda..68ca6304016bdfe530a5788b1bc4d9816199878b 100644
--- a/net/nqe/network_quality_estimator_unittest.cc
+++ b/net/nqe/network_quality_estimator_unittest.cc
@@ -1678,4 +1678,22 @@ TEST(NetworkQualityEstimatorTest, MAYBE_RecordAccuracy) {
}
}
+// Tests that the effective connection type is converted correctly to a
+// descriptive string name, and vice-versa.
+TEST(NetworkQualityEstimatorTest, NameConnectionTypeConversion) {
+ for (size_t i = 0;
+ i < NetworkQualityEstimator::EFFECTIVE_CONNECTION_TYPE_LAST; ++i) {
+ const NetworkQualityEstimator::EffectiveConnectionType
+ effective_connection_type =
+ static_cast<NetworkQualityEstimator::EffectiveConnectionType>(i);
+ std::string connection_type_name =
+ std::string(NetworkQualityEstimator::GetNameForEffectiveConnectionType(
+ effective_connection_type));
+ EXPECT_FALSE(connection_type_name.empty());
+ EXPECT_EQ(effective_connection_type,
+ NetworkQualityEstimator::GetEffectiveConnectionTypeForName(
+ connection_type_name));
+ }
+}
+
} // namespace net
« 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