Skip to content

Commit ad14204

Browse files
committed
Removing InternetExplorerDriver constructor that accepts WindowsProxyManager as a parameter. Proxy management moved to IEDriverServer and WindowsProxyManager is used for RC only now
1 parent 2401583 commit ad14204

File tree

3 files changed

+21
-63
lines changed

3 files changed

+21
-63
lines changed

java/client/src/org/openqa/selenium/browserlaunchers/build.desc

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
java_library(name = "browserlaunchers",
33
srcs = [
44
"BrowserLauncher.java",
5-
"MacProxyManager.java",
65
],
76
deps = [
87
":launcher-utils",
@@ -14,38 +13,32 @@ java_library(name = "browserlaunchers",
1413
"//third_party/java/guava-libraries",
1514
])
1615

17-
java_library(name = "proxies",
18-
srcs = [
19-
"DoNotUseProxyPac.java",
20-
"Maps.java",
21-
"Proxies.java",
22-
],
23-
deps = [
24-
"//java/client/src/org/openqa/selenium:base",
25-
"//java/client/src/org/openqa/selenium/remote:base",
26-
])
27-
28-
java_library(name = "windows_proxy_manager",
16+
java_library(name = "launcher-utils",
2917
srcs = [
30-
"WindowsProxyManager.java",
18+
"LauncherUtils.java",
19+
"MacProxyManager.java",
20+
"Sleeper.java",
3121
],
3222
deps = [
3323
":proxies",
24+
"//java/client/src/org/openqa/selenium:webdriver-api",
3425
"//java/client/src/org/openqa/selenium/io",
26+
"//java/client/src/org/openqa/selenium/net",
3527
"//java/client/src/org/openqa/selenium/os",
28+
"//java/client/src/org/openqa/selenium/remote:base",
29+
"//third_party/java/guava-libraries",
3630
])
3731

38-
java_library(name = "launcher-utils",
32+
java_library(name = "proxies",
3933
srcs = [
40-
"LauncherUtils.java",
41-
"Sleeper.java",
34+
"DoNotUseProxyPac.java",
35+
"Maps.java",
36+
"Proxies.java",
37+
"WindowsProxyManager.java",
4238
],
4339
deps = [
44-
":windows_proxy_manager",
45-
"//java/client/src/org/openqa/selenium:webdriver-api",
40+
"//java/client/src/org/openqa/selenium:base",
41+
"//java/client/src/org/openqa/selenium/remote:base",
4642
"//java/client/src/org/openqa/selenium/io",
47-
"//java/client/src/org/openqa/selenium/net",
4843
"//java/client/src/org/openqa/selenium/os",
49-
"//java/client/src/org/openqa/selenium/remote:base",
50-
"//third_party/java/guava-libraries",
5144
])

java/client/src/org/openqa/selenium/ie/InternetExplorerDriver.java

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

1818
package org.openqa.selenium.ie;
1919

20-
import static org.openqa.selenium.remote.CapabilityType.PROXY;
21-
2220
import com.google.common.base.Throwables;
2321

2422
import org.openqa.selenium.Capabilities;
2523
import org.openqa.selenium.OutputType;
2624
import org.openqa.selenium.Platform;
2725
import org.openqa.selenium.WebDriverException;
28-
import org.openqa.selenium.browserlaunchers.WindowsProxyManager;
2926
import org.openqa.selenium.remote.CapabilityType;
3027
import org.openqa.selenium.remote.DesiredCapabilities;
3128
import org.openqa.selenium.remote.DriverCommand;
@@ -145,38 +142,31 @@ public class InternetExplorerDriver extends RemoteWebDriver {
145142
*/
146143
private final static int DEFAULT_PORT = 0;
147144

148-
/**
149-
* Proxy manager.
150-
*/
151-
private WindowsProxyManager proxyManager;
152-
153145
public InternetExplorerDriver() {
154-
this(null, null, null, DEFAULT_PORT);
146+
this(null, null, DEFAULT_PORT);
155147
}
156148

157149
public InternetExplorerDriver(Capabilities capabilities) {
158-
this(null, null, capabilities, DEFAULT_PORT);
150+
this(null, capabilities, DEFAULT_PORT);
159151
}
160152

161153
public InternetExplorerDriver(int port) {
162-
this(null, null, null, port);
154+
this(null, null, port);
163155
}
164156

165157
public InternetExplorerDriver(InternetExplorerDriverService service) {
166-
this(null, service, null, DEFAULT_PORT);
158+
this(service, null, DEFAULT_PORT);
167159
}
168160

169161
public InternetExplorerDriver(InternetExplorerDriverService service, Capabilities capabilities) {
170-
this(null, service, capabilities, DEFAULT_PORT);
162+
this(service, capabilities, DEFAULT_PORT);
171163
}
172164

173-
public InternetExplorerDriver(WindowsProxyManager proxy, InternetExplorerDriverService service, Capabilities capabilities, int port) {
165+
public InternetExplorerDriver(InternetExplorerDriverService service, Capabilities capabilities, int port) {
174166
if (capabilities == null) {
175167
capabilities = DesiredCapabilities.internetExplorer();
176168
}
177169

178-
proxyManager = proxy;
179-
180170
if (service == null) {
181171
service = setupService(capabilities, port);
182172
}
@@ -186,8 +176,6 @@ public InternetExplorerDriver(WindowsProxyManager proxy, InternetExplorerDriverS
186176
private void run(InternetExplorerDriverService service, Capabilities capabilities) {
187177
assertOnWindows();
188178

189-
prepareProxy(capabilities);
190-
191179
setCommandExecutor(new DriverCommandExecutor(service));
192180

193181
startSession(capabilities);
@@ -265,25 +253,4 @@ private InternetExplorerDriverService setupService(Capabilities caps, int port)
265253
throw Throwables.propagate(ex);
266254
}
267255
}
268-
269-
private void prepareProxy(Capabilities caps) {
270-
// do not prepare proxy manager if it will be managed by server.
271-
if (caps == null || caps.getCapability(PROXY) == null || proxyManager == null) {
272-
return;
273-
}
274-
275-
// Because of the way that the proxying is currently implemented,
276-
// we can only set a single host.
277-
proxyManager.backupRegistrySettings();
278-
proxyManager.changeRegistrySettings(caps);
279-
280-
Thread cleanupThread = new Thread() { // Thread safety reviewed
281-
@Override
282-
public void run() {
283-
proxyManager.restoreRegistrySettings(true);
284-
}
285-
};
286-
Runtime.getRuntime().addShutdownHook(cleanupThread);
287-
}
288-
289256
}

java/client/src/org/openqa/selenium/ie/build.desc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ java_library(name = "ie",
33
srcs = [ "*.java" ],
44
deps = [
55
"//cpp/iedriverserver:sizzle",
6-
"//java/client/src/org/openqa/selenium/browserlaunchers:windows_proxy_manager",
76
"//java/client/src/org/openqa/selenium/net",
87
"//java/client/src/org/openqa/selenium/remote",
98
"//java/client/src/org/openqa/selenium/remote/service",
10-
"//third_party/java/jna",
119
])

0 commit comments

Comments
 (0)