tor-browser

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

test_bug1346936.html (2091B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=1346936
      5 -->
      6 <head>
      7  <title>Test for Bug 1346936</title>
      8  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
      9  <script type="application/javascript"  src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
     10  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
     11 </head>
     12 <body>
     13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1346936">Mozilla Bug 1346936</a>
     14 <style type="text/css">
     15 #link1 a { user-select:none; }
     16 </style>
     17 <div id="link1"><a href="http://www.mozilla.org/">link1</a></div>
     18 <div id="link2"><a href="http://www.mozilla.org/">link2</a></div>
     19 <p id="display"></p>
     20 <div id="content" style="display: none">
     21  
     22 </div>
     23 <pre id="test">
     24 <script type="application/javascript">
     25 
     26 /** Test for Bug 1346936 */
     27 
     28 const {addDebuggerToGlobal} = ChromeUtils.importESModule("resource://gre/modules/jsdebugger.sys.mjs");
     29 addDebuggerToGlobal(globalThis);
     30 
     31 window.onload = function() {
     32    SimpleTest.waitForExplicitFinish();
     33 
     34    var iframe = document.createElement("iframe");
     35    iframe.src = "http://mochi.test:8888/tests/dom/base/test/chrome/nochrome_bug1346936.html";
     36    iframe.onload = function() {
     37        var script = iframe.contentWindow.document.createElement("script");
     38        script.src = "http://mochi.test:8888/tests/dom/base/test/chrome/nochrome_bug1346936.js";
     39        script.onload = function() {
     40            var dbg = new Debugger(iframe.contentWindow);
     41            ok(dbg, "Should be able to create debugger");
     42 
     43            var scripts = dbg.findScripts({
     44                url: "http://mochi.test:8888/tests/dom/base/test/chrome/nochrome_bug1346936.js",
     45            });
     46            ok(scripts.length, "Should be able to find script");
     47 
     48            is(scripts[0].source.sourceMapURL, "foo.js.map");
     49            SimpleTest.finish();
     50        };
     51 
     52        iframe.contentWindow.document.body.appendChild(script);
     53    };
     54 
     55    document.body.appendChild(iframe);
     56 };
     57 
     58 </script>
     59 </pre>
     60 </body>
     61 </html>