dom/workers/test/test_rvals.html

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     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 bug 911085</title>
     9   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    10   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    11 </head>
    12 <body>
    13 <script class="testbody" type="text/javascript">
    15   var worker = new Worker("rvals_worker.js");
    17   worker.onmessage = function(event) {
    18     if (event.data == 'ignore') return;
    20     if (event.data == 'finished') {
    21       is(worker.terminate(), undefined, "Terminate() returns 'undefined'");
    22       SimpleTest.finish();
    23       return;
    24     }
    26     ok(event.data, "something good returns 'undefined' in workers");
    27   };
    29   is(worker.postMessage(42), undefined, "PostMessage() returns 'undefined' on main thread");
    30   SimpleTest.waitForExplicitFinish();
    32 </script>
    33 </pre>
    34 </body>
    35 </html>

mercurial