michael@0: /** michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: */ michael@0: michael@0: function ok(cond, msg) { michael@0: dump("ok(" + cond + ", \"" + msg + "\")"); michael@0: do_check_true(!!cond, Components.stack.caller); michael@0: } michael@0: michael@0: function finishTest() michael@0: { michael@0: do_execute_soon(function() { michael@0: do_test_finished(); michael@0: }); michael@0: } michael@0: michael@0: function run_test() { michael@0: const name = "Splendid Test"; michael@0: michael@0: Cu.importGlobalProperties(["indexedDB"]); michael@0: michael@0: do_test_pending(); michael@0: michael@0: let keyRange = IDBKeyRange.only(42); michael@0: ok(keyRange, "Got keyRange"); michael@0: michael@0: let request = indexedDB.open(name, 1); michael@0: request.onerror = function(event) { michael@0: ok(false, "indexedDB error, '" + event.target.error.name + "'"); michael@0: finishTest(); michael@0: } michael@0: request.onsuccess = function(event) { michael@0: let db = event.target.result; michael@0: ok(db, "Got database"); michael@0: finishTest(); michael@0: } michael@0: }