toolkit/components/workerloader/tests/utils_worker.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* Any copyright is dedicated to the Public Domain.
     2  * http://creativecommons.org/publicdomain/zero/1.0/ */
     4 function log(text) {
     5   dump("WORKER " + text + "\n");
     6 }
     8 function send(message) {
     9   self.postMessage(message);
    10 }
    12 function finish() {
    13   send({kind: "finish"});
    14 }
    16 function ok(condition, description) {
    17   send({kind: "ok", condition: !!condition, description: "" + description});
    18 }
    20 function is(a, b, description) {
    21   let outcome = a == b; // Need to decide outcome here, as not everything can be serialized
    22   send({kind: "is", outcome: outcome, description: "" + description, a: "" + a, b: "" + b});
    23 }
    25 function isnot(a, b, description) {
    26   let outcome = a != b; // Need to decide outcome here, as not everything can be serialized
    27   send({kind: "isnot", outcome: outcome, description: "" + description, a: "" + a, b: "" + b});
    28 }
    30 function info(description) {
    31   send({kind: "info", description: "" + description});
    32 }

mercurial