replaceState-inside-back-handler.html (720B)
1 <!doctype html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <script src="../navigation-methods/return-value/resources/helpers.js"></script> 5 <script> 6 promise_test(async t => { 7 // Wait for after the load event so that the navigation doesn't get converted 8 // into a replace navigation. 9 await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0)); 10 11 await navigation.navigate("#push").finished; 12 navigation.addEventListener("navigate", () => history.replaceState(null, "", "#"), {once: true}); 13 await assertBothRejectDOM(t, navigation.back(), "AbortError"); 14 }, "replaceState inside a navigate event for navigation.back()"); 15 </script>