navigation-back-forward-cross-doc.html (1017B)
1 <!doctype html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <iframe id="i" src="/common/blank.html"></iframe> 5 <script> 6 promise_test(async t => { 7 await new Promise(resolve => window.onload = resolve); 8 i.contentWindow.navigation.navigate("/common/blank.html?1"); 9 await new Promise(resolve => i.onload = resolve); 10 assert_equals(i.contentWindow.navigation.entries().length, 2); 11 12 i.contentWindow.navigation.oncurrententrychange = t.unreached_func("currententrychange should not fire for cross-document navigations"); 13 i.contentWindow.navigation.back(); 14 await new Promise(resolve => i.onload = resolve); 15 16 i.contentWindow.navigation.oncurrententrychange = t.unreached_func("currententrychange should not fire for cross-document navigations"); 17 i.contentWindow.navigation.forward(); 18 await new Promise(resolve => i.onload = resolve); 19 }, "currententrychange does not fire for cross-document navigation.back() and navigation.forward()"); 20 </script>