Commit 54dc8134 authored by Simon Pieters's avatar Simon Pieters Committed by aborovova@mozilla.com
Browse files

Bug 1966106 [wpt PR 52493] - Avoid timeout in iframe loading=lazy navigation.reload test,

Automatic update from web-platform-tests
Avoid timeout in iframe loading=lazy navigation.reload test

If `navigation.reload` is not supported, the `iframe.hidden = false;` line was not reached, so `iframeLoaded` would never resolve.
--

wpt-commits: 99e8d52f36fd76a62a236f6b69c075f524d4e1c8
wpt-pr: 52493

Differential Revision: https://phabricator.services.mozilla.com/D250186
parent 6688f322
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -14,8 +14,8 @@ iframe.hidden = false;
<script src="/resources/testharnessreport.js"></script>
<script>
setup({single_test: true});
iframeLoaded.then(() => {
assert_true("navigation" in window, "Navigation API is supported");
iframeLoaded.then(() => {
  // Need a timeout to detect failure when there are two navigations.
  step_timeout(() => {
    assert_equals(iframe.contentWindow.location.href, new URL("support/blank.htm?nav", location.href).href);
+2 −2
Original line number Diff line number Diff line
<!DOCTYPE html>
<title>Reloading iframe loading='lazy' before it is loaded: location.reload</title>
<title>Reloading iframe loading='lazy' before it is loaded: navigation.reload</title>
<iframe src="support/blank.htm?src" loading="lazy" hidden></iframe>
<script>
const iframe = document.querySelector('iframe');
@@ -15,10 +15,10 @@ iframe.hidden = false;
<script src="/resources/testharnessreport.js"></script>
<script>
setup({single_test: true});
assert_true("navigation" in window, "Navigation API is supported");
iframeLoaded.then(() => {
  // Need a timeout to detect failure when there are two navigations.
  step_timeout(() => {
    assert_true("navigation" in window, "Navigation API is supported");
    assert_equals(iframe.contentWindow.location.href, new URL("support/blank.htm?src", location.href).href);
    done();
  }, 1000);