Skip to content

Commit

Permalink
[wdspec] Add test cases for serialization of cross-origin iframes.
Browse files Browse the repository at this point in the history
Depends on D195210

Differential Revision: https://phabricator.services.mozilla.com/D195211

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1867667
gecko-commit: ee79c48e48eabc16ef003194ce47bf6ec871e262
gecko-reviewers: webdriver-reviewers, whimboo
  • Loading branch information
lutien authored and moz-wptsync-bot committed Dec 3, 2023
1 parent cb2a296 commit f2d6aea
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
17 changes: 12 additions & 5 deletions webdriver/tests/bidi/script/call_function/remote_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,17 @@ async def test_window_context_top_level(bidi_session, top_context,


@pytest.mark.asyncio
@pytest.mark.parametrize("domain", ["", "alt"],
ids=["same_origin", "cross_origin"])
@pytest.mark.parametrize("await_promise", [True, False])
async def test_window_context_iframe_window(bidi_session, top_context,
test_page_same_origin_frame,
await_promise):
inline, domain, await_promise):

frame_url = inline("<div>foo</div>")
url = inline(f"<iframe src='{frame_url}'></iframe>", domain=domain)
await bidi_session.browsing_context.navigate(
context=top_context["context"],
url=test_page_same_origin_frame,
url=url,
wait="complete",
)

Expand All @@ -99,13 +102,17 @@ async def test_window_context_iframe_window(bidi_session, top_context,


@pytest.mark.asyncio
@pytest.mark.parametrize("domain", ["", "alt"],
ids=["same_origin", "cross_origin"])
@pytest.mark.parametrize("await_promise", [True, False])
async def test_window_context_iframe_content_window(
bidi_session, top_context, test_page_same_origin_frame, await_promise):
bidi_session, top_context, inline, domain, await_promise):

frame_url = inline("<div>foo</div>")
url = inline(f"<iframe src='{frame_url}'></iframe>", domain=domain)
await bidi_session.browsing_context.navigate(
context=top_context["context"],
url=test_page_same_origin_frame,
url=url,
wait="complete",
)

Expand Down
17 changes: 12 additions & 5 deletions webdriver/tests/bidi/script/evaluate/remote_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@ async def test_window_context_top_level(bidi_session, top_context, await_promise


@pytest.mark.asyncio
@pytest.mark.parametrize("domain", ["", "alt"],
ids=["same_origin", "cross_origin"])
@pytest.mark.parametrize("await_promise", [True, False])
async def test_window_context_iframe_window(
bidi_session, top_context, test_page_same_origin_frame, await_promise):

bidi_session, top_context, inline, domain, await_promise):
frame_url = inline("<div>foo</div>")
url = inline(f"<iframe src='{frame_url}'></iframe>", domain=domain)
await bidi_session.browsing_context.navigate(
context=top_context["context"],
url=test_page_same_origin_frame,
url=url,
wait="complete",
)

Expand All @@ -67,13 +70,17 @@ async def test_window_context_iframe_window(


@pytest.mark.asyncio
@pytest.mark.parametrize("domain", ["", "alt"],
ids=["same_origin", "cross_origin"])
@pytest.mark.parametrize("await_promise", [True, False])
async def test_window_context_iframe_content_window(
bidi_session, top_context, test_page_same_origin_frame, await_promise):
bidi_session, top_context, inline, domain, await_promise):

frame_url = inline("<div>foo</div>")
url = inline(f"<iframe src='{frame_url}'></iframe>", domain=domain)
await bidi_session.browsing_context.navigate(
context=top_context["context"],
url=test_page_same_origin_frame,
url=url,
wait="complete",
)

Expand Down

0 comments on commit f2d6aea

Please sign in to comment.