| Index: net/nqe/network_quality_estimator_test_util.cc
|
| diff --git a/net/nqe/network_quality_estimator_test_util.cc b/net/nqe/network_quality_estimator_test_util.cc
|
| index d93e286180ed47bdc16552ca36828088cc31b4cf..e9c586ebe18c525be1afdfa2b20bee0c7196c151 100644
|
| --- a/net/nqe/network_quality_estimator_test_util.cc
|
| +++ b/net/nqe/network_quality_estimator_test_util.cc
|
| @@ -5,8 +5,12 @@
|
| #include "net/nqe/network_quality_estimator_test_util.h"
|
|
|
| #include "base/files/file_path.h"
|
| +#include "base/memory/ptr_util.h"
|
| #include "base/run_loop.h"
|
| #include "net/base/load_flags.h"
|
| +#include "net/log/net_log_with_source.h"
|
| +#include "net/log/test_net_log.h"
|
| +#include "net/log/test_net_log_entry.h"
|
| #include "net/test/embedded_test_server/http_response.h"
|
| #include "net/url_request/url_request.h"
|
| #include "net/url_request/url_request_test_util.h"
|
| @@ -36,23 +40,27 @@ TestNetworkQualityEstimator::TestNetworkQualityEstimator(
|
| variation_params,
|
| true,
|
| true,
|
| - false) {}
|
| + false,
|
| + base::MakeUnique<BoundTestNetLog>()) {}
|
|
|
| TestNetworkQualityEstimator::TestNetworkQualityEstimator(
|
| std::unique_ptr<net::ExternalEstimateProvider> external_estimate_provider,
|
| const std::map<std::string, std::string>& variation_params,
|
| bool allow_local_host_requests_for_tests,
|
| bool allow_smaller_responses_for_tests,
|
| - bool add_default_platform_observations)
|
| + bool add_default_platform_observations,
|
| + std::unique_ptr<BoundTestNetLog> net_log)
|
| : NetworkQualityEstimator(std::move(external_estimate_provider),
|
| variation_params,
|
| allow_local_host_requests_for_tests,
|
| allow_smaller_responses_for_tests,
|
| - add_default_platform_observations),
|
| + add_default_platform_observations,
|
| + net_log->bound()),
|
| current_network_type_(NetworkChangeNotifier::CONNECTION_UNKNOWN),
|
| accuracy_recording_intervals_set_(false),
|
| rand_double_(0.0),
|
| - embedded_test_server_(base::FilePath(kTestFilePath)) {
|
| + embedded_test_server_(base::FilePath(kTestFilePath)),
|
| + net_log_(std::move(net_log)) {
|
| // Set up the embedded test server.
|
| EXPECT_TRUE(embedded_test_server_.Start());
|
| }
|
| @@ -192,6 +200,18 @@ double TestNetworkQualityEstimator::RandDouble() const {
|
| return rand_double_;
|
| }
|
|
|
| +int TestNetworkQualityEstimator::GetEntriesCount(NetLogEventType type) const {
|
| + TestNetLogEntry::List entries;
|
| + net_log_->GetEntries(&entries);
|
| +
|
| + int count = 0;
|
| + for (const auto& entry : entries) {
|
| + if (entry.type == type)
|
| + ++count;
|
| + }
|
| + return count;
|
| +}
|
| +
|
| nqe::internal::NetworkID TestNetworkQualityEstimator::GetCurrentNetworkID()
|
| const {
|
| return nqe::internal::NetworkID(current_network_type_, current_network_id_);
|
|
|