nested-iframes.window.js (702B)
1 // META: script=/common/get-host-info.sub.js 2 3 const t1 = async_test("HTTP fetch"); 4 const t2 = async_test("HTTPS fetch"); 5 6 onmessage = function(e) { 7 const {protocol, success} = e.data; 8 if (protocol == "http:") { 9 t1.step(() => assert_false(success, "success")); 10 t1.done(); 11 } else if (protocol == "https:") { 12 t2.step(() => assert_true(success, "success")); 13 t2.done(); 14 } else { 15 [t1, t2].forEach(t => { 16 t.step(() => assert_unreached("Unknown message")); 17 t.done(); 18 }); 19 } 20 }; 21 22 const httpsFrame = document.createElement("iframe"); 23 httpsFrame.src = get_host_info().HTTPS_ORIGIN + "/mixed-content/resources/middle-frame.html"; 24 25 document.body.appendChild(httpsFrame);