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: const { 'classes': Cc, 'interfaces': Ci, 'utils': Cu } = Components; michael@0: michael@0: let testGenerator = testSteps(); michael@0: michael@0: if (!window.runTest) { michael@0: window.runTest = function() michael@0: { michael@0: Cu.importGlobalProperties(["indexedDB"]); michael@0: michael@0: SimpleTest.waitForExplicitFinish(); michael@0: michael@0: testGenerator.next(); michael@0: } michael@0: } michael@0: michael@0: function finishTest() michael@0: { michael@0: SimpleTest.executeSoon(function() { michael@0: testGenerator.close(); michael@0: SimpleTest.finish(); michael@0: }); michael@0: } michael@0: michael@0: function grabEventAndContinueHandler(event) michael@0: { michael@0: testGenerator.send(event); michael@0: } michael@0: michael@0: function continueToNextStep() michael@0: { michael@0: SimpleTest.executeSoon(function() { michael@0: testGenerator.next(); michael@0: }); michael@0: } michael@0: michael@0: function errorHandler(event) michael@0: { michael@0: throw new Error("indexedDB error, code " + event.target.error.name); michael@0: }