tor-browser

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

test_contentWorker.html (1091B)


      1 <!--
      2  Any copyright is dedicated to the Public Domain.
      3  http://creativecommons.org/publicdomain/zero/1.0/
      4 -->
      5 <!DOCTYPE HTML>
      6 <html>
      7 <head>
      8  <title>Test for DOM Worker privileged properties</title>
      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 <p id="display"></p>
     14 <div id="content" style="display: none">
     15 
     16 </div>
     17 <pre id="test">
     18 <script class="testbody" language="javascript">
     19 
     20  var workerFilename = "content_worker.js";
     21  var worker = new Worker(workerFilename);
     22 
     23  var props = {
     24    'ctypes': 1,
     25    'OS': 1
     26  };
     27 
     28  worker.onmessage = function(event) {
     29    if (event.data.testfinished) {
     30      SimpleTest.finish();
     31      return;
     32    }
     33    var prop = event.data.prop;
     34    ok(prop in props, "checking " + prop);
     35    is(event.data.value, undefined, prop + " should be undefined");
     36  };
     37 
     38  worker.onerror = function(event) {
     39    ok(false, "Worker had an error: " + event.message);
     40    SimpleTest.finish();
     41  }
     42 
     43  SimpleTest.waitForExplicitFinish();
     44 
     45 </script>
     46 </pre>
     47 </body>
     48 </html>