dom/workers/test/test_url_exceptions.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 URL exceptions in workers</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 <p id="display"></p>
    14 <div id="content" style="display: none"></div>
    15 <pre id="test"></pre>
    16 <script class="testbody" type="text/javascript">
    18   var worker = new Worker("url_exceptions_worker.js");
    20   worker.onmessage = function(event) {
    21     is(event.target, worker);
    23     if (event.data.type == 'finish') {
    24       SimpleTest.finish();
    25     } else if (event.data.type == 'status') {
    26       ok(event.data.status, event.data.msg);
    27     }
    28   };
    30   worker.onerror = function(event) {
    31     is(event.target, worker);
    32     ok(false, "Worker had an error: " + event.data);
    33     SimpleTest.finish();
    34   };
    36   worker.postMessage(0);
    37   SimpleTest.waitForExplicitFinish();
    39 </script>
    40 </pre>
    41 </body>
    42 </html>

mercurial