load-pageshow-events-iframe-contentWindow.html (1906B)
1 <!DOCTYPE html> 2 <meta charset="UTF-8"> 3 <title>"load" & "pageshow" events do not fire on contentWindow of iframe that stays on the initial empty document</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <script src="resources/helpers.js"></script> 7 <body></body> 8 <script> 9 "use strict"; 10 11 promise_test(async t => { 12 const iframe = document.createElement("iframe"); 13 document.body.appendChild(iframe); 14 return assertNoLoadAndPageshowEvent(t, iframe.contentWindow); 15 }, "load & pageshow event do not fire on contentWindow of <iframe> element created with no src"); 16 17 promise_test(async t => { 18 const iframe = document.createElement("iframe"); 19 iframe.src = ""; 20 document.body.appendChild(iframe); 21 return assertNoLoadAndPageshowEvent(t, iframe.contentWindow); 22 }, "load & pageshow events do not fire on contentWindow of <iframe> element created with src=''"); 23 24 promise_test(async t => { 25 const iframe = document.createElement("iframe"); 26 iframe.src = "about:blank"; 27 document.body.appendChild(iframe); 28 return assertNoLoadAndPageshowEvent(t, iframe.contentWindow); 29 }, "load & pageshow events do not fire on contentWindow of <iframe> element created with src='about:blank'"); 30 31 promise_test(async t => { 32 const iframe = document.createElement("iframe"); 33 iframe.src = "about:blank#foo"; 34 document.body.appendChild(iframe); 35 return assertNoLoadAndPageshowEvent(t, iframe.contentWindow); 36 }, "load & pageshow events do not fire on contentWindow of <iframe> element created with src='about:blank#foo'"); 37 38 promise_test(async t => { 39 const iframe = document.createElement("iframe"); 40 iframe.src = "about:blank?foo"; 41 document.body.appendChild(iframe); 42 return assertNoLoadAndPageshowEvent(t, iframe.contentWindow); 43 }, "load & pageshow events do not fire on contentWindow of <iframe> element created with src='about:blank?foo'"); 44 </script>