Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
michael@0 | 1 | /** |
michael@0 | 2 | * Any copyright is dedicated to the Public Domain. |
michael@0 | 3 | * http://creativecommons.org/publicdomain/zero/1.0/ |
michael@0 | 4 | */ |
michael@0 | 5 | |
michael@0 | 6 | const { 'classes': Cc, 'interfaces': Ci, 'utils': Cu } = Components; |
michael@0 | 7 | |
michael@0 | 8 | let testGenerator = testSteps(); |
michael@0 | 9 | |
michael@0 | 10 | if (!window.runTest) { |
michael@0 | 11 | window.runTest = function() |
michael@0 | 12 | { |
michael@0 | 13 | Cu.importGlobalProperties(["indexedDB"]); |
michael@0 | 14 | |
michael@0 | 15 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 16 | |
michael@0 | 17 | testGenerator.next(); |
michael@0 | 18 | } |
michael@0 | 19 | } |
michael@0 | 20 | |
michael@0 | 21 | function finishTest() |
michael@0 | 22 | { |
michael@0 | 23 | SimpleTest.executeSoon(function() { |
michael@0 | 24 | testGenerator.close(); |
michael@0 | 25 | SimpleTest.finish(); |
michael@0 | 26 | }); |
michael@0 | 27 | } |
michael@0 | 28 | |
michael@0 | 29 | function grabEventAndContinueHandler(event) |
michael@0 | 30 | { |
michael@0 | 31 | testGenerator.send(event); |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 34 | function continueToNextStep() |
michael@0 | 35 | { |
michael@0 | 36 | SimpleTest.executeSoon(function() { |
michael@0 | 37 | testGenerator.next(); |
michael@0 | 38 | }); |
michael@0 | 39 | } |
michael@0 | 40 | |
michael@0 | 41 | function errorHandler(event) |
michael@0 | 42 | { |
michael@0 | 43 | throw new Error("indexedDB error, code " + event.target.error.name); |
michael@0 | 44 | } |