Chromium Code Reviews| 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/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "net/base/load_flags.h" | 9 #include "net/base/load_flags.h" |
| 10 #include "net/test/embedded_test_server/http_response.h" | 10 #include "net/test/embedded_test_server/http_response.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 http_response->set_code(HTTP_OK); | 77 http_response->set_code(HTTP_OK); |
| 78 http_response->set_content("hello"); | 78 http_response->set_content("hello"); |
| 79 http_response->set_content_type("text/plain"); | 79 http_response->set_content_type("text/plain"); |
| 80 return std::move(http_response); | 80 return std::move(http_response); |
| 81 } | 81 } |
| 82 | 82 |
| 83 const GURL TestNetworkQualityEstimator::GetEchoURL() const { | 83 const GURL TestNetworkQualityEstimator::GetEchoURL() const { |
| 84 return embedded_test_server_.GetURL("/echo.html"); | 84 return embedded_test_server_.GetURL("/echo.html"); |
| 85 } | 85 } |
| 86 | 86 |
| 87 const GURL TestNetworkQualityEstimator::GetRedirectURL() const { | |
| 88 return embedded_test_server_.GetURL("/redirect302-to-https"); | |
|
mmenke
2016/11/08 21:52:56
Doesn't look like the embedded test server is corr
tbansal1
2016/11/09 04:59:18
Fixed but in a different way.
| |
| 89 } | |
| 90 | |
| 87 EffectiveConnectionType | 91 EffectiveConnectionType |
| 88 TestNetworkQualityEstimator::GetEffectiveConnectionType() const { | 92 TestNetworkQualityEstimator::GetEffectiveConnectionType() const { |
| 89 if (effective_connection_type_) | 93 if (effective_connection_type_) |
| 90 return effective_connection_type_.value(); | 94 return effective_connection_type_.value(); |
| 91 return NetworkQualityEstimator::GetEffectiveConnectionType(); | 95 return NetworkQualityEstimator::GetEffectiveConnectionType(); |
| 92 } | 96 } |
| 93 | 97 |
| 94 EffectiveConnectionType | 98 EffectiveConnectionType |
| 95 TestNetworkQualityEstimator::GetRecentEffectiveConnectionType( | 99 TestNetworkQualityEstimator::GetRecentEffectiveConnectionType( |
| 96 const base::TimeTicks& start_time) const { | 100 const base::TimeTicks& start_time) const { |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 188 double TestNetworkQualityEstimator::RandDouble() const { | 192 double TestNetworkQualityEstimator::RandDouble() const { |
| 189 return rand_double_; | 193 return rand_double_; |
| 190 } | 194 } |
| 191 | 195 |
| 192 nqe::internal::NetworkID TestNetworkQualityEstimator::GetCurrentNetworkID() | 196 nqe::internal::NetworkID TestNetworkQualityEstimator::GetCurrentNetworkID() |
| 193 const { | 197 const { |
| 194 return nqe::internal::NetworkID(current_network_type_, current_network_id_); | 198 return nqe::internal::NetworkID(current_network_type_, current_network_id_); |
| 195 } | 199 } |
| 196 | 200 |
| 197 } // namespace net | 201 } // namespace net |
| OLD | NEW |