|
16 | 16 |
|
17 | 17 | package org.openqa.selenium.firefox;
|
18 | 18 |
|
| 19 | +import static org.openqa.selenium.firefox.FirefoxDriver.ACCEPT_UNTRUSTED_CERTIFICATES; |
| 20 | +import static org.openqa.selenium.firefox.FirefoxDriver.ASSUME_UNTRUSTED_ISSUER; |
| 21 | +import static org.openqa.selenium.firefox.FirefoxDriver.DEFAULT_ENABLE_NATIVE_EVENTS; |
| 22 | + |
19 | 23 | import com.google.common.annotations.VisibleForTesting;
|
20 | 24 | import com.google.common.collect.Maps;
|
21 | 25 | import com.google.common.io.Resources;
|
22 | 26 |
|
23 | 27 | import org.openqa.selenium.Beta;
|
24 |
| -import org.openqa.selenium.Proxy; |
25 |
| -import org.openqa.selenium.Proxy.ProxyType; |
26 | 28 | import org.openqa.selenium.WebDriverException;
|
27 | 29 | import org.openqa.selenium.firefox.internal.ClasspathExtension;
|
28 | 30 | import org.openqa.selenium.firefox.internal.Extension;
|
|
41 | 43 | import java.net.URL;
|
42 | 44 | import java.util.Map;
|
43 | 45 |
|
44 |
| -import static org.openqa.selenium.firefox.FirefoxDriver.ACCEPT_UNTRUSTED_CERTIFICATES; |
45 |
| -import static org.openqa.selenium.firefox.FirefoxDriver.ASSUME_UNTRUSTED_ISSUER; |
46 |
| -import static org.openqa.selenium.firefox.FirefoxDriver.DEFAULT_ENABLE_NATIVE_EVENTS; |
47 |
| - |
48 | 46 |
|
49 | 47 | public class FirefoxProfile {
|
50 | 48 | public static final String PORT_PREFERENCE = "webdriver_firefox_port";
|
@@ -232,52 +230,6 @@ public void setPreference(String key, int value) {
|
232 | 230 | additionalPrefs.setPreference(key, value);
|
233 | 231 | }
|
234 | 232 |
|
235 |
| - /** |
236 |
| - * Set proxy preferences for this profile. |
237 |
| - * |
238 |
| - * @param proxy The proxy preferences. |
239 |
| - * @return The profile, for further settings. |
240 |
| - * @deprecated This is now handled by the driver itself. |
241 |
| - */ |
242 |
| - @Deprecated |
243 |
| - public FirefoxProfile setProxyPreferences(Proxy proxy) { |
244 |
| - if (proxy.getProxyType() == ProxyType.UNSPECIFIED) { |
245 |
| - return this; |
246 |
| - } |
247 |
| - setPreference("network.proxy.type", proxy.getProxyType().ordinal()); |
248 |
| - |
249 |
| - switch (proxy.getProxyType()) { |
250 |
| - case MANUAL:// By default, assume we're proxying the lot |
251 |
| - setPreference("network.proxy.no_proxies_on", ""); |
252 |
| - |
253 |
| - setManualProxyPreference("ftp", proxy.getFtpProxy()); |
254 |
| - setManualProxyPreference("http", proxy.getHttpProxy()); |
255 |
| - setManualProxyPreference("ssl", proxy.getSslProxy()); |
256 |
| - setManualProxyPreference("socks", proxy.getSocksProxy()); |
257 |
| - if (proxy.getNoProxy() != null) { |
258 |
| - setPreference("network.proxy.no_proxies_on", proxy.getNoProxy()); |
259 |
| - } |
260 |
| - |
261 |
| - break; |
262 |
| - case PAC: |
263 |
| - setPreference("network.proxy.autoconfig_url", proxy.getProxyAutoconfigUrl()); |
264 |
| - break; |
265 |
| - } |
266 |
| - return this; |
267 |
| - } |
268 |
| - |
269 |
| - private void setManualProxyPreference(String key, String settingString) { |
270 |
| - if (settingString == null) { |
271 |
| - return; |
272 |
| - } |
273 |
| - String[] hostPort = settingString.split(":"); |
274 |
| - setPreference("network.proxy." + key, hostPort[0]); |
275 |
| - if (hostPort.length > 1) { |
276 |
| - setPreference("network.proxy." + key + "_port", Integer.parseInt(hostPort[1])); |
277 |
| - } |
278 |
| - } |
279 |
| - |
280 |
| - |
281 | 233 | protected Preferences getAdditionalPreferences() {
|
282 | 234 | return additionalPrefs;
|
283 | 235 | }
|
|
0 commit comments