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

Unified Diff: net/nqe/network_quality_estimator_unittest.cc

Issue 2453653002: Separate out observation sources as either HTTP layer or transport layer (Closed)
Patch Set: Addressed bengr comments Created 4 years, 1 month 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') | net/nqe/network_quality_observation_source.h » ('j') | 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 81ae4622d86c426f1302a1adda9cba1241d109e7..3f329583a7b15e89f904546ae15c4d8716e9c767 100644
--- a/net/nqe/network_quality_estimator_unittest.cc
+++ b/net/nqe/network_quality_estimator_unittest.cc
@@ -951,11 +951,10 @@ TEST(NetworkQualityEstimatorTest, TestGetMetricsSince) {
for (size_t i = 0; i < 2; ++i) {
estimator.downstream_throughput_kbps_observations_.AddObservation(
NetworkQualityEstimator::ThroughputObservation(
- old_downlink_kbps, old,
- NETWORK_QUALITY_OBSERVATION_SOURCE_URL_REQUEST));
+ old_downlink_kbps, old, NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP));
estimator.rtt_observations_.AddObservation(
NetworkQualityEstimator::RttObservation(
- old_url_rtt, old, NETWORK_QUALITY_OBSERVATION_SOURCE_URL_REQUEST));
+ old_url_rtt, old, NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP));
estimator.rtt_observations_.AddObservation(
NetworkQualityEstimator::RttObservation(
old_tcp_rtt, old, NETWORK_QUALITY_OBSERVATION_SOURCE_TCP));
@@ -975,11 +974,10 @@ TEST(NetworkQualityEstimatorTest, TestGetMetricsSince) {
estimator.downstream_throughput_kbps_observations_.AddObservation(
NetworkQualityEstimator::ThroughputObservation(
- new_downlink_kbps, now,
- NETWORK_QUALITY_OBSERVATION_SOURCE_URL_REQUEST));
+ new_downlink_kbps, now, NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP));
estimator.rtt_observations_.AddObservation(
NetworkQualityEstimator::RttObservation(
- new_url_rtt, now, NETWORK_QUALITY_OBSERVATION_SOURCE_URL_REQUEST));
+ new_url_rtt, now, NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP));
estimator.rtt_observations_.AddObservation(
NetworkQualityEstimator::RttObservation(
new_tcp_rtt, now, NETWORK_QUALITY_OBSERVATION_SOURCE_TCP));
@@ -1477,7 +1475,7 @@ TEST(NetworkQualityEstimatorTest, UnknownEffectiveConnectionType) {
NetworkQualityEstimator::RttObservation rtt_observation(
base::TimeDelta::FromSeconds(5), tick_clock_ptr->NowTicks(),
- NETWORK_QUALITY_OBSERVATION_SOURCE_URL_REQUEST);
+ NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP);
for (size_t i = 0; i < 10; ++i) {
estimator.NotifyObserversOfRTT(rtt_observation);
@@ -1491,7 +1489,7 @@ TEST(NetworkQualityEstimatorTest, UnknownEffectiveConnectionType) {
// type since the last computed effective connection type was unknown.
estimator.NotifyObserversOfRTT(NetworkQualityEstimator::RttObservation(
base::TimeDelta::FromSeconds(5), tick_clock_ptr->NowTicks(),
- NETWORK_QUALITY_OBSERVATION_SOURCE_URL_REQUEST));
+ NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP));
++expected_effective_connection_type_notifications;
EXPECT_EQ(expected_effective_connection_type_notifications,
observer.effective_connection_types().size());
@@ -1564,11 +1562,11 @@ TEST(NetworkQualityEstimatorTest,
estimator.rtt_observations_.AddObservation(
NetworkQualityEstimator::RttObservation(
base::TimeDelta::FromSeconds(5), tick_clock_ptr->NowTicks(),
- NETWORK_QUALITY_OBSERVATION_SOURCE_URL_REQUEST));
+ NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP));
estimator.NotifyObserversOfRTT(NetworkQualityEstimator::RttObservation(
base::TimeDelta::FromSeconds(5), tick_clock_ptr->NowTicks(),
- NETWORK_QUALITY_OBSERVATION_SOURCE_URL_REQUEST));
+ NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP));
if (i == rtt_observations_count) {
// Effective connection type must be recomputed since the number of RTT
@@ -1623,14 +1621,12 @@ TEST(NetworkQualityEstimatorTest, TestRttThroughputObservers) {
for (const auto& observation : rtt_observer.observations()) {
EXPECT_LE(0, observation.rtt_ms);
EXPECT_LE(0, (observation.timestamp - then).InMilliseconds());
- EXPECT_EQ(NETWORK_QUALITY_OBSERVATION_SOURCE_URL_REQUEST,
- observation.source);
+ EXPECT_EQ(NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP, observation.source);
}
for (const auto& observation : throughput_observer.observations()) {
EXPECT_LE(0, observation.throughput_kbps);
EXPECT_LE(0, (observation.timestamp - then).InMilliseconds());
- EXPECT_EQ(NETWORK_QUALITY_OBSERVATION_SOURCE_URL_REQUEST,
- observation.source);
+ EXPECT_EQ(NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP, observation.source);
}
EXPECT_FALSE(estimator.GetTransportRTT(&rtt));
« no previous file with comments | « net/nqe/network_quality_estimator.cc ('k') | net/nqe/network_quality_observation_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698