Skip to content

Commit 574aa2e

Browse files
noamrchromium-wpt-export-bot
authored andcommitted
Deflake new defer-back test
The test can fail in cases where BFCache is disabled and some race condition makes it go in an infinite loop (back/forward/...) etc. Fixing the flakiness by synchronously changing the URL to "done" before performing the navigation from "initial" to "next", so that going back doesn't re-ignire the "initial" state. Bug: 469466893 Change-Id: I6cf64d57bddef61febff2fc3f810dffc05c96c6e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7532837 Commit-Queue: Noam Rosenthal <[email protected]> Reviewed-by: Dominic Farolino <[email protected]> Cr-Commit-Position: refs/heads/main@{#1576557}
1 parent ae3395b commit 574aa2e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

navigation-api/navigate-event/defer/tentative/defer-back.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@
2222
});
2323
break;
2424
case "initial":
25-
window.onload = () =>
25+
window.onload = () => {
26+
// Changing the URL synchronously to avoid an infinite loop when going back in case there is
27+
// no BFCache.
28+
history.replaceState(null, "", "?phase=done");
2629
navigation.navigate("?phase=next", { history: "push" });
30+
}
2731
break;
2832
case "next":
2933
window.onload = () => {

0 commit comments

Comments
 (0)