dom/workers/test/test_newError.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <!--
     2   Any copyright is dedicated to the Public Domain.
     3   http://creativecommons.org/publicdomain/zero/1.0/
     4 -->
     5 <html>
     6 <head>
     7   <title>Test for DOM Worker Threads</title>
     8   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    10 </head>
    11 <body>
    12 <pre id="test">
    13 <script class="testbody" type="text/javascript">
    15   var worker = new Worker("newError_worker.js");
    17   worker.onmessage = function(event) {
    18     ok(false, "Shouldn't get a message!");
    19     SimpleTest.finish();
    20   }
    22   worker.onerror = function(event) {
    23     is(event.message, "Error: foo!", "Got wrong error message!");
    24     event.preventDefault();
    25     SimpleTest.finish();
    26   }
    28   SimpleTest.waitForExplicitFinish();
    30 </script>
    31 </pre>
    32 </body>
    33 </html>

mercurial