Skip to content

Commit 99e8d52

Browse files
authored
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.
1 parent 6b7cd07 commit 99e8d52

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-nav-navigation-navigate.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
<script src="/resources/testharnessreport.js"></script>
1515
<script>
1616
setup({single_test: true});
17+
assert_true("navigation" in window, "Navigation API is supported");
1718
iframeLoaded.then(() => {
18-
assert_true("navigation" in window, "Navigation API is supported");
1919
// Need a timeout to detect failure when there are two navigations.
2020
step_timeout(() => {
2121
assert_equals(iframe.contentWindow.location.href, new URL("support/blank.htm?nav", location.href).href);

html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-reload-navigation-reload.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<title>Reloading iframe loading='lazy' before it is loaded: location.reload</title>
2+
<title>Reloading iframe loading='lazy' before it is loaded: navigation.reload</title>
33
<iframe src="support/blank.htm?src" loading="lazy" hidden></iframe>
44
<script>
55
const iframe = document.querySelector('iframe');
@@ -15,10 +15,10 @@
1515
<script src="/resources/testharnessreport.js"></script>
1616
<script>
1717
setup({single_test: true});
18+
assert_true("navigation" in window, "Navigation API is supported");
1819
iframeLoaded.then(() => {
1920
// Need a timeout to detect failure when there are two navigations.
2021
step_timeout(() => {
21-
assert_true("navigation" in window, "Navigation API is supported");
2222
assert_equals(iframe.contentWindow.location.href, new URL("support/blank.htm?src", location.href).href);
2323
done();
2424
}, 1000);

0 commit comments

Comments
 (0)