Skip to content

Commit 436fc12

Browse files
authored
feat: roll driver to 1.25.0-alpha-jul-28-2022 (#1015)
1 parent 560575a commit 436fc12

File tree

6 files changed

+25
-13
lines changed

6 files changed

+25
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Playwright is a Java library to automate [Chromium](https://www.chromium.org/Hom
1111

1212
| | Linux | macOS | Windows |
1313
| :--- | :---: | :---: | :---: |
14-
| Chromium <!-- GEN:chromium-version -->104.0.5112.48<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
14+
| Chromium <!-- GEN:chromium-version -->104.0.5112.57<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1515
| WebKit <!-- GEN:webkit-version -->16.0<!-- GEN:stop --> ||||
1616
| Firefox <!-- GEN:firefox-version -->102.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1717

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ enum EventType {
8383
}
8484
this.tracing = connection.getExistingObject(initializer.getAsJsonObject("tracing").get("guid").getAsString());
8585
tracing.isRemote = browser != null && browser.isRemote;
86-
this.request = connection.getExistingObject(initializer.getAsJsonObject("APIRequestContext").get("guid").getAsString());
86+
this.request = connection.getExistingObject(initializer.getAsJsonObject("requestContext").get("guid").getAsString());
8787
}
8888

8989
void setRecordHar(Path path, HarContentPolicy policy) {

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
class ChannelOwner extends LoggingSupport {
2828
final Connection connection;
29-
private final ChannelOwner parent;
29+
private ChannelOwner parent;
3030
private final Map<String, ChannelOwner> objects = new HashMap<>();
3131

3232
final String type;
@@ -68,6 +68,12 @@ void disconnect() {
6868
objects.clear();
6969
}
7070

71+
void adopt(ChannelOwner child) {
72+
child.parent.objects.remove(child.guid);
73+
objects.put(child.guid, child);
74+
child.parent = this;
75+
}
76+
7177
<T> T withWaitLogging(String apiName, Supplier<T> code) {
7278
return new WaitForEventLogger<>(this, apiName, code).get();
7379
}

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -201,18 +201,24 @@ private void dispatch(Message message) {
201201
createRemoteObject(message.guid, message.params);
202202
return;
203203
}
204-
if (message.method.equals("__dispose__")) {
205-
ChannelOwner object = objects.get(message.guid);
206-
if (object == null) {
207-
throw new PlaywrightException("Cannot find object to dispose: " + message.guid);
208-
}
209-
object.disconnect();
210-
return;
211-
}
204+
212205
ChannelOwner object = objects.get(message.guid);
213206
if (object == null) {
214207
throw new PlaywrightException("Cannot find object to call " + message.method + ": " + message.guid);
215208
}
209+
if (message.method.equals("__adopt__")) {
210+
String childGuid = message.params.get("guid").getAsString();
211+
ChannelOwner child = objects.get(childGuid);
212+
if (child == null) {
213+
throw new PlaywrightException("Unknown new child: " + childGuid);
214+
}
215+
object.adopt(child);
216+
return;
217+
}
218+
if (message.method.equals("__dispose__")) {
219+
object.disconnect();
220+
return;
221+
}
216222
object.handleEvent(message.method, message.params);
217223
}
218224

playwright/src/test/java/com/microsoft/playwright/TestPageBasic.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void shouldRejectAllPromisesWhenPageIsClosed() {
3939
newPage.evaluate("() => new Promise(r => {})");
4040
fail("evaluate should throw");
4141
} catch (PlaywrightException e) {
42-
assertTrue(e.getMessage().contains("Target closed"), e.getMessage());
42+
assertTrue(e.getMessage().contains("Target page, context or browser has been closed"), e.getMessage());
4343
}
4444
}
4545

scripts/CLI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.24.0
1+
1.25.0-alpha-jul-28-2022

0 commit comments

Comments
 (0)