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

Side by Side Diff: net/nqe/network_quality_estimator_test_util.cc

Issue 2710973003: Record RTT prediction accuracy when using average algorithms (Closed)
Patch Set: Add unweighted average Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/nqe/network_quality_estimator_test_util.h" 5 #include "net/nqe/network_quality_estimator_test_util.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "net/base/load_flags.h" 10 #include "net/base/load_flags.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 175 }
176 176
177 if (recent_downlink_throughput_kbps_) { 177 if (recent_downlink_throughput_kbps_) {
178 *kbps = recent_downlink_throughput_kbps_.value(); 178 *kbps = recent_downlink_throughput_kbps_.value();
179 return true; 179 return true;
180 } 180 }
181 return NetworkQualityEstimator::GetRecentDownlinkThroughputKbps(start_time, 181 return NetworkQualityEstimator::GetRecentDownlinkThroughputKbps(start_time,
182 kbps); 182 kbps);
183 } 183 }
184 184
185 base::TimeDelta TestNetworkQualityEstimator::GetRTTEstimateInternal(
186 const std::vector<NetworkQualityObservationSource>&
187 disallowed_observation_sources,
188 base::TimeTicks start_time,
189 const base::Optional<NetworkQualityEstimator::Statistic>& statistic,
190 int percentile) const {
191 if (rtt_estimate_internal_)
192 return rtt_estimate_internal_.value();
193
194 return NetworkQualityEstimator::GetRTTEstimateInternal(
195 disallowed_observation_sources, start_time, statistic, percentile);
196 }
197
185 void TestNetworkQualityEstimator::SetAccuracyRecordingIntervals( 198 void TestNetworkQualityEstimator::SetAccuracyRecordingIntervals(
186 const std::vector<base::TimeDelta>& accuracy_recording_intervals) { 199 const std::vector<base::TimeDelta>& accuracy_recording_intervals) {
187 accuracy_recording_intervals_set_ = true; 200 accuracy_recording_intervals_set_ = true;
188 accuracy_recording_intervals_ = accuracy_recording_intervals; 201 accuracy_recording_intervals_ = accuracy_recording_intervals;
189 } 202 }
190 203
191 const std::vector<base::TimeDelta>& 204 const std::vector<base::TimeDelta>&
192 TestNetworkQualityEstimator::GetAccuracyRecordingIntervals() const { 205 TestNetworkQualityEstimator::GetAccuracyRecordingIntervals() const {
193 if (accuracy_recording_intervals_set_) 206 if (accuracy_recording_intervals_set_)
194 return accuracy_recording_intervals_; 207 return accuracy_recording_intervals_;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 const { 261 const {
249 return nqe::internal::NetworkID(current_network_type_, current_network_id_); 262 return nqe::internal::NetworkID(current_network_type_, current_network_id_);
250 } 263 }
251 264
252 TestNetworkQualityEstimator::LocalHttpTestServer::LocalHttpTestServer( 265 TestNetworkQualityEstimator::LocalHttpTestServer::LocalHttpTestServer(
253 const base::FilePath& document_root) { 266 const base::FilePath& document_root) {
254 AddDefaultHandlers(document_root); 267 AddDefaultHandlers(document_root);
255 } 268 }
256 269
257 } // namespace net 270 } // namespace net
OLDNEW
« no previous file with comments | « net/nqe/network_quality_estimator_test_util.h ('k') | net/nqe/network_quality_estimator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698