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

Unified Diff: third_party/WebKit/Source/platform/network/NetworkStateNotifier.cpp

Issue 2908233002: NetInfo default values (Closed)
Patch Set: ps 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
Index: third_party/WebKit/Source/platform/network/NetworkStateNotifier.cpp
diff --git a/third_party/WebKit/Source/platform/network/NetworkStateNotifier.cpp b/third_party/WebKit/Source/platform/network/NetworkStateNotifier.cpp
index 46d6824a532edc1fb752bf0acf1708e31ab9f588..a9662b72de7cecfebbef013e6f6ac2ba094e4d35 100644
--- a/third_party/WebKit/Source/platform/network/NetworkStateNotifier.cpp
+++ b/third_party/WebKit/Source/platform/network/NetworkStateNotifier.cpp
@@ -159,6 +159,25 @@ void NetworkStateNotifier::SetOverride(bool on_line,
override_.connection_initialized = true;
override_.type = type;
override_.max_bandwidth_mbps = max_bandwidth_mbps;
+
+ // Override network quality values when testing.
+ if (!override_.http_rtt.has_value()) {
+ override_.http_rtt = state_.http_rtt.has_value()
+ ? state_.http_rtt
+ : base::TimeDelta::FromSeconds(1);
+ }
+ if (!override_.transport_rtt.has_value()) {
+ override_.transport_rtt = state_.transport_rtt.has_value()
+ ? state_.transport_rtt
+ : base::TimeDelta::FromSeconds(1);
+ }
+ if (!override_.downlink_throughput_mbps.has_value()) {
+ override_.downlink_throughput_mbps = state_.downlink_throughput_mbps;
+ override_.downlink_throughput_mbps =
+ state_.downlink_throughput_mbps.has_value()
+ ? state_.downlink_throughput_mbps
+ : 1.0;
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698