@@ -59,6 +59,7 @@ public class SessionSlot implements
59
59
private final SessionFactory factory ;
60
60
private final AtomicBoolean reserved = new AtomicBoolean (false );
61
61
private final boolean supportingCdp ;
62
+ private final boolean supportingBiDi ;
62
63
private ActiveSession currentSession ;
63
64
64
65
public SessionSlot (EventBus bus , Capabilities stereotype , SessionFactory factory ) {
@@ -67,6 +68,7 @@ public SessionSlot(EventBus bus, Capabilities stereotype, SessionFactory factory
67
68
this .stereotype = ImmutableCapabilities .copyOf (Require .nonNull ("Stereotype" , stereotype ));
68
69
this .factory = Require .nonNull ("Session factory" , factory );
69
70
this .supportingCdp = isSlotSupportingCdp (this .stereotype );
71
+ this .supportingBiDi = isSlotSupportingBiDi (this .stereotype );
70
72
}
71
73
72
74
public UUID getId () {
@@ -160,12 +162,22 @@ public boolean isSupportingCdp() {
160
162
return supportingCdp ;
161
163
}
162
164
165
+ public boolean isSupportingBiDi () {
166
+ return supportingBiDi ;
167
+ }
168
+
163
169
private boolean isSlotSupportingCdp (Capabilities stereotype ) {
164
170
return StreamSupport .stream (ServiceLoader .load (WebDriverInfo .class ).spliterator (), false )
165
171
.filter (webDriverInfo -> webDriverInfo .isSupporting (stereotype ))
166
172
.anyMatch (WebDriverInfo ::isSupportingCdp );
167
173
}
168
174
175
+ private boolean isSlotSupportingBiDi (Capabilities stereotype ) {
176
+ return StreamSupport .stream (ServiceLoader .load (WebDriverInfo .class ).spliterator (), false )
177
+ .filter (webDriverInfo -> webDriverInfo .isSupporting (stereotype ))
178
+ .anyMatch (WebDriverInfo ::isSupportingBiDi );
179
+ }
180
+
169
181
public boolean hasRelayFactory () {
170
182
return factory instanceof RelaySessionFactory ;
171
183
}
0 commit comments