Skip to content

Commit ad8ef06

Browse files
committed
[java] Removing STP from SafariDriverService
This was deprecated and is placed already in its own service.
1 parent 9f22905 commit ad8ef06

File tree

2 files changed

+7
-34
lines changed

2 files changed

+7
-34
lines changed

‎java/src/org/openqa/selenium/safari/SafariDriverService.java

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@
1717

1818
package org.openqa.selenium.safari;
1919

20+
import static java.util.concurrent.TimeUnit.MILLISECONDS;
21+
import static org.openqa.selenium.Platform.MAC;
22+
import static org.openqa.selenium.remote.Browser.SAFARI;
23+
2024
import com.google.auto.service.AutoService;
25+
2126
import org.openqa.selenium.Capabilities;
2227
import org.openqa.selenium.Platform;
2328
import org.openqa.selenium.WebDriverException;
@@ -31,10 +36,6 @@
3136
import java.util.List;
3237
import java.util.Map;
3338

34-
import static java.util.concurrent.TimeUnit.MILLISECONDS;
35-
import static org.openqa.selenium.Platform.MAC;
36-
import static org.openqa.selenium.remote.Browser.SAFARI;
37-
3839
public class SafariDriverService extends DriverService {
3940

4041
/**
@@ -45,14 +46,6 @@ public class SafariDriverService extends DriverService {
4546

4647
private static final File SAFARI_DRIVER_EXECUTABLE = new File("/usr/bin/safaridriver");
4748

48-
/**
49-
* @deprecated Directly use {@link SafariTechPreviewDriverService}
50-
* Remove after deprecation policy is fulfilled
51-
*/
52-
@Deprecated
53-
private static final File TP_SAFARI_DRIVER_EXECUTABLE =
54-
new File("/Applications/Safari Technology Preview.app/Contents/MacOS/safaridriver");
55-
5649
public SafariDriverService(
5750
File executable,
5851
int port,
@@ -71,11 +64,7 @@ public SafariDriverService(
7164
}
7265

7366
public static SafariDriverService createDefaultService() {
74-
return createDefaultService(new SafariOptions());
75-
}
76-
77-
static SafariDriverService createDefaultService(SafariOptions options) {
78-
return new Builder().usingTechnologyPreview(options.getUseTechnologyPreview()).build();
67+
return new Builder().build();
7968
}
8069

8170
@Override
@@ -91,8 +80,6 @@ protected void waitUntilAvailable() {
9180
public static class Builder extends DriverService.Builder<
9281
SafariDriverService, SafariDriverService.Builder> {
9382

94-
private boolean useTechnologyPreview = false;
95-
9683
@Override
9784
public int score(Capabilities capabilities) {
9885
int score = 0;
@@ -106,22 +93,11 @@ public int score(Capabilities capabilities) {
10693
return score;
10794
}
10895

109-
/**
110-
* @deprecated Directly use {@link SafariTechPreviewDriverService}
111-
*/
112-
@Deprecated
113-
public SafariDriverService.Builder usingTechnologyPreview(boolean useTechnologyPreview) {
114-
this.useTechnologyPreview = useTechnologyPreview;
115-
return this;
116-
}
117-
11896
@Override
11997
protected File findDefaultExecutable() {
12098
File exe;
12199
if (System.getProperty(SAFARI_DRIVER_EXE_PROPERTY) != null) {
122100
exe = new File(System.getProperty(SAFARI_DRIVER_EXE_PROPERTY));
123-
} else if (useTechnologyPreview) {
124-
exe = TP_SAFARI_DRIVER_EXECUTABLE;
125101
} else {
126102
exe = SAFARI_DRIVER_EXECUTABLE;
127103
}

‎java/src/org/openqa/selenium/safari/SafariTechPreviewDriverService.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,7 @@ public int score(Capabilities capabilities) {
8383
int score = 0;
8484

8585
if (SafariOptions.SAFARI_TECH_PREVIEW.equals(capabilities.getBrowserName())) {
86-
// Returning this value so this service is preferred over SafariDriverService
87-
// Needs to be reestablished to "score++" when the deprecated methods at SafariDriverService
88-
// get removed.
89-
score = 10;
86+
score++;
9087
}
9188

9289
return score;

0 commit comments

Comments
 (0)