Skip to content

Commit b5273b8

Browse files
authored
chore: roll Playwright to 1.25.0-alpha-jul-26-2022 (#1456)
- Roll to fix MSEdge downloads Ports: - [chore: reparent context objects into the object (#15689)](microsoft/playwright@a198b6d) Resolves #1398.
1 parent 5f95476 commit b5273b8

File tree

5 files changed

+25
-6
lines changed

5 files changed

+25
-6
lines changed

README.md

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

55
| | Linux | macOS | Windows |
66
| :--- | :---: | :---: | :---: |
7-
| Chromium <!-- GEN:chromium-version -->104.0.5112.48<!-- GEN:stop --> ||||
7+
| Chromium <!-- GEN:chromium-version -->104.0.5112.57<!-- GEN:stop --> ||||
88
| WebKit <!-- GEN:webkit-version -->16.0<!-- GEN:stop --> ||||
99
| Firefox <!-- GEN:firefox-version -->102.0<!-- GEN:stop --> ||||
1010

playwright/_impl/_browser_context.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,7 @@ def __init__(
100100
self._service_workers: Set[Worker] = set()
101101
self._tracing = cast(Tracing, from_channel(initializer["tracing"]))
102102
self._har_recorders: Dict[str, HarRecordingMetadata] = {}
103-
self._request: APIRequestContext = from_channel(
104-
initializer["APIRequestContext"]
105-
)
103+
self._request: APIRequestContext = from_channel(initializer["requestContext"])
106104
self._channel.on(
107105
"bindingCall",
108106
lambda params: self._on_binding(from_channel(params["binding"])),

playwright/_impl/_connection.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ def _dispose(self) -> None:
129129
object._dispose()
130130
self._objects.clear()
131131

132+
def _adopt(self, child: "ChannelOwner") -> None:
133+
del cast("ChannelOwner", child._parent)._objects[child._guid]
134+
self._objects[child._guid] = child
135+
child._parent = self
136+
132137

133138
class ProtocolCallback:
134139
def __init__(self, loop: asyncio.AbstractEventLoop) -> None:
@@ -294,6 +299,19 @@ def dispatch(self, msg: ParsedMessagePayload) -> None:
294299
parent, params["type"], params["guid"], params["initializer"]
295300
)
296301
return
302+
303+
object = self._objects.get(guid)
304+
if not object:
305+
raise Exception(f'Cannot find object to "{method}": {guid}')
306+
307+
if method == "__adopt__":
308+
child_guid = cast(Dict[str, str], params)["guid"]
309+
child = self._objects.get(child_guid)
310+
if not child:
311+
raise Exception(f"Unknown new child: {child_guid}")
312+
object._adopt(child)
313+
return
314+
297315
if method == "__dispose__":
298316
self._objects[guid]._dispose()
299317
return

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
InWheel = None
3131
from wheel.bdist_wheel import bdist_wheel as BDistWheelCommand
3232

33-
driver_version = "1.24.0"
33+
driver_version = "1.25.0-alpha-jul-26-2022"
3434

3535

3636
def extractall(zip: zipfile.ZipFile, path: str) -> None:

tests/async/test_launcher.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ async def test_browser_type_launch_should_reject_all_promises_when_browser_is_cl
2929
await page.close()
3030
with pytest.raises(Error) as exc:
3131
await never_resolves
32-
assert "Target closed" in exc.value.message
32+
assert (
33+
"Target closed" in exc.value.message
34+
or "Target page, context or browser has been closed" in exc.value.message
35+
)
3336

3437

3538
@pytest.mark.skip_browser("firefox")

0 commit comments

Comments
 (0)