Chromium Code Reviews| Index: Source/core/testing/Internals.cpp |
| diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp |
| index a48c5ac62dfd1132fd53c4f591b29f5a5215a523..2422ec5c2e93a4ae7d00c29e84da1590f231273c 100644 |
| --- a/Source/core/testing/Internals.cpp |
| +++ b/Source/core/testing/Internals.cpp |
| @@ -105,6 +105,7 @@ |
| #include "core/page/Chrome.h" |
| #include "core/page/ChromeClient.h" |
| #include "core/page/EventHandler.h" |
| +#include "core/page/NetworkStateNotifier.h" |
| #include "core/page/Page.h" |
| #include "core/page/PagePopupController.h" |
| #include "core/page/PrintContext.h" |
| @@ -128,6 +129,7 @@ |
| #include "platform/graphics/filters/FilterOperations.h" |
| #include "platform/weborigin/SchemeRegistry.h" |
| #include "public/platform/Platform.h" |
| +#include "public/platform/WebConnectionType.h" |
| #include "public/platform/WebGraphicsContext3D.h" |
| #include "public/platform/WebGraphicsContext3DProvider.h" |
| #include "public/platform/WebLayer.h" |
| @@ -2334,4 +2336,25 @@ String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma |
| return surroundingText.content(); |
| } |
| +void Internals::setNetworkConnectionInfo(const String& type, ExceptionState& exceptionState) |
| +{ |
| + blink::WebConnectionType webtype; |
| + if (type == "cellular") { |
| + webtype = blink::ConnectionTypeCellular; |
| + } else if (type == "bluetooth") { |
| + webtype = blink::ConnectionTypeBluetooth; |
| + } else if (type == "ethernet") { |
| + webtype = blink::ConnectionTypeEthernet; |
| + } else if (type == "wifi") { |
| + webtype = blink::ConnectionTypeWifi; |
| + } else if (type == "other") { |
| + webtype = blink::ConnectionTypeOther; |
| + } else if (type == "none") { |
| + webtype = blink::ConnectionTypeNone; |
| + } else { |
| + exceptionState.throwDOMException(NotFoundError, ExceptionMessages::failedToEnumerate("connection type", type)); |
| + return; |
| + } |
| + networkStateNotifier().setWebConnectionType(webtype); |
|
adamk
2014/05/22 15:40:32
It looks to me like this might leak state between
jkarlin
2014/05/22 17:38:02
Good point that it changes state between runs. On
adamk
2014/05/23 22:33:57
Not sure what you mean by "One would expect the ne
|
| +} |
| } |
|
adamk
2014/05/22 15:40:32
Nit: Please add a blank line between these two bra
jkarlin
2014/05/22 17:38:02
Done.
|