tor-browser

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

test_bug1808352.html (848B)


      1 <!doctype html>
      2 <meta charset=utf-8>
      3 <title>Test for Bug 1808352</title>
      4 <script src="/tests/SimpleTest/SimpleTest.js"></script>
      5 <div id=log></div>
      6 <div id="testnode"></div>
      7 <script>
      8 function loadedFrame() {
      9    var node = document.getElementById("testnode");
     10    var frame = document.getElementById("frame");
     11    frame.contentWindow.document.adoptNode(node);
     12    document.adoptNode(node);
     13    var res;
     14    // Use a loop to ensure the JITs optimize the `id` getter access.
     15    for (var i = 0; i < 10_000; i++) {
     16        res = node.id;
     17    }
     18    is(res, "testnode", "expected node id");
     19    SimpleTest.finish();
     20 }
     21 SimpleTest.waitForExplicitFinish();
     22 document.domain = "mochi.test"; // We want a cross-compartment adoptNode.
     23 </script>
     24 <iframe id="frame" src="http://test1.mochi.test:8888/tests/dom/bindings/test/file_bug1808352_frame.html"></iframe>