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