subframe-loading.https.html (983B)
1 <!DOCTYPE html> 2 <title>Test Subframe Loading Disabler</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 6 <body> 7 <script> 8 9 promise_test(async () => { 10 const container = document.body.appendChild(document.createElement("div")); 11 12 // Create a helper iframe that triggers loading the new fenced frame 13 // simultaneously when the parent container is removed. 14 const helperFrame = container.appendChild(document.createElement("iframe")); 15 16 helperFrame.contentWindow.onunload = function() { 17 const fenced_frame = document.createElement("fencedframe"); 18 fenced_frame.src = "resources/dummy.https.html"; 19 container.appendChild(fenced_frame); 20 }; 21 22 // If the fenced frame loads when it's not supposed to, 23 // a DCHECK will catch that and cause the test to crash. 24 document.body.removeChild(container); 25 26 }, "Fenced frames should not load if its parent has subframe loading disabled"); 27 28 </script> 29 </body> 30 </html>