-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add wdspec tests for browsingContext.navigate to image.
Differential Revision: https://phabricator.services.mozilla.com/D146418 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1763132 gecko-commit: 1344380bb5fdef39d083b209267e013df9b4797a gecko-reviewers: webdriver-reviewers, whimboo
- Loading branch information
1 parent
e422616
commit 0de2c3a
Showing
4 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import pytest | ||
|
||
from . import navigate_and_assert | ||
|
||
pytestmark = pytest.mark.asyncio | ||
|
||
PAGE_EMPTY = "/webdriver/tests/bidi/browsing_context/navigate/support/empty.html" | ||
PNG_BLACK_DOT = "/webdriver/tests/bidi/browsing_context/navigate/support/black_dot.png" | ||
PNG_RED_DOT = "/webdriver/tests/bidi/browsing_context/navigate/support/red_dot.png" | ||
SVG = "/webdriver/tests/bidi/browsing_context/navigate/support/other.svg" | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"url_before, url_after", | ||
[ | ||
(PAGE_EMPTY, SVG), | ||
(SVG, PAGE_EMPTY), | ||
(PAGE_EMPTY, PNG_BLACK_DOT), | ||
(PNG_BLACK_DOT, PNG_RED_DOT), | ||
(PNG_RED_DOT, SVG), | ||
(PNG_BLACK_DOT, PAGE_EMPTY), | ||
], | ||
ids=[ | ||
"document to svg", | ||
"svg to document", | ||
"document to png", | ||
"png to png", | ||
"png to svg", | ||
"png to document", | ||
], | ||
) | ||
async def test_navigate_between_img_and_html( | ||
bidi_session, new_tab, url, url_before, url_after | ||
): | ||
await navigate_and_assert(bidi_session, new_tab, url(url_before)) | ||
await navigate_and_assert(bidi_session, new_tab, url(url_after)) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"img", | ||
[SVG, PNG_BLACK_DOT], | ||
ids=[ | ||
"to svg", | ||
"to png", | ||
], | ||
) | ||
async def test_navigate_in_iframe(bidi_session, new_tab, inline, url, img): | ||
frame_start_url = inline("frame") | ||
url_before = inline(f"<iframe src='{frame_start_url}'></iframe>") | ||
contexts = await navigate_and_assert(bidi_session, new_tab, url_before) | ||
|
||
assert len(contexts[0]["children"]) == 1 | ||
frame = contexts[0]["children"][0] | ||
assert frame["url"] == frame_start_url | ||
|
||
await navigate_and_assert(bidi_session, frame, url(img)) |
Binary file added
BIN
+70 Bytes
webdriver/tests/bidi/browsing_context/navigate/support/black_dot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
webdriver/tests/bidi/browsing_context/navigate/support/other.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.