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

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

Issue 2406763003: Add Network Quality observer to NQE (Closed)
Patch Set: Fix presubmit errors (FOR_EACH_OBSERVER is deprecated) Created 4 years, 2 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
« no previous file with comments | « net/nqe/network_quality_estimator.cc ('k') | net/nqe/network_quality_estimator_test_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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
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_
OLDNEW
« no previous file with comments | « net/nqe/network_quality_estimator.cc ('k') | net/nqe/network_quality_estimator_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698