dom/workers/test/test_chromeWorker.xul

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 <?xml version="1.0"?>
     2 <!--
     3   Any copyright is dedicated to the Public Domain.
     4   http://creativecommons.org/publicdomain/zero/1.0/
     5 -->
     6 <window title="DOM Worker Threads Test"
     7         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     8         onload="test();">
    10   <script type="application/javascript"
    11           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
    12   <script type="application/javascript"
    13           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
    14   <script type="application/javascript" src="dom_worker_helper.js"/>
    16   <script type="application/javascript">
    17   <![CDATA[
    19     function test()
    20     {
    21       waitForWorkerFinish();
    23       var worker = new ChromeWorker("chromeWorker_worker.js");
    24       worker.onmessage = function(event) {
    25         is(event.data, "Done!", "Wrong message!");
    26         finish();
    27       }
    28       worker.onerror = function(event) {
    29         ok(false, "Worker had an error: " + event.message);
    30         worker.terminate();
    31         finish();
    32       }
    33       worker.postMessage("go");
    34     }
    36   ]]>
    37   </script>
    39   <body xmlns="http://www.w3.org/1999/xhtml">
    40     <p id="display"></p>
    41     <div id="content" style="display:none;"></div>
    42     <pre id="test"></pre>
    43   </body>
    44   <label id="test-result"/>
    45 </window>

mercurial