| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 return NetworkQualityEstimator::GetRecentTransportRTT(start_time, rtt); | 176 return NetworkQualityEstimator::GetRecentTransportRTT(start_time, rtt); |
| 177 } | 177 } |
| 178 | 178 |
| 179 if (recent_transport_rtt_) { | 179 if (recent_transport_rtt_) { |
| 180 *rtt = recent_transport_rtt_.value(); | 180 *rtt = recent_transport_rtt_.value(); |
| 181 return true; | 181 return true; |
| 182 } | 182 } |
| 183 return NetworkQualityEstimator::GetRecentTransportRTT(start_time, rtt); | 183 return NetworkQualityEstimator::GetRecentTransportRTT(start_time, rtt); |
| 184 } | 184 } |
| 185 | 185 |
| 186 base::Optional<base::TimeDelta> TestNetworkQualityEstimator::GetTransportRTT() |
| 187 const { |
| 188 if (start_time_null_transport_rtt_) |
| 189 return start_time_null_transport_rtt_; |
| 190 return NetworkQualityEstimator::GetTransportRTT(); |
| 191 } |
| 192 |
| 186 bool TestNetworkQualityEstimator::GetRecentDownlinkThroughputKbps( | 193 bool TestNetworkQualityEstimator::GetRecentDownlinkThroughputKbps( |
| 187 const base::TimeTicks& start_time, | 194 const base::TimeTicks& start_time, |
| 188 int32_t* kbps) const { | 195 int32_t* kbps) const { |
| 189 if (start_time.is_null()) { | 196 if (start_time.is_null()) { |
| 190 if (start_time_null_downlink_throughput_kbps_) { | 197 if (start_time_null_downlink_throughput_kbps_) { |
| 191 *kbps = start_time_null_downlink_throughput_kbps_.value(); | 198 *kbps = start_time_null_downlink_throughput_kbps_.value(); |
| 192 return true; | 199 return true; |
| 193 } | 200 } |
| 194 return NetworkQualityEstimator::GetRecentDownlinkThroughputKbps(start_time, | 201 return NetworkQualityEstimator::GetRecentDownlinkThroughputKbps(start_time, |
| 195 kbps); | 202 kbps); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 NotifyRTTAndThroughputEstimatesObserverIfPresent( | 323 NotifyRTTAndThroughputEstimatesObserverIfPresent( |
| 317 RTTAndThroughputEstimatesObserver* observer) const { | 324 RTTAndThroughputEstimatesObserver* observer) const { |
| 318 if (suppress_notifications_for_testing_) | 325 if (suppress_notifications_for_testing_) |
| 319 return; | 326 return; |
| 320 | 327 |
| 321 NetworkQualityEstimator::NotifyRTTAndThroughputEstimatesObserverIfPresent( | 328 NetworkQualityEstimator::NotifyRTTAndThroughputEstimatesObserverIfPresent( |
| 322 observer); | 329 observer); |
| 323 } | 330 } |
| 324 | 331 |
| 325 } // namespace net | 332 } // namespace net |
| OLD | NEW |