Skip to content

Commit 7ed1679

Browse files
authored
[java] Remove deprecated non-w3c compliant NetworkConnection interface (SeleniumHQ#15270)
1 parent 4faf5ba commit 7ed1679

File tree

9 files changed

+1
-306
lines changed

9 files changed

+1
-306
lines changed

java/spotbugs-excludes.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,7 @@
139139
<Class name="org.openqa.selenium.json.JsonInputIterator"/>
140140
<Bug pattern="IT_NO_SUCH_ELEMENT"/>
141141
</Match>
142-
143-
<Match>
144-
<Class name="org.openqa.selenium.mobile.NetworkConnection$ConnectionType"/>
145-
<Bug pattern="IM_BAD_CHECK_FOR_ODD"/>
146-
</Match>
147-
142+
148143
<Match>
149144
<Class name="org.openqa.selenium.net.NetworkUtils"/>
150145
<Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD"/>

java/src/org/openqa/selenium/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ java_export(
1717
"internal/*.java",
1818
"interactions/**/*.java",
1919
"logging/**/*.java",
20-
"mobile/*.java",
2120
"net/*.java",
2221
"virtualauthenticator/*.java",
2322
"print/*.java",

java/src/org/openqa/selenium/chromium/ChromiumDriver.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
import org.openqa.selenium.json.TypeToken;
6262
import org.openqa.selenium.logging.EventType;
6363
import org.openqa.selenium.logging.HasLogEvents;
64-
import org.openqa.selenium.mobile.NetworkConnection;
6564
import org.openqa.selenium.remote.CommandExecutor;
6665
import org.openqa.selenium.remote.FileDetector;
6766
import org.openqa.selenium.remote.RemoteWebDriver;
@@ -70,7 +69,6 @@
7069
import org.openqa.selenium.remote.http.ClientConfig;
7170
import org.openqa.selenium.remote.http.ConnectionFailedException;
7271
import org.openqa.selenium.remote.http.HttpClient;
73-
import org.openqa.selenium.remote.mobile.RemoteNetworkConnection;
7472

7573
/**
7674
* A {@link WebDriver} implementation that controls a Chromium browser running on the local machine.
@@ -87,7 +85,6 @@ public class ChromiumDriver extends RemoteWebDriver
8785
HasNetworkConditions,
8886
HasPermissions,
8987
LocationContext,
90-
NetworkConnection,
9188
WebStorage {
9289

9390
public static final Predicate<String> IS_CHROMIUM_BROWSER =
@@ -97,7 +94,6 @@ public class ChromiumDriver extends RemoteWebDriver
9794
private final Capabilities capabilities;
9895
private final RemoteLocationContext locationContext;
9996
private final RemoteWebStorage webStorage;
100-
private final RemoteNetworkConnection networkConnection;
10197
private final HasNetworkConditions networkConditions;
10298
private final HasPermissions permissions;
10399
private final HasLaunchApp launch;
@@ -115,7 +111,6 @@ protected ChromiumDriver(
115111
locationContext = new RemoteLocationContext(getExecuteMethod());
116112
webStorage = new RemoteWebStorage(getExecuteMethod());
117113
permissions = new AddHasPermissions().getImplementation(getCapabilities(), getExecuteMethod());
118-
networkConnection = new RemoteNetworkConnection(getExecuteMethod());
119114
networkConditions =
120115
new AddHasNetworkConditions().getImplementation(getCapabilities(), getExecuteMethod());
121116
launch = new AddHasLaunchApp().getImplementation(getCapabilities(), getExecuteMethod());
@@ -317,19 +312,6 @@ public void setLocation(Location location) {
317312
locationContext.setLocation(location);
318313
}
319314

320-
@Override
321-
@Deprecated
322-
public ConnectionType getNetworkConnection() {
323-
return networkConnection.getNetworkConnection();
324-
}
325-
326-
@Override
327-
@Deprecated
328-
public ConnectionType setNetworkConnection(ConnectionType type) {
329-
Require.nonNull("Network Connection Type", type);
330-
return networkConnection.setNetworkConnection(type);
331-
}
332-
333315
@Override
334316
public void launchApp(String id) {
335317
Require.nonNull("Launch App ID", id);

java/src/org/openqa/selenium/mobile/NetworkConnection.java

Lines changed: 0 additions & 136 deletions
This file was deleted.

java/src/org/openqa/selenium/remote/DriverCommand.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,6 @@ public interface DriverCommand {
136136
// Logging API
137137
String GET_AVAILABLE_LOG_TYPES = "getAvailableLogTypes";
138138
String GET_LOG = "getLog";
139-
// Mobile API
140-
String GET_NETWORK_CONNECTION = "getNetworkConnection";
141-
String SET_NETWORK_CONNECTION = "setNetworkConnection";
142139
// Virtual Authenticator API
143140
// http://w3c.github.io/webauthn#sctn-automation
144141
String ADD_VIRTUAL_AUTHENTICATOR = "addVirtualAuthenticator";

java/src/org/openqa/selenium/remote/codec/AbstractHttpCommandCodec.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
import static org.openqa.selenium.remote.DriverCommand.GET_FEDCM_DIALOG_TYPE;
5454
import static org.openqa.selenium.remote.DriverCommand.GET_FEDCM_TITLE;
5555
import static org.openqa.selenium.remote.DriverCommand.GET_LOCATION;
56-
import static org.openqa.selenium.remote.DriverCommand.GET_NETWORK_CONNECTION;
5756
import static org.openqa.selenium.remote.DriverCommand.GET_TIMEOUTS;
5857
import static org.openqa.selenium.remote.DriverCommand.GET_TITLE;
5958
import static org.openqa.selenium.remote.DriverCommand.GO_BACK;
@@ -73,7 +72,6 @@
7372
import static org.openqa.selenium.remote.DriverCommand.SEND_KEYS_TO_ELEMENT;
7473
import static org.openqa.selenium.remote.DriverCommand.SET_DELAY_ENABLED;
7574
import static org.openqa.selenium.remote.DriverCommand.SET_LOCATION;
76-
import static org.openqa.selenium.remote.DriverCommand.SET_NETWORK_CONNECTION;
7775
import static org.openqa.selenium.remote.DriverCommand.SET_SCRIPT_TIMEOUT;
7876
import static org.openqa.selenium.remote.DriverCommand.SET_TIMEOUT;
7977
import static org.openqa.selenium.remote.DriverCommand.SET_USER_VERIFIED;
@@ -177,14 +175,6 @@ public AbstractHttpCommandCodec() {
177175
defineCommand(
178176
SET_LOCATION, post(sessionId + "/location")); // Not w3c; used in RemoteLocationContext
179177

180-
// Mobile Spec
181-
defineCommand(
182-
GET_NETWORK_CONNECTION,
183-
get(sessionId + "/network_connection")); // Not w3c; used in RemoteNetworkConnection
184-
defineCommand(
185-
SET_NETWORK_CONNECTION,
186-
post(sessionId + "/network_connection")); // Not w3c; used in RemoteNetworkConnection
187-
188178
// Virtual Authenticator API
189179
String webauthn = sessionId + "/webauthn/authenticator";
190180
String webauthnId = webauthn + "/:authenticatorId";

java/src/org/openqa/selenium/remote/mobile/RemoteNetworkConnection.java

Lines changed: 0 additions & 54 deletions
This file was deleted.

java/test/org/openqa/selenium/mobile/BUILD.bazel

Lines changed: 0 additions & 18 deletions
This file was deleted.

java/test/org/openqa/selenium/mobile/NetworkConnectionTest.java

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)