| Index: third_party/WebKit/Source/core/testing/Internals.cpp
|
| diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp
|
| index 3b40be5dd0fd8e8cef9f02160a48c91f0e6e71d1..654fe92b417c40c3c29d3d29157c541a15619670 100644
|
| --- a/third_party/WebKit/Source/core/testing/Internals.cpp
|
| +++ b/third_party/WebKit/Source/core/testing/Internals.cpp
|
| @@ -3085,7 +3085,35 @@ void Internals::setNetworkConnectionInfoOverride(
|
| ExceptionMessages::FailedToEnumerate("connection type", type));
|
| return;
|
| }
|
| - GetNetworkStateNotifier().SetOverride(on_line, webtype, downlink_max_mbps);
|
| + GetNetworkStateNotifier().SetNetworkConnectionInfoOverride(on_line, webtype,
|
| + downlink_max_mbps);
|
| +}
|
| +
|
| +void Internals::setNetworkQualityInfoOverride(const String& effective_type,
|
| + unsigned long transport_rtt_msec,
|
| + double downlink_throughput_mbps,
|
| + ExceptionState& exception_state) {
|
| + WebEffectiveConnectionType web_effective_type =
|
| + WebEffectiveConnectionType::kTypeUnknown;
|
| + if (effective_type == "offline") {
|
| + web_effective_type = WebEffectiveConnectionType::kTypeOffline;
|
| + } else if (effective_type == "slow-2g") {
|
| + web_effective_type = WebEffectiveConnectionType::kTypeSlow2G;
|
| + } else if (effective_type == "2g") {
|
| + web_effective_type = WebEffectiveConnectionType::kType2G;
|
| + } else if (effective_type == "3g") {
|
| + web_effective_type = WebEffectiveConnectionType::kType3G;
|
| + } else if (effective_type == "4g") {
|
| + web_effective_type = WebEffectiveConnectionType::kType4G;
|
| + } else if (effective_type != "unknown") {
|
| + exception_state.ThrowDOMException(
|
| + kNotFoundError, ExceptionMessages::FailedToEnumerate(
|
| + "effective connection type", effective_type));
|
| + return;
|
| + }
|
| +
|
| + GetNetworkStateNotifier().SetNetworkQualityInfoOverride(
|
| + web_effective_type, transport_rtt_msec, downlink_throughput_mbps);
|
| }
|
|
|
| void Internals::clearNetworkConnectionInfoOverride() {
|
|
|