tor-browser

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

test_shadowroot_clonenode.html (1166B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=1429982
      5 -->
      6 <head>
      7  <title>Test for Bug 1429982</title>
      8  <script type="text/javascript" src="head.js"></script>
      9  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     10  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     11 </head>
     12 <body>
     13 <a target="_blank"
     14  href="https://bugzilla.mozilla.org/show_bug.cgi?id=1429982">Mozilla Bug 1429982</a>
     15 <p id="display"></p>
     16 <div id="content" style="display: none">
     17 
     18 </div>
     19 <pre id="test">
     20 <script class="testbody" type="text/javascript">
     21 
     22 /** Test for Bug 1429982 */
     23 SimpleTest.waitForExplicitFinish();
     24 createIframe()
     25  .then((aDocument) => {
     26    var element = aDocument.createElement("div");
     27    var shadowRoot = element.attachShadow({mode: "open"});
     28    var thrownException = false;
     29 
     30    try {
     31      shadowRoot.cloneNode();
     32    } catch(err) {
     33      thrownException = err;
     34    }
     35 
     36    ok(thrownException !== false, "An exception should've been thrown");
     37    is(thrownException.name, "NotSupportedError", "A NotSupportedError exception should've been thrown");
     38 
     39    SimpleTest.finish();
     40  });
     41 </script>
     42 </pre>
     43 </body>
     44 </html>