|
28 | 28 | import java.util.Map; |
29 | 29 | import java.util.Optional; |
30 | 30 | import java.util.Set; |
| 31 | +import java.util.function.BiFunction; |
31 | 32 | import java.util.function.Predicate; |
32 | 33 | import java.util.function.Supplier; |
33 | 34 | import java.util.logging.Level; |
|
62 | 63 | import org.openqa.selenium.logging.EventType; |
63 | 64 | import org.openqa.selenium.logging.HasLogEvents; |
64 | 65 | import org.openqa.selenium.remote.CommandExecutor; |
| 66 | +import org.openqa.selenium.remote.ExecuteMethod; |
65 | 67 | import org.openqa.selenium.remote.FileDetector; |
66 | 68 | import org.openqa.selenium.remote.RemoteWebDriver; |
67 | 69 | import org.openqa.selenium.remote.html5.RemoteLocationContext; |
@@ -106,14 +108,20 @@ public class ChromiumDriver extends RemoteWebDriver |
106 | 108 | private final Map<Integer, ScriptKey> scriptKeys = new HashMap<>(); |
107 | 109 |
|
108 | 110 | protected ChromiumDriver( |
109 | | - CommandExecutor commandExecutor, Capabilities capabilities, String capabilityKey) { |
| 111 | + CommandExecutor commandExecutor, |
| 112 | + Capabilities capabilities, |
| 113 | + String capabilityKey, |
| 114 | + BiFunction<Capabilities, ExecuteMethod, HasCasting> createCasting, |
| 115 | + BiFunction<Capabilities, ExecuteMethod, HasCdp> createCdp) { |
110 | 116 | super(commandExecutor, capabilities); |
111 | 117 | locationContext = new RemoteLocationContext(getExecuteMethod()); |
112 | 118 | webStorage = new RemoteWebStorage(getExecuteMethod()); |
113 | 119 | permissions = new AddHasPermissions().getImplementation(getCapabilities(), getExecuteMethod()); |
114 | 120 | networkConditions = |
115 | 121 | new AddHasNetworkConditions().getImplementation(getCapabilities(), getExecuteMethod()); |
116 | 122 | launch = new AddHasLaunchApp().getImplementation(getCapabilities(), getExecuteMethod()); |
| 123 | + casting = createCasting.apply(getCapabilities(), getExecuteMethod()); |
| 124 | + cdp = createCdp.apply(getCapabilities(), getExecuteMethod()); |
117 | 125 |
|
118 | 126 | HttpClient.Factory factory = HttpClient.Factory.createDefault(); |
119 | 127 | Capabilities originalCapabilities = super.getCapabilities(); |
|
0 commit comments