Skip to content

chore: roll Playwright to 1.25.0-alpha-jul-26-2022 #1456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Playwright is a Python library to automate [Chromium](https://www.chromium.org/H

| | Linux | macOS | Windows |
| :--- | :---: | :---: | :---: |
| Chromium <!-- GEN:chromium-version -->104.0.5112.48<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| Chromium <!-- GEN:chromium-version -->104.0.5112.57<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| WebKit <!-- GEN:webkit-version -->16.0<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| Firefox <!-- GEN:firefox-version -->102.0<!-- GEN:stop --> | ✅ | ✅ | ✅ |

Expand Down
4 changes: 1 addition & 3 deletions playwright/_impl/_browser_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ def __init__(
self._service_workers: Set[Worker] = set()
self._tracing = cast(Tracing, from_channel(initializer["tracing"]))
self._har_recorders: Dict[str, HarRecordingMetadata] = {}
self._request: APIRequestContext = from_channel(
initializer["APIRequestContext"]
)
self._request: APIRequestContext = from_channel(initializer["requestContext"])
self._channel.on(
"bindingCall",
lambda params: self._on_binding(from_channel(params["binding"])),
Expand Down
18 changes: 18 additions & 0 deletions playwright/_impl/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ def _dispose(self) -> None:
object._dispose()
self._objects.clear()

def _adopt(self, child: "ChannelOwner") -> None:
del cast("ChannelOwner", child._parent)._objects[child._guid]
self._objects[child._guid] = child
child._parent = self


class ProtocolCallback:
def __init__(self, loop: asyncio.AbstractEventLoop) -> None:
Expand Down Expand Up @@ -294,6 +299,19 @@ def dispatch(self, msg: ParsedMessagePayload) -> None:
parent, params["type"], params["guid"], params["initializer"]
)
return

object = self._objects.get(guid)
if not object:
raise Exception(f'Cannot find object to "{method}": {guid}')

if method == "__adopt__":
child_guid = cast(Dict[str, str], params)["guid"]
child = self._objects.get(child_guid)
if not child:
raise Exception(f"Unknown new child: {child_guid}")
object._adopt(child)
return

if method == "__dispose__":
self._objects[guid]._dispose()
return
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
InWheel = None
from wheel.bdist_wheel import bdist_wheel as BDistWheelCommand

driver_version = "1.24.0"
driver_version = "1.25.0-alpha-jul-26-2022"


def extractall(zip: zipfile.ZipFile, path: str) -> None:
Expand Down
5 changes: 4 additions & 1 deletion tests/async/test_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ async def test_browser_type_launch_should_reject_all_promises_when_browser_is_cl
await page.close()
with pytest.raises(Error) as exc:
await never_resolves
assert "Target closed" in exc.value.message
assert (
"Target closed" in exc.value.message
or "Target page, context or browser has been closed" in exc.value.message
)
Comment on lines +32 to +35
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which should it be? Seems like we get both which I'm not sure is intended or if it's a race. @mxschmitt

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idk!



@pytest.mark.skip_browser("firefox")
Expand Down