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

Unified Diff: net/nqe/network_quality_estimator_test_util.h

Issue 2863973003: Expose RTT and downlink bandwidth using experimental Javascript API (Closed)
Patch Set: Rebased Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/nqe/network_quality_estimator.h ('k') | net/nqe/network_quality_estimator_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/nqe/network_quality_estimator_test_util.h
diff --git a/net/nqe/network_quality_estimator_test_util.h b/net/nqe/network_quality_estimator_test_util.h
index 1b21b6ad9a5cb1bd700c2bb6556303519e0376b1..70dab1513c036862835f192f6f7c414624aa6539 100644
--- a/net/nqe/network_quality_estimator_test_util.h
+++ b/net/nqe/network_quality_estimator_test_util.h
@@ -16,6 +16,7 @@
#include "base/time/time.h"
#include "net/base/network_change_notifier.h"
#include "net/log/net_log.h"
+#include "net/log/test_net_log.h"
#include "net/nqe/effective_connection_type.h"
#include "net/nqe/network_quality_estimator.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
@@ -24,7 +25,6 @@
namespace net {
-class BoundTestNetLog;
class ExternalEstimateProvider;
// Helps in setting the current network type and id.
@@ -48,6 +48,15 @@ class TestNetworkQualityEstimator : public NetworkQualityEstimator {
bool add_default_platform_observations,
std::unique_ptr<BoundTestNetLog> net_log);
+ 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 suppress_notifications_for_testing,
+ std::unique_ptr<BoundTestNetLog> net_log);
+
~TestNetworkQualityEstimator() override;
// Runs one URL request to completion.
@@ -109,6 +118,11 @@ class TestNetworkQualityEstimator : public NetworkQualityEstimator {
base::TimeDelta* transport_rtt,
int32_t* downstream_throughput_kbps) const override;
+ void NotifyObserversOfRTTOrThroughputComputed() const override;
+
+ void NotifyRTTAndThroughputEstimatesObserverIfPresent(
+ RTTAndThroughputEstimatesObserver* observer) const override;
+
void set_start_time_null_http_rtt(const base::TimeDelta& http_rtt) {
// Callers should not set effective connection type along with the
// lower-layer metrics.
@@ -260,6 +274,9 @@ class TestNetworkQualityEstimator : public NetworkQualityEstimator {
LocalHttpTestServer embedded_test_server_;
+ // If true, notifications are not sent to any of the observers.
+ const bool suppress_notifications_for_testing_;
+
// Net log provided to network quality estimator.
std::unique_ptr<net::BoundTestNetLog> net_log_;
« no previous file with comments | « net/nqe/network_quality_estimator.h ('k') | net/nqe/network_quality_estimator_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698