test_custom_element_htmlconstructor.html (1347B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=1274159 5 --> 6 <head> 7 <title>Test HTMLConstructor for custom elements.</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 10 </head> 11 <body> 12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1274159">Bug 1274159</a> 13 <script type="text/javascript"> 14 function test_with_new_window(f) { 15 return new Promise((aResolve) => { 16 let iframe = document.createElement('iframe'); 17 iframe.setAttribute('type', 'content'); 18 iframe.setAttribute('src', 'dummy_page.html'); 19 iframe.onload = function() { 20 f(iframe.contentWindow); 21 aResolve(); 22 }; 23 document.body.appendChild(iframe); 24 }); 25 } 26 27 // Fake the Cu.waiveXrays, so that we can share the tests with mochitest chrome. 28 var Cu = { waiveXrays: (obj) => obj }; 29 var promises = []; 30 SimpleTest.waitForExplicitFinish(); 31 </script> 32 <!-- Test cases for autonomous element --> 33 <script type="text/javascript" src="htmlconstructor_autonomous_tests.js"></script> 34 <!-- Test cases for customized built-in element --> 35 <script type="text/javascript" src="htmlconstructor_builtin_tests.js"></script> 36 <script type="text/javascript"> 37 Promise.all(promises).then(() => { 38 SimpleTest.finish(); 39 }); 40 </script> 41 </body> 42 </html>