|
29 | 29 | import org.openqa.selenium.html5.WebStorage; |
30 | 30 | import org.openqa.selenium.interactions.HasTouchScreen; |
31 | 31 | import org.openqa.selenium.interactions.TouchScreen; |
| 32 | +import org.openqa.selenium.mobile.NetworkConnection; |
32 | 33 | import org.openqa.selenium.remote.FileDetector; |
33 | 34 | import org.openqa.selenium.remote.RemoteTouchScreen; |
34 | 35 | import org.openqa.selenium.remote.RemoteWebDriver; |
35 | 36 | import org.openqa.selenium.remote.html5.RemoteLocationContext; |
36 | 37 | import org.openqa.selenium.remote.html5.RemoteWebStorage; |
| 38 | +import org.openqa.selenium.remote.mobile.RemoteNetworkConnection; |
37 | 39 |
|
38 | 40 | /** |
39 | 41 | * A {@link WebDriver} implementation that controls a Chrome browser running on the local machine. |
|
104 | 106 | * @see ChromeDriverService#createDefaultService |
105 | 107 | */ |
106 | 108 | public class ChromeDriver extends RemoteWebDriver |
107 | | - implements LocationContext, WebStorage, HasTouchScreen { |
| 109 | + implements LocationContext, WebStorage, HasTouchScreen, NetworkConnection { |
108 | 110 |
|
109 | 111 | private RemoteLocationContext locationContext; |
110 | 112 | private RemoteWebStorage webStorage; |
111 | 113 | private TouchScreen touchScreen; |
| 114 | + private RemoteNetworkConnection networkConnection; |
112 | 115 |
|
113 | 116 | /** |
114 | 117 | * Creates a new ChromeDriver using the {@link ChromeDriverService#createDefaultService default} |
@@ -175,6 +178,7 @@ public ChromeDriver(ChromeDriverService service, Capabilities capabilities) { |
175 | 178 | locationContext = new RemoteLocationContext(getExecuteMethod()); |
176 | 179 | webStorage = new RemoteWebStorage(getExecuteMethod()); |
177 | 180 | touchScreen = new RemoteTouchScreen(getExecuteMethod()); |
| 181 | + networkConnection = new RemoteNetworkConnection(getExecuteMethod()); |
178 | 182 | } |
179 | 183 |
|
180 | 184 | @Override |
@@ -208,7 +212,17 @@ public void setLocation(Location location) { |
208 | 212 | public TouchScreen getTouch() { |
209 | 213 | return touchScreen; |
210 | 214 | } |
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 | + |
212 | 226 | /** |
213 | 227 | * Launches Chrome app specified by id. |
214 | 228 | * |
|
0 commit comments