|
18 | 18 | package org.openqa.selenium.firefox;
|
19 | 19 |
|
20 | 20 | import static org.openqa.selenium.firefox.FirefoxOptions.FIREFOX_OPTIONS;
|
21 |
| -import static org.openqa.selenium.remote.CapabilityType.ACCEPT_SSL_CERTS; |
22 |
| -import static org.openqa.selenium.remote.CapabilityType.LOGGING_PREFS; |
23 | 21 | import static org.openqa.selenium.remote.CapabilityType.PROXY;
|
24 |
| -import static org.openqa.selenium.remote.CapabilityType.SUPPORTS_WEB_STORAGE; |
25 | 22 |
|
26 |
| -import com.google.common.base.Preconditions; |
27 | 23 | import com.google.common.collect.ImmutableMap;
|
28 | 24 | import com.google.common.collect.Maps;
|
29 | 25 | import com.google.common.collect.Sets;
|
|
38 | 34 | import org.openqa.selenium.internal.Lock;
|
39 | 35 | import org.openqa.selenium.internal.SocketLock;
|
40 | 36 | import org.openqa.selenium.logging.LocalLogs;
|
41 |
| -import org.openqa.selenium.logging.LoggingPreferences; |
42 | 37 | import org.openqa.selenium.logging.NeedsLocalLogs;
|
43 | 38 | import org.openqa.selenium.remote.BeanToJsonConverter;
|
44 | 39 | import org.openqa.selenium.remote.Command;
|
|
63 | 58 | * {@link FirefoxOptions}, like so:
|
64 | 59 | *
|
65 | 60 | * <pre>
|
66 |
| - *DesiredCapabilities caps = new FirefoxOptions() |
67 |
| - * .setProfile(new FirefoxProfile()) |
68 |
| - * .addTo(DesiredCapabilities.firefox()); |
69 |
| - *WebDriver driver = new FirefoxDriver(caps); |
| 61 | + *FirefoxOptions options = new FirefoxOptions() |
| 62 | + * .setProfile(new FirefoxProfile()); |
| 63 | + *WebDriver driver = new FirefoxDriver(options); |
70 | 64 | * </pre>
|
71 | 65 | */
|
72 | 66 | public class FirefoxDriver extends RemoteWebDriver implements Killable {
|
@@ -123,9 +117,8 @@ public static final class SystemProperty {
|
123 | 117 | protected FirefoxBinary binary;
|
124 | 118 |
|
125 | 119 | // TODO: make it public as soon as it's fully implemented
|
126 |
| - FirefoxDriver(FirefoxOptions options) { |
| 120 | + public FirefoxDriver(FirefoxOptions options) { |
127 | 121 | this(toExecutor(options), options.toDesiredCapabilities(), options.toRequiredCapabilities());
|
128 |
| - //binary = options.getBinary(); |
129 | 122 | }
|
130 | 123 |
|
131 | 124 | private static CommandExecutor toExecutor(FirefoxOptions options) {
|
@@ -264,7 +257,9 @@ public void setFileDetector(FileDetector detector) {
|
264 | 257 | * stopped responding, and you don't want to leak resources. Should not ordinarily be called.
|
265 | 258 | */
|
266 | 259 | public void kill() {
|
267 |
| - binary.quit(); |
| 260 | + if (this.getCommandExecutor() instanceof LazyCommandExecutor) { |
| 261 | + ((LazyCommandExecutor) this.getCommandExecutor()).binary.quit(); |
| 262 | + } |
268 | 263 | }
|
269 | 264 |
|
270 | 265 | @Override
|
|
0 commit comments