Closed Bug 2028075 Opened 2 months ago Closed 1 month ago

[wdspec] bidi/browsing_context/reload/frame.py is not awaiting last assert

Categories

(Remote Protocol :: WebDriver BiDi, defect, P3)

defect
Points:
1

Tracking

(firefox152 fixed)

RESOLVED FIXED
152 Branch
Tracking Status
firefox152 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

(Blocks 1 open bug)

Details

(Whiteboard: [webdriver:m20], [wptsync upstream])

Attachments

(1 file)

This test is incorrect https://searchfox.org/firefox-main/rev/9a3317a65545e83f4e32b94fdf1f6860342423ef/testing/web-platform/tests/webdriver/tests/bidi/browsing_context/reload/frame.py#10-11,29-31

@pytest.mark.parametrize("domain", ["", "alt"], ids=["same_origin", "cross_origin"])
async def test_origin(bidi_session, new_tab, inline, domain):
...
    # Reload and assert (frame).
    reload_and_assert(bidi_session, frame, last_navigation=result["navigation"], url=frame_url)

In theory we should await reload_and_assert, but the issue is that this helper doesn't work as is with iframes, because it assumes the context (here frame) should survive the reload, which is not true for iframes.

Depends on: 2030909
Priority: -- → P3
Whiteboard: [webdriver:backlog]

Let's just update the test to await and adjust the manifest accordingly.

Points: --- → 1
Flags: needinfo?(jdescottes)
Whiteboard: [webdriver:backlog] → [webdriver:m20]
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Flags: needinfo?(jdescottes)
Blocks: 2030909
No longer depends on: 2030909

With this change, both Chrome and Firefox fail the test.

Chrome fails with:

FAIL test_origin[same_origin] - webdriver.bidi.error.UnknownErrorException: unknown error (navigation canceled by context disposal)
FAIL test_origin[cross_origin] - webdriver.bidi.error.UnknownErrorException: unknown error (Command can only be executed on top-level targets)

(this second error is odd as it seems to indicate Chrome rejects reload commands for non top-level contexts, which is not spec compliant)

Firefox fails with

FAIL test_origin[same_origin] - webdriver.bidi.error.UnknownErrorException: unknown error (Error: Browsing context got discarded)
FAIL test_origin[cross_origin] - webdriver.bidi.error.UnknownErrorException: unknown error (Error: Browsing context got discarded)

As described on Bug 2030909, this specific error seems related to the fact that we use the sessionHistory reload now. However switching back to context reload navigates to about:blank (so no error in the command itself, but fails the assert).

From what I mentioned in our triage meeting, we get a pytest warning about a non awaited coroutine:

RuntimeWarning: coroutine 'coroutine_name' was never awaited

Maybe we could make the tests fail on this warning?

On the linting side, Ruff implements something which seems relevant but I haven't tried it out https://github.com/astral-sh/ruff/pull/9911/

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/59353 for changes under testing/web-platform/tests

Whiteboard: [webdriver:m20] → [webdriver:m20], [wptsync upstream]
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch

Upstream PR merged by moz-wptsync-bot

Severity: -- → S4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: