File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
playwright/src/test/java/com/microsoft/playwright Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 2525import java .time .Instant ;
2626import java .util .ArrayList ;
2727import java .util .List ;
28+ import java .util .function .Consumer ;
2829
2930import static java .util .Arrays .asList ;
3031import static org .junit .jupiter .api .Assertions .*;
@@ -139,9 +140,13 @@ void shouldEmitError() {
139140 boolean [] socketError = {false };
140141 String [] error = {null };
141142 page .onWebSocket (ws -> {
142- ws .onSocketError (e -> {
143- error [0 ] = e ;
144- socketError [0 ] = true ;
143+ ws .onSocketError (new Consumer <String >() {
144+ @ Override
145+ public void accept (String e ) {
146+ ws .offSocketError (this );
147+ error [0 ] = e ;
148+ socketError [0 ] = true ;
149+ }
145150 });
146151 });
147152 page .evaluate ("port => {\n " +
You can’t perform that action at this time.
0 commit comments