Skip to content

Commit d671e13

Browse files
committed
Pass NO_TIMEOUT to newRequest
1 parent 6d93643 commit d671e13

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

playwright/src/main/java/com/microsoft/playwright/impl/APIRequestImpl.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)