File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
playwright/src/main/java/com/microsoft/playwright/impl Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -61,15 +61,17 @@ public APIRequestContextImpl newContext(NewContextOptions options) {
6161 }
6262 List <ClientCertificate > clientCertificateList = options .clientCertificates ;
6363 options .clientCertificates = null ;
64+ Double timeout = options .timeout ;
65+ // Timeout is handled on the client.
66+ options .timeout = null ;
6467 JsonObject params = gson ().toJsonTree (options ).getAsJsonObject ();
6568 if (storageState != null ) {
6669 params .add ("storageState" , storageState );
6770 }
6871 addToProtocol (params , clientCertificateList );
69- // Timeout here is not the command's timeout, but we pass it for consistency.
70- JsonObject result = playwright .sendMessage ("newRequest" , params , options .timeout ).getAsJsonObject ();
72+ JsonObject result = playwright .sendMessage ("newRequest" , params , NO_TIMEOUT ).getAsJsonObject ();
7173 APIRequestContextImpl context = playwright .connection .getExistingObject (result .getAsJsonObject ("request" ).get ("guid" ).getAsString ());
72- context .timeoutSettings .setDefaultTimeout (options . timeout );
74+ context .timeoutSettings .setDefaultTimeout (timeout );
7375 return context ;
7476 }
7577}
You can’t perform that action at this time.
0 commit comments