OLD | NEW |
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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 | 252 |
253 for (int i = entries.size() - 1; i >= 0; --i) { | 253 for (int i = entries.size() - 1; i >= 0; --i) { |
254 if (entries[i].type == type && | 254 if (entries[i].type == type && |
255 entries[i].GetIntegerValue(key, &return_value)) { | 255 entries[i].GetIntegerValue(key, &return_value)) { |
256 return return_value; | 256 return return_value; |
257 } | 257 } |
258 } | 258 } |
259 return return_value; | 259 return return_value; |
260 } | 260 } |
261 | 261 |
| 262 void TestNetworkQualityEstimator:: |
| 263 NotifyObserversOfRTTOrThroughputEstimatesComputed( |
| 264 const net::nqe::internal::NetworkQuality& network_quality) { |
| 265 for (auto& observer : rtt_and_throughput_estimates_observer_list_) { |
| 266 observer.OnRTTOrThroughputEstimatesComputed( |
| 267 network_quality.http_rtt(), network_quality.transport_rtt(), |
| 268 network_quality.downstream_throughput_kbps()); |
| 269 } |
| 270 } |
| 271 |
262 nqe::internal::NetworkID TestNetworkQualityEstimator::GetCurrentNetworkID() | 272 nqe::internal::NetworkID TestNetworkQualityEstimator::GetCurrentNetworkID() |
263 const { | 273 const { |
264 return nqe::internal::NetworkID(current_network_type_, current_network_id_); | 274 return nqe::internal::NetworkID(current_network_type_, current_network_id_); |
265 } | 275 } |
266 | 276 |
267 TestNetworkQualityEstimator::LocalHttpTestServer::LocalHttpTestServer( | 277 TestNetworkQualityEstimator::LocalHttpTestServer::LocalHttpTestServer( |
268 const base::FilePath& document_root) { | 278 const base::FilePath& document_root) { |
269 AddDefaultHandlers(document_root); | 279 AddDefaultHandlers(document_root); |
270 } | 280 } |
271 | 281 |
272 } // namespace net | 282 } // namespace net |
OLD | NEW |