summaryrefslogtreecommitdiffstats
path: root/dom/workers/test/WorkerTest.jsm
blob: 86431b7f89260f81fe717385ece5f6ce04c52613 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/**
 * Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/
 */
this.EXPORTED_SYMBOLS = [
  "WorkerTest"
];

this.WorkerTest = {
  go: function(message, messageCallback, errorCallback) {
    let worker = new ChromeWorker("WorkerTest_worker.js");
    worker.onmessage = messageCallback;
    worker.onerror = errorCallback;
    worker.postMessage(message);
    return worker;
  }
};