1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/components/sqlite/tests/xpcshell/data/worker_sqlite_shared.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,39 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + * http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +function send(message) { 1.8 + self.postMessage(message); 1.9 +} 1.10 + 1.11 +function do_test_complete() { 1.12 + send({kind: "do_test_complete", args: []}); 1.13 +} 1.14 + 1.15 +function do_check_true(x) { 1.16 + send({kind: "do_check_true", args: [!!x]}); 1.17 + if (x) { 1.18 + dump("TEST-PASS: " + x + "\n"); 1.19 + } else { 1.20 + throw new Error("do_check_true failed"); 1.21 + } 1.22 +} 1.23 + 1.24 +function do_check_eq(a, b) { 1.25 + let result = a == b; 1.26 + send({kind: "do_check_true", args: [result]}); 1.27 + if (!result) { 1.28 + throw new Error("do_check_eq failed " + a + " != " + b); 1.29 + } 1.30 +} 1.31 + 1.32 +function do_check_neq(a, b) { 1.33 + let result = a != b; 1.34 + send({kind: "do_check_true", args: [result]}); 1.35 + if (!result) { 1.36 + throw new Error("do_check_neq failed " + a + " == " + b); 1.37 + } 1.38 +} 1.39 + 1.40 +function do_print(x) { 1.41 + dump("TEST-INFO: " + x + "\n"); 1.42 +}