| 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 #ifndef NET_NQE_NETWORK_QUALITY_ESTIMATOR_TEST_UTIL_H_ | 5 #ifndef NET_NQE_NETWORK_QUALITY_ESTIMATOR_TEST_UTIL_H_ |
| 6 #define NET_NQE_NETWORK_QUALITY_ESTIMATOR_TEST_UTIL_H_ | 6 #define NET_NQE_NETWORK_QUALITY_ESTIMATOR_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 recent_effective_connection_type_set_ = true; | 77 recent_effective_connection_type_set_ = true; |
| 78 recent_effective_connection_type_ = type; | 78 recent_effective_connection_type_ = type; |
| 79 } | 79 } |
| 80 | 80 |
| 81 // Returns the effective connection type that was set using | 81 // Returns the effective connection type that was set using |
| 82 // |set_effective_connection_type|. If the connection type has not been set, | 82 // |set_effective_connection_type|. If the connection type has not been set, |
| 83 // then the base implementation is called. | 83 // then the base implementation is called. |
| 84 EffectiveConnectionType GetRecentEffectiveConnectionType( | 84 EffectiveConnectionType GetRecentEffectiveConnectionType( |
| 85 const base::TimeTicks& start_time) const override; | 85 const base::TimeTicks& start_time) const override; |
| 86 | 86 |
| 87 // Returns the effective connection type that was set using |
| 88 // |set_effective_connection_type|. If the connection type has not been set, |
| 89 // then the base implementation is called. |http_rtt|, |transport_rtt| and |
| 90 // |downstream_throughput_kbps| are set to the values that were previously |
| 91 // set by calling set_recent_http_rtt(), set_recent_transport_rtt() |
| 92 // and set_recent_transport_rtt() methods, respectively. |
| 93 EffectiveConnectionType GetRecentEffectiveConnectionTypeAndNetworkQuality( |
| 94 const base::TimeTicks& start_time, |
| 95 base::TimeDelta* http_rtt, |
| 96 base::TimeDelta* transport_rtt, |
| 97 int32_t* downstream_throughput_kbps) const override; |
| 98 |
| 87 void set_http_rtt(const base::TimeDelta& http_rtt) { | 99 void set_http_rtt(const base::TimeDelta& http_rtt) { |
| 88 http_rtt_set_ = true; | 100 http_rtt_set_ = true; |
| 89 http_rtt_ = http_rtt; | 101 http_rtt_ = http_rtt; |
| 90 } | 102 } |
| 91 // Returns the HTTP RTT that was set using |set_http_rtt|. If the HTTP RTT has | 103 // Returns the HTTP RTT that was set using |set_http_rtt|. If the HTTP RTT has |
| 92 // not been set, then the base implementation is called. | 104 // not been set, then the base implementation is called. |
| 93 bool GetHttpRTT(base::TimeDelta* rtt) const override; | 105 bool GetHttpRTT(base::TimeDelta* rtt) const override; |
| 94 | 106 |
| 95 void set_recent_http_rtt(const base::TimeDelta& recent_http_rtt) { | 107 void set_recent_http_rtt(const base::TimeDelta& recent_http_rtt) { |
| 96 recent_http_rtt_set_ = true; | 108 recent_http_rtt_set_ = true; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 double rand_double_; | 204 double rand_double_; |
| 193 | 205 |
| 194 EmbeddedTestServer embedded_test_server_; | 206 EmbeddedTestServer embedded_test_server_; |
| 195 | 207 |
| 196 DISALLOW_COPY_AND_ASSIGN(TestNetworkQualityEstimator); | 208 DISALLOW_COPY_AND_ASSIGN(TestNetworkQualityEstimator); |
| 197 }; | 209 }; |
| 198 | 210 |
| 199 } // namespace net | 211 } // namespace net |
| 200 | 212 |
| 201 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_TEST_UTIL_H_ | 213 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_TEST_UTIL_H_ |
| OLD | NEW |