dom/workers/test/test_rvals.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/workers/test/test_rvals.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,37 @@
     1.4 +<!--
     1.5 +  Any copyright is dedicated to the Public Domain.
     1.6 +  http://creativecommons.org/publicdomain/zero/1.0/
     1.7 +-->
     1.8 +<!DOCTYPE HTML>
     1.9 +<html>
    1.10 +<head>
    1.11 +  <title>Test for bug 911085</title>
    1.12 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.13 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    1.14 +</head>
    1.15 +<body>
    1.16 +<script class="testbody" type="text/javascript">
    1.17 +
    1.18 +  var worker = new Worker("rvals_worker.js");
    1.19 +
    1.20 +  worker.onmessage = function(event) {
    1.21 +    if (event.data == 'ignore') return;
    1.22 +
    1.23 +    if (event.data == 'finished') {
    1.24 +      is(worker.terminate(), undefined, "Terminate() returns 'undefined'");
    1.25 +      SimpleTest.finish();
    1.26 +      return;
    1.27 +    }
    1.28 +
    1.29 +    ok(event.data, "something good returns 'undefined' in workers");
    1.30 +  };
    1.31 +
    1.32 +  is(worker.postMessage(42), undefined, "PostMessage() returns 'undefined' on main thread");
    1.33 +  SimpleTest.waitForExplicitFinish();
    1.34 +
    1.35 +</script>
    1.36 +</pre>
    1.37 +</body>
    1.38 +</html>
    1.39 +
    1.40 +

mercurial