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

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

Issue 2481373004: NQE: Add default RTT and throughput observations (Closed)
Patch Set: Rebased, addressed bengr comments Created 4 years 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
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 #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"
11 #include "net/url_request/url_request.h" 11 #include "net/url_request/url_request.h"
12 #include "net/url_request/url_request_test_util.h" 12 #include "net/url_request/url_request_test_util.h"
13 13
14 namespace { 14 namespace {
15 15
16 const base::FilePath::CharType kTestFilePath[] = 16 const base::FilePath::CharType kTestFilePath[] =
17 FILE_PATH_LITERAL("net/data/url_request_unittest"); 17 FILE_PATH_LITERAL("net/data/url_request_unittest");
18 18
19 } // namespace 19 } // namespace
20 20
21 namespace net { 21 namespace net {
22 22
23 TestNetworkQualityEstimator::TestNetworkQualityEstimator( 23 TestNetworkQualityEstimator::TestNetworkQualityEstimator(
24 const std::map<std::string, std::string>& variation_params, 24 const std::map<std::string, std::string>& variation_params,
25 std::unique_ptr<net::ExternalEstimateProvider> external_estimate_provider) 25 std::unique_ptr<net::ExternalEstimateProvider> external_estimate_provider)
26 : TestNetworkQualityEstimator(std::move(external_estimate_provider), 26 : TestNetworkQualityEstimator(std::move(external_estimate_provider),
27 variation_params, 27 variation_params,
28 true, 28 true,
29 true) {} 29 true,
30 false) {}
30 31
31 TestNetworkQualityEstimator::TestNetworkQualityEstimator( 32 TestNetworkQualityEstimator::TestNetworkQualityEstimator(
32 std::unique_ptr<net::ExternalEstimateProvider> external_estimate_provider, 33 std::unique_ptr<net::ExternalEstimateProvider> external_estimate_provider,
33 const std::map<std::string, std::string>& variation_params, 34 const std::map<std::string, std::string>& variation_params,
34 bool allow_local_host_requests_for_tests, 35 bool allow_local_host_requests_for_tests,
35 bool allow_smaller_responses_for_tests) 36 bool allow_smaller_responses_for_tests,
37 bool add_default_platform_observations)
36 : NetworkQualityEstimator(std::move(external_estimate_provider), 38 : NetworkQualityEstimator(std::move(external_estimate_provider),
37 variation_params, 39 variation_params,
38 allow_local_host_requests_for_tests, 40 allow_local_host_requests_for_tests,
39 allow_smaller_responses_for_tests), 41 allow_smaller_responses_for_tests,
42 add_default_platform_observations),
40 current_network_type_(NetworkChangeNotifier::CONNECTION_UNKNOWN), 43 current_network_type_(NetworkChangeNotifier::CONNECTION_UNKNOWN),
41 accuracy_recording_intervals_set_(false), 44 accuracy_recording_intervals_set_(false),
42 rand_double_(0.0), 45 rand_double_(0.0),
43 embedded_test_server_(base::FilePath(kTestFilePath)) { 46 embedded_test_server_(base::FilePath(kTestFilePath)) {
44 // Set up the embedded test server. 47 // Set up the embedded test server.
45 EXPECT_TRUE(embedded_test_server_.Start()); 48 EXPECT_TRUE(embedded_test_server_.Start());
46 } 49 }
47 50
48 TestNetworkQualityEstimator::TestNetworkQualityEstimator( 51 TestNetworkQualityEstimator::TestNetworkQualityEstimator(
49 const std::map<std::string, std::string>& variation_params) 52 const std::map<std::string, std::string>& variation_params)
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 const { 193 const {
191 return nqe::internal::NetworkID(current_network_type_, current_network_id_); 194 return nqe::internal::NetworkID(current_network_type_, current_network_id_);
192 } 195 }
193 196
194 TestNetworkQualityEstimator::LocalHttpTestServer::LocalHttpTestServer( 197 TestNetworkQualityEstimator::LocalHttpTestServer::LocalHttpTestServer(
195 const base::FilePath& document_root) { 198 const base::FilePath& document_root) {
196 AddDefaultHandlers(document_root); 199 AddDefaultHandlers(document_root);
197 } 200 }
198 201
199 } // namespace net 202 } // namespace net
OLDNEW
« no previous file with comments | « net/nqe/network_quality_estimator_test_util.h ('k') | net/nqe/network_quality_estimator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698