Skip to content

Commit 2f8d865

Browse files
mcharsleyjuangj
authored andcommitted
Added NetworkConnection interface to ChromeDriver client
1 parent 87cadbb commit 2f8d865

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

java/client/src/org/openqa/selenium/chrome/ChromeDriver.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@
2929
import org.openqa.selenium.html5.WebStorage;
3030
import org.openqa.selenium.interactions.HasTouchScreen;
3131
import org.openqa.selenium.interactions.TouchScreen;
32+
import org.openqa.selenium.mobile.NetworkConnection;
3233
import org.openqa.selenium.remote.FileDetector;
3334
import org.openqa.selenium.remote.RemoteTouchScreen;
3435
import org.openqa.selenium.remote.RemoteWebDriver;
3536
import org.openqa.selenium.remote.html5.RemoteLocationContext;
3637
import org.openqa.selenium.remote.html5.RemoteWebStorage;
38+
import org.openqa.selenium.remote.mobile.RemoteNetworkConnection;
3739

3840
/**
3941
* A {@link WebDriver} implementation that controls a Chrome browser running on the local machine.
@@ -104,11 +106,12 @@
104106
* @see ChromeDriverService#createDefaultService
105107
*/
106108
public class ChromeDriver extends RemoteWebDriver
107-
implements LocationContext, WebStorage, HasTouchScreen {
109+
implements LocationContext, WebStorage, HasTouchScreen, NetworkConnection {
108110

109111
private RemoteLocationContext locationContext;
110112
private RemoteWebStorage webStorage;
111113
private TouchScreen touchScreen;
114+
private RemoteNetworkConnection networkConnection;
112115

113116
/**
114117
* Creates a new ChromeDriver using the {@link ChromeDriverService#createDefaultService default}
@@ -175,6 +178,7 @@ public ChromeDriver(ChromeDriverService service, Capabilities capabilities) {
175178
locationContext = new RemoteLocationContext(getExecuteMethod());
176179
webStorage = new RemoteWebStorage(getExecuteMethod());
177180
touchScreen = new RemoteTouchScreen(getExecuteMethod());
181+
networkConnection = new RemoteNetworkConnection(getExecuteMethod());
178182
}
179183

180184
@Override
@@ -208,7 +212,17 @@ public void setLocation(Location location) {
208212
public TouchScreen getTouch() {
209213
return touchScreen;
210214
}
211-
215+
216+
@Override
217+
public ConnectionType getNetworkConnection() {
218+
return networkConnection.getNetworkConnection();
219+
}
220+
221+
@Override
222+
public ConnectionType setNetworkConnection(ConnectionType type) {
223+
return networkConnection.setNetworkConnection(type);
224+
}
225+
212226
/**
213227
* Launches Chrome app specified by id.
214228
*

0 commit comments

Comments
 (0)