key-id-location-replace-cross-origin.html (749B)
1 <!doctype html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <script src="/common/get-host-info.sub.js"></script> 5 <iframe id="i" src="/common/blank.html"></iframe> 6 <script> 7 async_test(t => { 8 window.onload = t.step_func(() => { 9 let key_before_replace = i.contentWindow.navigation.currentEntry.key; 10 window.onmessage = t.step_func_done(e => assert_not_equals(key_before_replace, e.data)); 11 12 let cross_origin_url = new URL("resources/post-key-to-top.html", location.href); 13 cross_origin_url.hostname = get_host_info().REMOTE_HOST; 14 i.contentWindow.location.replace(cross_origin_url.href); 15 }); 16 }, "NavigationHistoryEntry's key and id after location.replace()"); 17 </script>