test_custom_element_upgrade.html (1248B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=1299363 5 --> 6 <head> 7 <title>Test upgrade steps 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=1299363">Bug 1299363</a> 13 <script type="text/javascript"> 14 // Fake the Cu.waiveXrays, so that we can share the tests with mochitest chrome. 15 var Cu = { waiveXrays: (obj) => obj }; 16 SimpleTest.waitForExplicitFinish(); 17 18 var promises = []; 19 function test_with_new_window(f, msg) { 20 promises.push(new Promise((aResolve) => { 21 let iframe = document.createElement('iframe'); 22 iframe.setAttribute('type', 'content'); 23 iframe.setAttribute('src', 'test_upgrade_page.html'); 24 iframe.onload = function() { 25 // Use window from iframe to isolate the test. 26 f(iframe.contentWindow, msg); 27 aResolve(); 28 }; 29 document.body.appendChild(iframe); 30 })); 31 } 32 </script> 33 <!-- Test cases for autonomous element --> 34 <script type="text/javascript" src="upgrade_tests.js"></script> 35 <script> 36 Promise.all(promises).then(() => { 37 SimpleTest.finish(); 38 }); 39 </script> 40 </body> 41 </html>