dispose-for-full-session-history.tentative.html (824B)
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(r => window.onload = () => t.step_timeout(r, 0)); 9 10 let dispose_promise = new Promise(r => navigation.currentEntry.ondispose = r); 11 12 // There is no spec for the maximum number of joint session history entries 13 // (hence this is a .tentative.html test). However, all(?) browsers have a 14 // settled on a maximum of 50. 15 for (let i = 0; i < 50; i++) 16 await navigation.navigate("#" + i).finished; 17 await dispose_promise; 18 }, "Dispose should fire when an entry is removed from session history due to too many entries"); 19 </script>