dom/indexedDB/test/chromeHelpers.js

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:878dce0fcf6c
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 }

mercurial