test_bug590870.html (1318B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 --> 5 <head> 6 <title>Test for creating XUL elements, bug 590870</title> 7 <script src="/tests/SimpleTest/SimpleTest.js"></script> 8 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 9 </head> 10 <body> 11 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=590870">Mozilla Bug 590870</a> 12 <p id="display"></p> 13 <iframe id=iframe></iframe> 14 <pre id="test"> 15 <script class="testbody" type="application/javascript"> 16 17 add_task(async function start() { 18 var noxul = "https://sub1.test1.example.com:443"; 19 var yesxul = "https://example.org:443" 20 21 await SpecialPowers.pushPermissions([ 22 { type: "allowXULXBL", allow: false, context: noxul }, 23 { type: "allowXULXBL", allow: true, context: yesxul } 24 ]); 25 26 var path = "/tests/dom/base/test/file_bug590870.html"; 27 var iframe = $('iframe'); 28 29 iframe.src = noxul + path; 30 await new Promise(resolve => window.addEventListener("message", event => { 31 is(event.data, true, "shouldn't be able to create XUL elements"); 32 resolve(); 33 }, { once: true } )); 34 35 iframe.src = yesxul + path; 36 await new Promise(resolve => window.addEventListener("message", event => { 37 is(event.data, false, "should be able to create XUL elements"); 38 resolve(); 39 }, { once: true } )); 40 }); 41 </script> 42 </pre> 43 </body> 44 </html>