Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | * http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | function worker_handler(worker) { |
michael@0 | 5 | worker.onerror = function(error) { |
michael@0 | 6 | error.preventDefault(); |
michael@0 | 7 | ok(false, "error "+ error.message); |
michael@0 | 8 | }; |
michael@0 | 9 | worker.onmessage = function(msg) { |
michael@0 | 10 | // ok(true, "MAIN: onmessage " + JSON.stringify(msg.data)); |
michael@0 | 11 | switch (msg.data.kind) { |
michael@0 | 12 | case "is": |
michael@0 | 13 | SimpleTest.ok(msg.data.outcome, msg.data.description + |
michael@0 | 14 | "( "+ msg.data.a + " ==? " + msg.data.b + ")" ); |
michael@0 | 15 | return; |
michael@0 | 16 | case "isnot": |
michael@0 | 17 | SimpleTest.ok(msg.data.outcome, msg.data.description + |
michael@0 | 18 | "( "+ msg.data.a + " !=? " + msg.data.b + ")" ); |
michael@0 | 19 | return; |
michael@0 | 20 | case "ok": |
michael@0 | 21 | SimpleTest.ok(msg.data.condition, msg.data.description); |
michael@0 | 22 | return; |
michael@0 | 23 | case "info": |
michael@0 | 24 | SimpleTest.info(msg.data.description); |
michael@0 | 25 | return; |
michael@0 | 26 | case "finish": |
michael@0 | 27 | SimpleTest.finish(); |
michael@0 | 28 | return; |
michael@0 | 29 | default: |
michael@0 | 30 | SimpleTest.ok(false, "test_osfile.xul: wrong message " + JSON.stringify(msg.data)); |
michael@0 | 31 | return; |
michael@0 | 32 | } |
michael@0 | 33 | }; |
michael@0 | 34 | } |