17
17
18
18
package org .openqa .selenium .ie ;
19
19
20
- import static org .openqa .selenium .remote .CapabilityType .PROXY ;
21
-
22
20
import com .google .common .base .Throwables ;
23
21
24
22
import org .openqa .selenium .Capabilities ;
25
23
import org .openqa .selenium .OutputType ;
26
24
import org .openqa .selenium .Platform ;
27
25
import org .openqa .selenium .WebDriverException ;
28
- import org .openqa .selenium .browserlaunchers .WindowsProxyManager ;
29
26
import org .openqa .selenium .remote .CapabilityType ;
30
27
import org .openqa .selenium .remote .DesiredCapabilities ;
31
28
import org .openqa .selenium .remote .DriverCommand ;
@@ -145,38 +142,31 @@ public class InternetExplorerDriver extends RemoteWebDriver {
145
142
*/
146
143
private final static int DEFAULT_PORT = 0 ;
147
144
148
- /**
149
- * Proxy manager.
150
- */
151
- private WindowsProxyManager proxyManager ;
152
-
153
145
public InternetExplorerDriver () {
154
- this (null , null , null , DEFAULT_PORT );
146
+ this (null , null , DEFAULT_PORT );
155
147
}
156
148
157
149
public InternetExplorerDriver (Capabilities capabilities ) {
158
- this (null , null , capabilities , DEFAULT_PORT );
150
+ this (null , capabilities , DEFAULT_PORT );
159
151
}
160
152
161
153
public InternetExplorerDriver (int port ) {
162
- this (null , null , null , port );
154
+ this (null , null , port );
163
155
}
164
156
165
157
public InternetExplorerDriver (InternetExplorerDriverService service ) {
166
- this (null , service , null , DEFAULT_PORT );
158
+ this (service , null , DEFAULT_PORT );
167
159
}
168
160
169
161
public InternetExplorerDriver (InternetExplorerDriverService service , Capabilities capabilities ) {
170
- this (null , service , capabilities , DEFAULT_PORT );
162
+ this (service , capabilities , DEFAULT_PORT );
171
163
}
172
164
173
- public InternetExplorerDriver (WindowsProxyManager proxy , InternetExplorerDriverService service , Capabilities capabilities , int port ) {
165
+ public InternetExplorerDriver (InternetExplorerDriverService service , Capabilities capabilities , int port ) {
174
166
if (capabilities == null ) {
175
167
capabilities = DesiredCapabilities .internetExplorer ();
176
168
}
177
169
178
- proxyManager = proxy ;
179
-
180
170
if (service == null ) {
181
171
service = setupService (capabilities , port );
182
172
}
@@ -186,8 +176,6 @@ public InternetExplorerDriver(WindowsProxyManager proxy, InternetExplorerDriverS
186
176
private void run (InternetExplorerDriverService service , Capabilities capabilities ) {
187
177
assertOnWindows ();
188
178
189
- prepareProxy (capabilities );
190
-
191
179
setCommandExecutor (new DriverCommandExecutor (service ));
192
180
193
181
startSession (capabilities );
@@ -265,25 +253,4 @@ private InternetExplorerDriverService setupService(Capabilities caps, int port)
265
253
throw Throwables .propagate (ex );
266
254
}
267
255
}
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
-
289
256
}
0 commit comments