toolkit/components/workerloader/tests/utils_worker.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:7bea683e3f74
1 /* Any copyright is dedicated to the Public Domain.
2 * http://creativecommons.org/publicdomain/zero/1.0/ */
3
4 function log(text) {
5 dump("WORKER " + text + "\n");
6 }
7
8 function send(message) {
9 self.postMessage(message);
10 }
11
12 function finish() {
13 send({kind: "finish"});
14 }
15
16 function ok(condition, description) {
17 send({kind: "ok", condition: !!condition, description: "" + description});
18 }
19
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 }
24
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 }
29
30 function info(description) {
31 send({kind: "info", description: "" + description});
32 }

mercurial