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

Unified Diff: net/nqe/network_quality_estimator_unittest.cc

Issue 2875073004: Move more variables to NQE params class (Closed)
Patch Set: ryansturm comments Created 3 years, 7 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_params_unittest.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 c3bad86d5f73c31cdeea2090c08fab36e499b84c..263e9882195bbbe897f0ce284dee9302ef01c506 100644
--- a/net/nqe/network_quality_estimator_unittest.cc
+++ b/net/nqe/network_quality_estimator_unittest.cc
@@ -2813,69 +2813,12 @@ TEST(NetworkQualityEstimatorTest, TypicalNetworkQualities) {
};
for (const auto& test : tests) {
- TestNetworkQualitiesCacheObserver observer;
std::map<std::string, std::string> variation_params;
if (test.use_transport_rtt) {
variation_params["effective_connection_type_algorithm"] =
"TransportRTTOrDownstreamThroughput";
}
TestNetworkQualityEstimator estimator(variation_params);
-
- // Typical network quality should not be set for Unknown and Offline.
- for (size_t i = EFFECTIVE_CONNECTION_TYPE_UNKNOWN;
- i <= EFFECTIVE_CONNECTION_TYPE_OFFLINE; ++i) {
- EXPECT_EQ(nqe::internal::InvalidRTT(),
- estimator.typical_network_quality_[i].http_rtt());
-
- EXPECT_EQ(nqe::internal::InvalidRTT(),
- estimator.typical_network_quality_[i].transport_rtt());
- }
-
- // Typical network quality should be set for other effective connection
- // types.
- for (size_t i = EFFECTIVE_CONNECTION_TYPE_SLOW_2G;
- i <= EFFECTIVE_CONNECTION_TYPE_3G; ++i) {
- // The typical RTT for an effective connection type should be at least as
- // much as the threshold RTT.
- EXPECT_NE(nqe::internal::InvalidRTT(),
- estimator.typical_network_quality_[i].http_rtt());
- EXPECT_GT(estimator.typical_network_quality_[i].http_rtt(),
- estimator.connection_thresholds_[i].http_rtt());
-
- EXPECT_NE(nqe::internal::InvalidRTT(),
- estimator.typical_network_quality_[i].transport_rtt());
- EXPECT_GT(estimator.typical_network_quality_[i].transport_rtt(),
- estimator.connection_thresholds_[i].transport_rtt());
-
- // The typical throughput for an effective connection type should not be
- // more than the threshold throughput.
- if (estimator.connection_thresholds_[i].downstream_throughput_kbps() !=
- nqe::internal::kInvalidThroughput) {
- EXPECT_LT(
- estimator.typical_network_quality_[i].downstream_throughput_kbps(),
- estimator.connection_thresholds_[i].downstream_throughput_kbps());
- }
- }
-
- // The typical network quality of 4G connection should be at least as fast
- // as the threshold for 3G connection.
- EXPECT_LT(estimator.typical_network_quality_[EFFECTIVE_CONNECTION_TYPE_4G]
- .http_rtt(),
- estimator.connection_thresholds_[EFFECTIVE_CONNECTION_TYPE_3G]
- .http_rtt());
- EXPECT_LT(estimator.typical_network_quality_[EFFECTIVE_CONNECTION_TYPE_4G]
- .transport_rtt(),
- estimator.connection_thresholds_[EFFECTIVE_CONNECTION_TYPE_3G]
- .transport_rtt());
- if (estimator.connection_thresholds_[EFFECTIVE_CONNECTION_TYPE_3G]
- .downstream_throughput_kbps() !=
- nqe::internal::kInvalidThroughput) {
- EXPECT_GT(estimator.typical_network_quality_[EFFECTIVE_CONNECTION_TYPE_4G]
- .downstream_throughput_kbps(),
- estimator.connection_thresholds_[EFFECTIVE_CONNECTION_TYPE_3G]
- .downstream_throughput_kbps());
- }
-
TestDelegate test_delegate;
TestURLRequestContext context(true);
context.set_network_quality_estimator(&estimator);
@@ -2888,10 +2831,14 @@ TEST(NetworkQualityEstimatorTest, TypicalNetworkQualities) {
// |effective_connection_type|. The effective connection type should be
// computed as |effective_connection_type|.
estimator.set_start_time_null_http_rtt(
- estimator.typical_network_quality_[effective_connection_type]
+ estimator.params_
+ .TypicalNetworkQuality(static_cast<EffectiveConnectionType>(
+ effective_connection_type))
.http_rtt());
estimator.set_start_time_null_transport_rtt(
- estimator.typical_network_quality_[effective_connection_type]
+ estimator.params_
+ .TypicalNetworkQuality(static_cast<EffectiveConnectionType>(
+ effective_connection_type))
.transport_rtt());
estimator.set_start_time_null_downlink_throughput_kbps(INT32_MAX);
« no previous file with comments | « net/nqe/network_quality_estimator_params_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698