Closed
Bug 2018154
Opened 7 months ago
Closed 2 months ago
Missing "script.realmDestroyed" event for worker after cross-process navigation in playwright test
Categories
(Remote Protocol :: WebDriver BiDi, defect, P3)
Remote Protocol
WebDriver BiDi
Tracking
(firefox154 fixed)
RESOLVED
FIXED
154 Branch
| Tracking | Status | |
|---|---|---|
| firefox154 | --- | fixed |
People
(Reporter: hbenl, Assigned: edenchuang)
References
(Blocks 1 open bug)
Details
(Whiteboard: [webdriver:m21][webdriver:external][webdriver:relnote])
This Playwright test fails because it doesn't receive the expected script.realmDestroyed event for a worker in a cross-process navigation. When I run it with DEBUG=pw:protocol I can see that Firefox doesn't send this event for the worker. The corresponding test for in-process navigations passes.
I couldn't reproduce the issue in a wdspec test yet, this is how I tried to mimick the Playwright test's behavior as closely as possible:
async def test_dedicated_worker_cross_process_navigation(
bidi_session,
subscribe_events,
create_user_context,
server_config,
):
user_context = await create_user_context()
context = await bidi_session.browsing_context.create(
type_hint="window", user_context=user_context
)
await subscribe_events(events=[REALM_CREATED_EVENT, REALM_DESTROYED_EVENT])
created_events = []
destroyed_events = []
async def on_realm_created_event(method, data):
if data["type"] == "dedicated-worker":
created_events.append(data)
async def on_realm_destroyed_event(method, data):
if len(created_events) > 0 and data["realm"] == created_events[0]["realm"]:
destroyed_events.append(data)
bidi_session.add_event_listener(REALM_CREATED_EVENT, on_realm_created_event)
bidi_session.add_event_listener(REALM_DESTROYED_EVENT, on_realm_destroyed_event)
port = server_config["ports"]["http"][0]
await bidi_session.browsing_context.navigate(
url=f"http://localhost:{port}/webdriver/tests/bidi/browsing_context/support/empty.html",
context=context["context"],
wait="complete"
)
await bidi_session.script.call_function(
function_declaration="arg => eval(arg)()",
arguments=[{"type": "string", "value": """() => new Worker(URL.createObjectURL(new Blob(["console.log(1)"], {type: "application/javascript"})))"""}],
target={"context": context["context"]},
await_promise=True,
user_activation=True,
)
await wait_for_bidi_events(bidi_session, created_events, 1)
await bidi_session.browsing_context.navigate(
url=f"http://127.0.0.1:{port}/webdriver/tests/bidi/browsing_context/support/empty.html",
context=context["context"],
wait="complete"
)
await wait_for_bidi_events(bidi_session, destroyed_events, 1)
Updated•7 months ago
|
Points: --- → 2
Priority: -- → P3
Whiteboard: [webdriver:m19]
Updated•7 months ago
|
Summary: no realmDestroyed event for worker after cross-process navigation in playwright test → Missing "script.realmDestroyed" event for worker after cross-process navigation in playwright test
Comment 1•7 months ago
|
||
The severity field is not set for this bug.
:whimboo, could you have a look please?
For more information, please visit BugBot documentation.
Flags: needinfo?(hskupin)
Updated•7 months ago
|
Severity: -- → S3
Flags: needinfo?(hskupin)
Updated•6 months ago
|
Whiteboard: [webdriver:m19] → [webdriver:m20]
Updated•3 months ago
|
Whiteboard: [webdriver:m20] → [webdriver:m21]
Comment 2•3 months ago
|
||
Capacity reduced for m21, moving to m22
Whiteboard: [webdriver:m21] → [webdriver:m22]
| Reporter | ||
Comment 3•2 months ago
|
||
The Playwright test is passing now, this was fixed by Bug 1944240.
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Updated•2 months ago
|
Assignee: nobody → echuang
Points: 2 → ---
status-firefox154:
--- → fixed
Whiteboard: [webdriver:m22] → [webdriver:m21][webdriver:external]
Target Milestone: --- → 154 Branch
Updated•1 month ago
|
Whiteboard: [webdriver:m21][webdriver:external] → [webdriver:m21][webdriver:external][webdriver:relnote][
Updated•1 month ago
|
Whiteboard: [webdriver:m21][webdriver:external][webdriver:relnote][ → [webdriver:m21][webdriver:external][webdriver:relnote]
You need to log in
before you can comment on or make changes to this bug.
Description
•