@@ -100,7 +100,7 @@ enum EventType {
100100 request = connection .getExistingObject (initializer .getAsJsonObject ("requestContext" ).get ("guid" ).getAsString ());
101101 request .timeoutSettings = timeoutSettings ;
102102 clock = new ClockImpl (this );
103- closePromise = new WaitableEvent <>(listeners , EventType .CLOSE );
103+ closePromise = new WaitableEvent <>(listeners , EventType .CLOSE );
104104 }
105105
106106 Path videosDir () {
@@ -121,7 +121,7 @@ URL baseUrl() {
121121 }
122122 return null ;
123123 }
124-
124+
125125 String effectiveCloseReason () {
126126 if (closeReason != null ) {
127127 return closeReason ;
@@ -261,15 +261,15 @@ private Page waitForPageImpl(WaitForPageOptions options, Runnable code) {
261261 public CDPSession newCDPSession (Page page ) {
262262 JsonObject params = new JsonObject ();
263263 params .add ("page" , ((PageImpl ) page ).toProtocolRef ());
264- JsonObject result = sendMessage ("newCDPSession" , params ).getAsJsonObject ();
264+ JsonObject result = sendMessage ("newCDPSession" , params , NO_TIMEOUT ).getAsJsonObject ();
265265 return connection .getExistingObject (result .getAsJsonObject ("session" ).get ("guid" ).getAsString ());
266266 }
267267
268268 @ Override
269269 public CDPSession newCDPSession (Frame frame ) {
270270 JsonObject params = new JsonObject ();
271271 params .add ("frame" , ((FrameImpl ) frame ).toProtocolRef ());
272- JsonObject result = sendMessage ("newCDPSession" , params ).getAsJsonObject ();
272+ JsonObject result = sendMessage ("newCDPSession" , params , NO_TIMEOUT ).getAsJsonObject ();
273273 return connection .getExistingObject (result .getAsJsonObject ("session" ).get ("guid" ).getAsString ());
274274 }
275275
@@ -285,7 +285,7 @@ public void close(CloseOptions options) {
285285 for (Map .Entry <String , HarRecorder > entry : harRecorders .entrySet ()) {
286286 JsonObject params = new JsonObject ();
287287 params .addProperty ("harId" , entry .getKey ());
288- JsonObject json = sendMessage ("harExport" , params ).getAsJsonObject ();
288+ JsonObject json = sendMessage ("harExport" , params , NO_TIMEOUT ).getAsJsonObject ();
289289 ArtifactImpl artifact = connection .getExistingObject (json .getAsJsonObject ("artifact" ).get ("guid" ).getAsString ());
290290 // Server side will compress artifact if content is attach or if file is .zip.
291291 HarRecorder harParams = entry .getValue ();
@@ -297,14 +297,14 @@ public void close(CloseOptions options) {
297297 JsonObject unzipParams = new JsonObject ();
298298 unzipParams .addProperty ("zipFile" , tmpPath );
299299 unzipParams .addProperty ("harFile" , harParams .path .toString ());
300- connection .localUtils .sendMessage ("harUnzip" , unzipParams );
300+ connection .localUtils .sendMessage ("harUnzip" , unzipParams , NO_TIMEOUT );
301301 } else {
302302 artifact .saveAs (harParams .path );
303303 }
304304 artifact .delete ();
305305 }
306306 JsonObject params = gson ().toJsonTree (options ).getAsJsonObject ();
307- sendMessage ("close" , params );
307+ sendMessage ("close" , params , NO_TIMEOUT );
308308 }
309309 runUntil (() -> {}, closePromise );
310310 }
@@ -319,14 +319,14 @@ public List<Cookie> cookies(String url) {
319319 public void addCookies (List <Cookie > cookies ) {
320320 JsonObject params = new JsonObject ();
321321 params .add ("cookies" , gson ().toJsonTree (cookies ));
322- sendMessage ("addCookies" , params );
322+ sendMessage ("addCookies" , params , NO_TIMEOUT );
323323 }
324324
325325 @ Override
326326 public void addInitScript (String script ) {
327327 JsonObject params = new JsonObject ();
328328 params .addProperty ("source" , script );
329- sendMessage ("addInitScript" , params );
329+ sendMessage ("addInitScript" , params , NO_TIMEOUT );
330330 }
331331
332332 @ Override
@@ -358,7 +358,7 @@ public void clearCookies(ClearCookiesOptions options) {
358358 setStringOrRegex (params , "name" , options .name );
359359 setStringOrRegex (params , "domain" , options .domain );
360360 setStringOrRegex (params , "path" , options .path );
361- sendMessage ("clearCookies" , params );
361+ sendMessage ("clearCookies" , params , NO_TIMEOUT );
362362 }
363363
364364 private static void setStringOrRegex (JsonObject params , String name , Object value ) {
@@ -383,7 +383,7 @@ public List<Cookie> cookies(List<String> urls) {
383383 urls = new ArrayList <>();
384384 }
385385 params .add ("urls" , gson ().toJsonTree (urls ));
386- JsonObject json = sendMessage ("cookies" , params ).getAsJsonObject ();
386+ JsonObject json = sendMessage ("cookies" , params , NO_TIMEOUT ).getAsJsonObject ();
387387 Cookie [] cookies = gson ().fromJson (json .getAsJsonArray ("cookies" ), Cookie [].class );
388388 return asList (cookies );
389389 }
@@ -409,7 +409,7 @@ private void exposeBindingImpl(String name, BindingCallback playwrightBinding, E
409409 if (options != null && options .handle != null && options .handle ) {
410410 params .addProperty ("needsHandle" , true );
411411 }
412- sendMessage ("exposeBinding" , params );
412+ sendMessage ("exposeBinding" , params , NO_TIMEOUT );
413413 }
414414
415415 @ Override
@@ -427,7 +427,7 @@ public void grantPermissions(List<String> permissions, GrantPermissionsOptions o
427427 }
428428 JsonObject params = gson ().toJsonTree (options ).getAsJsonObject ();
429429 params .add ("permissions" , gson ().toJsonTree (permissions ));
430- sendMessage ("grantPermissions" , params );
430+ sendMessage ("grantPermissions" , params , NO_TIMEOUT );
431431 }
432432
433433 @ Override
@@ -517,13 +517,13 @@ void recordIntoHar(PageImpl page, Path har, RouteFromHAROptions options, HarCont
517517 params .add ("page" , page .toProtocolRef ());
518518 }
519519 JsonObject recordHarArgs = new JsonObject ();
520- recordHarArgs .addProperty ("zip" , har .toString ().endsWith (".zip" ));
520+ recordHarArgs .addProperty ("zip" , har .toString ().endsWith (".zip" ));
521521 recordHarArgs .addProperty ("content" , contentPolicy .name ().toLowerCase ());
522522 recordHarArgs .addProperty ("mode" , (options .updateMode == null ? HarMode .MINIMAL : options .updateMode ).name ().toLowerCase ());
523523 addHarUrlFilter (recordHarArgs , options .url );
524524
525525 params .add ("options" , recordHarArgs );
526- JsonObject json = sendMessage ("harStart" , params ).getAsJsonObject ();
526+ JsonObject json = sendMessage ("harStart" , params , NO_TIMEOUT ).getAsJsonObject ();
527527 String harId = json .get ("harId" ).getAsString ();
528528 harRecorders .put (harId , new HarRecorder (har , contentPolicy ));
529529 }
@@ -549,7 +549,7 @@ public void setExtraHTTPHeaders(Map<String, String> headers) {
549549 jsonHeaders .add (header );
550550 }
551551 params .add ("headers" , jsonHeaders );
552- sendMessage ("setExtraHTTPHeaders" , params );
552+ sendMessage ("setExtraHTTPHeaders" , params , NO_TIMEOUT );
553553 }
554554
555555 @ Override
@@ -558,14 +558,14 @@ public void setGeolocation(Geolocation geolocation) {
558558 if (geolocation != null ) {
559559 params .add ("geolocation" , gson ().toJsonTree (geolocation ));
560560 }
561- sendMessage ("setGeolocation" , params );
561+ sendMessage ("setGeolocation" , params , NO_TIMEOUT );
562562 }
563563
564564 @ Override
565565 public void setOffline (boolean offline ) {
566566 JsonObject params = new JsonObject ();
567567 params .addProperty ("offline" , offline );
568- sendMessage ("setOffline" , params );
568+ sendMessage ("setOffline" , params , NO_TIMEOUT );
569569 }
570570
571571 @ Override
@@ -575,7 +575,7 @@ public String storageState(StorageStateOptions options) {
575575 }
576576 JsonObject params = gson ().toJsonTree (options ).getAsJsonObject ();
577577 params .remove ("path" );
578- JsonElement json = sendMessage ("storageState" , params );
578+ JsonElement json = sendMessage ("storageState" , params , NO_TIMEOUT );
579579
580580 String storageState = json .toString ();
581581 if (options .path != null ) {
@@ -648,11 +648,11 @@ private void unroute(UrlMatcher matcher, Consumer<Route> handler) {
648648 }
649649
650650 private void updateInterceptionPatterns () {
651- sendMessage ("setNetworkInterceptionPatterns" , routes .interceptionPatterns ());
651+ sendMessage ("setNetworkInterceptionPatterns" , routes .interceptionPatterns (), NO_TIMEOUT );
652652 }
653653
654654 private void updateWebSocketInterceptionPatterns () {
655- sendMessage ("setWebSocketInterceptionPatterns" , webSocketRoutes .interceptionPatterns ());
655+ sendMessage ("setWebSocketInterceptionPatterns" , webSocketRoutes .interceptionPatterns (), NO_TIMEOUT );
656656 }
657657
658658 void handleRoute (RouteImpl route ) {
@@ -817,7 +817,7 @@ WritableStream createTempFile(String name, long lastModifiedMs) {
817817 JsonObject params = new JsonObject ();
818818 params .addProperty ("name" , name );
819819 params .addProperty ("lastModifiedMs" , lastModifiedMs );
820- JsonObject json = sendMessage ("createTempFile" , params ).getAsJsonObject ();
820+ JsonObject json = sendMessage ("createTempFile" , params , NO_TIMEOUT ).getAsJsonObject ();
821821 return connection .getExistingObject (json .getAsJsonObject ("writableStream" ).get ("guid" ).getAsString ());
822822 }
823823
0 commit comments