GlobalObjectsChild.js (824B)
1 /** 2 * Any copyright is dedicated to the Public Domain. 3 * http://creativecommons.org/publicdomain/zero/1.0/ 4 */ 5 6 /* import-globals-from xpcshell-head-parent-process.js */ 7 8 function ok(cond, msg) { 9 dump("ok(" + cond + ', "' + msg + '")'); 10 Assert.ok(!!cond, Components.stack.caller); 11 } 12 13 function finishTest() { 14 executeSoon(function () { 15 do_test_finished(); 16 }); 17 } 18 19 function run_test() { 20 const name = "Splendid Test"; 21 22 do_test_pending(); 23 24 let keyRange = IDBKeyRange.only(42); 25 ok(keyRange, "Got keyRange"); 26 27 let request = indexedDB.open(name, 1); 28 request.onerror = function (event) { 29 ok(false, "indexedDB error, '" + event.target.error.name + "'"); 30 finishTest(); 31 }; 32 request.onsuccess = function (event) { 33 let db = event.target.result; 34 ok(db, "Got database"); 35 finishTest(); 36 }; 37 }