Commit 16fc12f2 authored by Thanh Le's avatar Thanh Le Committed by Commit Bot

Added unit test for checking Slow-2G-On-Cellular.

Bug: 796089
Change-Id: If98d74fdeac2892463f1353da778fb9973b07b86
Reviewed-on: https://chromium-review.googlesource.com/847694Reviewed-by: default avatarTarun Bansal <tbansal@chromium.org>
Commit-Queue: Thanh Le <thanhdle@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526540}
parent 247ffb59
......@@ -195,6 +195,33 @@ TEST(NetworkQualityEstimatorParamsTest, GetDefaultECT) {
}
}
// Verify ECT when forced ECT is Slow-2G-On-Cellular.
TEST(NetworkQualityEstimatorParamsTest, GetForcedECTCellularOnly) {
std::map<std::string, std::string> variation_params;
// Set force-effective-connection-type to Slow-2G-On-Cellular.
variation_params[kForceEffectiveConnectionType] =
kEffectiveConnectionTypeSlow2GOnCellular;
NetworkQualityEstimatorParams params(variation_params);
for (size_t i = 0; i < NetworkChangeNotifier::ConnectionType::CONNECTION_LAST;
++i) {
NetworkChangeNotifier::ConnectionType connection_type =
static_cast<NetworkChangeNotifier::ConnectionType>(i);
base::Optional<EffectiveConnectionType> ect =
params.GetForcedEffectiveConnectionType(connection_type);
if (net::NetworkChangeNotifier::IsConnectionCellular(connection_type)) {
// Test for cellular connection types. Make sure that ECT is Slow-2G.
EXPECT_EQ(EFFECTIVE_CONNECTION_TYPE_SLOW_2G, ect);
} else {
// Test for non-cellular connection types. Make sure that there is no
// forced ect.
EXPECT_EQ(base::nullopt, ect);
}
}
}
} // namespace
} // namespace internal
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment