@@ -100,7 +100,7 @@ enum EventType {
100
100
request = connection .getExistingObject (initializer .getAsJsonObject ("requestContext" ).get ("guid" ).getAsString ());
101
101
request .timeoutSettings = timeoutSettings ;
102
102
clock = new ClockImpl (this );
103
- closePromise = new WaitableEvent <>(listeners , EventType .CLOSE );
103
+ closePromise = new WaitableEvent <>(listeners , EventType .CLOSE );
104
104
}
105
105
106
106
Path videosDir () {
@@ -121,7 +121,7 @@ URL baseUrl() {
121
121
}
122
122
return null ;
123
123
}
124
-
124
+
125
125
String effectiveCloseReason () {
126
126
if (closeReason != null ) {
127
127
return closeReason ;
@@ -261,15 +261,15 @@ private Page waitForPageImpl(WaitForPageOptions options, Runnable code) {
261
261
public CDPSession newCDPSession (Page page ) {
262
262
JsonObject params = new JsonObject ();
263
263
params .add ("page" , ((PageImpl ) page ).toProtocolRef ());
264
- JsonObject result = sendMessage ("newCDPSession" , params ).getAsJsonObject ();
264
+ JsonObject result = sendMessage ("newCDPSession" , params , NO_TIMEOUT ).getAsJsonObject ();
265
265
return connection .getExistingObject (result .getAsJsonObject ("session" ).get ("guid" ).getAsString ());
266
266
}
267
267
268
268
@ Override
269
269
public CDPSession newCDPSession (Frame frame ) {
270
270
JsonObject params = new JsonObject ();
271
271
params .add ("frame" , ((FrameImpl ) frame ).toProtocolRef ());
272
- JsonObject result = sendMessage ("newCDPSession" , params ).getAsJsonObject ();
272
+ JsonObject result = sendMessage ("newCDPSession" , params , NO_TIMEOUT ).getAsJsonObject ();
273
273
return connection .getExistingObject (result .getAsJsonObject ("session" ).get ("guid" ).getAsString ());
274
274
}
275
275
@@ -285,7 +285,7 @@ public void close(CloseOptions options) {
285
285
for (Map .Entry <String , HarRecorder > entry : harRecorders .entrySet ()) {
286
286
JsonObject params = new JsonObject ();
287
287
params .addProperty ("harId" , entry .getKey ());
288
- JsonObject json = sendMessage ("harExport" , params ).getAsJsonObject ();
288
+ JsonObject json = sendMessage ("harExport" , params , NO_TIMEOUT ).getAsJsonObject ();
289
289
ArtifactImpl artifact = connection .getExistingObject (json .getAsJsonObject ("artifact" ).get ("guid" ).getAsString ());
290
290
// Server side will compress artifact if content is attach or if file is .zip.
291
291
HarRecorder harParams = entry .getValue ();
@@ -297,14 +297,14 @@ public void close(CloseOptions options) {
297
297
JsonObject unzipParams = new JsonObject ();
298
298
unzipParams .addProperty ("zipFile" , tmpPath );
299
299
unzipParams .addProperty ("harFile" , harParams .path .toString ());
300
- connection .localUtils .sendMessage ("harUnzip" , unzipParams );
300
+ connection .localUtils .sendMessage ("harUnzip" , unzipParams , NO_TIMEOUT );
301
301
} else {
302
302
artifact .saveAs (harParams .path );
303
303
}
304
304
artifact .delete ();
305
305
}
306
306
JsonObject params = gson ().toJsonTree (options ).getAsJsonObject ();
307
- sendMessage ("close" , params );
307
+ sendMessage ("close" , params , NO_TIMEOUT );
308
308
}
309
309
runUntil (() -> {}, closePromise );
310
310
}
@@ -319,14 +319,14 @@ public List<Cookie> cookies(String url) {
319
319
public void addCookies (List <Cookie > cookies ) {
320
320
JsonObject params = new JsonObject ();
321
321
params .add ("cookies" , gson ().toJsonTree (cookies ));
322
- sendMessage ("addCookies" , params );
322
+ sendMessage ("addCookies" , params , NO_TIMEOUT );
323
323
}
324
324
325
325
@ Override
326
326
public void addInitScript (String script ) {
327
327
JsonObject params = new JsonObject ();
328
328
params .addProperty ("source" , script );
329
- sendMessage ("addInitScript" , params );
329
+ sendMessage ("addInitScript" , params , NO_TIMEOUT );
330
330
}
331
331
332
332
@ Override
@@ -358,7 +358,7 @@ public void clearCookies(ClearCookiesOptions options) {
358
358
setStringOrRegex (params , "name" , options .name );
359
359
setStringOrRegex (params , "domain" , options .domain );
360
360
setStringOrRegex (params , "path" , options .path );
361
- sendMessage ("clearCookies" , params );
361
+ sendMessage ("clearCookies" , params , NO_TIMEOUT );
362
362
}
363
363
364
364
private static void setStringOrRegex (JsonObject params , String name , Object value ) {
@@ -383,7 +383,7 @@ public List<Cookie> cookies(List<String> urls) {
383
383
urls = new ArrayList <>();
384
384
}
385
385
params .add ("urls" , gson ().toJsonTree (urls ));
386
- JsonObject json = sendMessage ("cookies" , params ).getAsJsonObject ();
386
+ JsonObject json = sendMessage ("cookies" , params , NO_TIMEOUT ).getAsJsonObject ();
387
387
Cookie [] cookies = gson ().fromJson (json .getAsJsonArray ("cookies" ), Cookie [].class );
388
388
return asList (cookies );
389
389
}
@@ -409,7 +409,7 @@ private void exposeBindingImpl(String name, BindingCallback playwrightBinding, E
409
409
if (options != null && options .handle != null && options .handle ) {
410
410
params .addProperty ("needsHandle" , true );
411
411
}
412
- sendMessage ("exposeBinding" , params );
412
+ sendMessage ("exposeBinding" , params , NO_TIMEOUT );
413
413
}
414
414
415
415
@ Override
@@ -427,7 +427,7 @@ public void grantPermissions(List<String> permissions, GrantPermissionsOptions o
427
427
}
428
428
JsonObject params = gson ().toJsonTree (options ).getAsJsonObject ();
429
429
params .add ("permissions" , gson ().toJsonTree (permissions ));
430
- sendMessage ("grantPermissions" , params );
430
+ sendMessage ("grantPermissions" , params , NO_TIMEOUT );
431
431
}
432
432
433
433
@ Override
@@ -517,13 +517,13 @@ void recordIntoHar(PageImpl page, Path har, RouteFromHAROptions options, HarCont
517
517
params .add ("page" , page .toProtocolRef ());
518
518
}
519
519
JsonObject recordHarArgs = new JsonObject ();
520
- recordHarArgs .addProperty ("zip" , har .toString ().endsWith (".zip" ));
520
+ recordHarArgs .addProperty ("zip" , har .toString ().endsWith (".zip" ));
521
521
recordHarArgs .addProperty ("content" , contentPolicy .name ().toLowerCase ());
522
522
recordHarArgs .addProperty ("mode" , (options .updateMode == null ? HarMode .MINIMAL : options .updateMode ).name ().toLowerCase ());
523
523
addHarUrlFilter (recordHarArgs , options .url );
524
524
525
525
params .add ("options" , recordHarArgs );
526
- JsonObject json = sendMessage ("harStart" , params ).getAsJsonObject ();
526
+ JsonObject json = sendMessage ("harStart" , params , NO_TIMEOUT ).getAsJsonObject ();
527
527
String harId = json .get ("harId" ).getAsString ();
528
528
harRecorders .put (harId , new HarRecorder (har , contentPolicy ));
529
529
}
@@ -549,7 +549,7 @@ public void setExtraHTTPHeaders(Map<String, String> headers) {
549
549
jsonHeaders .add (header );
550
550
}
551
551
params .add ("headers" , jsonHeaders );
552
- sendMessage ("setExtraHTTPHeaders" , params );
552
+ sendMessage ("setExtraHTTPHeaders" , params , NO_TIMEOUT );
553
553
}
554
554
555
555
@ Override
@@ -558,14 +558,14 @@ public void setGeolocation(Geolocation geolocation) {
558
558
if (geolocation != null ) {
559
559
params .add ("geolocation" , gson ().toJsonTree (geolocation ));
560
560
}
561
- sendMessage ("setGeolocation" , params );
561
+ sendMessage ("setGeolocation" , params , NO_TIMEOUT );
562
562
}
563
563
564
564
@ Override
565
565
public void setOffline (boolean offline ) {
566
566
JsonObject params = new JsonObject ();
567
567
params .addProperty ("offline" , offline );
568
- sendMessage ("setOffline" , params );
568
+ sendMessage ("setOffline" , params , NO_TIMEOUT );
569
569
}
570
570
571
571
@ Override
@@ -575,7 +575,7 @@ public String storageState(StorageStateOptions options) {
575
575
}
576
576
JsonObject params = gson ().toJsonTree (options ).getAsJsonObject ();
577
577
params .remove ("path" );
578
- JsonElement json = sendMessage ("storageState" , params );
578
+ JsonElement json = sendMessage ("storageState" , params , NO_TIMEOUT );
579
579
580
580
String storageState = json .toString ();
581
581
if (options .path != null ) {
@@ -648,11 +648,11 @@ private void unroute(UrlMatcher matcher, Consumer<Route> handler) {
648
648
}
649
649
650
650
private void updateInterceptionPatterns () {
651
- sendMessage ("setNetworkInterceptionPatterns" , routes .interceptionPatterns ());
651
+ sendMessage ("setNetworkInterceptionPatterns" , routes .interceptionPatterns (), NO_TIMEOUT );
652
652
}
653
653
654
654
private void updateWebSocketInterceptionPatterns () {
655
- sendMessage ("setWebSocketInterceptionPatterns" , webSocketRoutes .interceptionPatterns ());
655
+ sendMessage ("setWebSocketInterceptionPatterns" , webSocketRoutes .interceptionPatterns (), NO_TIMEOUT );
656
656
}
657
657
658
658
void handleRoute (RouteImpl route ) {
@@ -817,7 +817,7 @@ WritableStream createTempFile(String name, long lastModifiedMs) {
817
817
JsonObject params = new JsonObject ();
818
818
params .addProperty ("name" , name );
819
819
params .addProperty ("lastModifiedMs" , lastModifiedMs );
820
- JsonObject json = sendMessage ("createTempFile" , params ).getAsJsonObject ();
820
+ JsonObject json = sendMessage ("createTempFile" , params , NO_TIMEOUT ).getAsJsonObject ();
821
821
return connection .getExistingObject (json .getAsJsonObject ("writableStream" ).get ("guid" ).getAsString ());
822
822
}
823
823
0 commit comments