tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_custom_element_upgrade_chrome.html (1315B)


      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="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
      9  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/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 SimpleTest.waitForExplicitFinish();
     15 
     16 var promises = [];
     17 function test_with_new_window(f, msg) {
     18  promises.push(new Promise((aResolve) => {
     19    let iframe = document.createElement('iframe');
     20    iframe.setAttribute('type', 'content');
     21    iframe.setAttribute('src', 'http://example.org/chrome/dom/tests/mochitest/webcomponents/test_upgrade_page.html');
     22    iframe.onload = function() {
     23      try {
     24        // Use window from iframe to isolate the test.
     25        f(iframe.contentWindow, msg);
     26      } catch (e) {
     27        SimpleTest.ok(false, e);
     28      }
     29      aResolve();
     30    };
     31    document.body.appendChild(iframe);
     32  }));
     33 }
     34 </script>
     35 <!-- Test cases for autonomous element -->
     36 <script type="text/javascript" src="upgrade_tests.js"></script>
     37 <script>
     38 Promise.all(promises).then(() => {
     39  SimpleTest.finish();
     40 });
     41 </script>
     42 </body>
     43 </html>