navigate-form-reload.html (1109B)
1 <!doctype html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <iframe id="iframe" name="i" src="/common/blank.html"></iframe> 5 <form id="form" action="/common/blank.html?1" method="post" target="i"></form> 6 <script> 7 async_test(t => { 8 window.onload = t.step_func(() => { 9 navigation.onnavigate = t.step_func_done(() => { 10 assert_unreached("onnavigate should not have fired in source window"); 11 }); 12 iframe.contentWindow.navigation.onnavigate = t.step_func(e => { 13 assert_equals(e.navigationType, "push"); 14 assert_not_equals(e.formData, null); 15 assert_equals(e.sourceElement, form); 16 17 iframe.onload = t.step_func(() => { 18 iframe.contentWindow.navigation.onnavigate = t.step_func_done(e => { 19 assert_equals(e.navigationType, "reload"); 20 assert_equals(e.formData, null); 21 }); 22 23 iframe.contentWindow.location.reload(); 24 }); 25 }); 26 form.submit(); 27 }); 28 }, "reloading a page created from form submission results in formData of null, not the original form data"); 29 </script>