activation-history-replaceState.html (805B)
1 <!doctype html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <script> 5 promise_test(async t => { 6 // Wait for after the load event so that the navigation doesn't get converted 7 // into a replace navigation. 8 await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0)); 9 10 assert_equals(navigation.activation.entry, navigation.currentEntry); 11 let activationEntry = navigation.activation.entry; 12 history.replaceState("#fragment", "", ""); 13 assert_not_equals(navigation.activation.entry, navigation.currentEntry); 14 assert_equals(navigation.activation.entry, activationEntry); 15 assert_equals(navigation.activation.entry.index, -1); 16 }, "navigation.activation.entry should be orphaned by history.replaceState()"); 17 </script>