| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 const std::vector<base::TimeDelta>& GetAccuracyRecordingIntervals() | 174 const std::vector<base::TimeDelta>& GetAccuracyRecordingIntervals() |
| 175 const override; | 175 const override; |
| 176 | 176 |
| 177 void set_rand_double(double rand_double) { rand_double_ = rand_double; } | 177 void set_rand_double(double rand_double) { rand_double_ = rand_double; } |
| 178 | 178 |
| 179 double RandDouble() const override; | 179 double RandDouble() const override; |
| 180 | 180 |
| 181 // Returns the number of entries in |net_log_| that have type set to |type|. | 181 // Returns the number of entries in |net_log_| that have type set to |type|. |
| 182 int GetEntriesCount(NetLogEventType type) const; | 182 int GetEntriesCount(NetLogEventType type) const; |
| 183 | 183 |
| 184 // Returns the value of the parameter with name |key| from the last net log |
| 185 // entry that has type set to |type|. Different methods are provided for |
| 186 // values of different types. |
| 187 std::string GetNetLogLastStringValue(NetLogEventType type, |
| 188 const std::string& key) const; |
| 189 int GetNetLogLastIntegerValue(NetLogEventType type, |
| 190 const std::string& key) const; |
| 191 |
| 184 using NetworkQualityEstimator::SetTickClockForTesting; | 192 using NetworkQualityEstimator::SetTickClockForTesting; |
| 185 using NetworkQualityEstimator::OnConnectionTypeChanged; | 193 using NetworkQualityEstimator::OnConnectionTypeChanged; |
| 186 | 194 |
| 187 private: | 195 private: |
| 188 class LocalHttpTestServer : public EmbeddedTestServer { | 196 class LocalHttpTestServer : public EmbeddedTestServer { |
| 189 public: | 197 public: |
| 190 explicit LocalHttpTestServer(const base::FilePath& document_root); | 198 explicit LocalHttpTestServer(const base::FilePath& document_root); |
| 191 }; | 199 }; |
| 192 | 200 |
| 193 // NetworkQualityEstimator implementation that returns the overridden | 201 // NetworkQualityEstimator implementation that returns the overridden |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 | 239 |
| 232 // Net log provided to network quality estimator. | 240 // Net log provided to network quality estimator. |
| 233 std::unique_ptr<net::BoundTestNetLog> net_log_; | 241 std::unique_ptr<net::BoundTestNetLog> net_log_; |
| 234 | 242 |
| 235 DISALLOW_COPY_AND_ASSIGN(TestNetworkQualityEstimator); | 243 DISALLOW_COPY_AND_ASSIGN(TestNetworkQualityEstimator); |
| 236 }; | 244 }; |
| 237 | 245 |
| 238 } // namespace net | 246 } // namespace net |
| 239 | 247 |
| 240 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_TEST_UTIL_H_ | 248 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_TEST_UTIL_H_ |
| OLD | NEW |