Bug 1786639 - [wdspec] Use pagehide instead of unload for webdriver navigate test r=webdriver-reviewers,whimboo

Depends on D208638

Differential Revision: https://phabricator.services.mozilla.com/D208639
This commit is contained in:
Julian Descottes 2024-05-02 07:29:03 +00:00
parent 6bda69a738
commit 2251735c2d
2 changed files with 3 additions and 7 deletions

View File

@ -1,4 +0,0 @@
[navigate.py]
[test_link_unload_event]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1786639

View File

@ -36,14 +36,14 @@ def test_multi_line_link(session, inline, url):
assert session.url == url(link)
def test_link_unload_event(session, url, server_config, inline):
def test_navigation_retains_input_state(session, url, server_config, inline):
link = "/webdriver/tests/classic/element_click/support/input.html"
session.url = inline(f"""
<body onunload="checkUnload()">
<body onpagehide="checkPageHide()">
<a href="{link}">click here</a>
<input type="checkbox">
<script>
function checkUnload() {{
function checkPageHide() {{
document.getElementsByTagName("input")[0].checked = true;
}}
</script>