chromeHelpers.js (850B)
1 /** 2 * Any copyright is dedicated to the Public Domain. 3 * http://creativecommons.org/publicdomain/zero/1.0/ 4 */ 5 6 var { classes: Cc, interfaces: Ci, utils: Cu } = Components; 7 8 // testSteps is expected to be defined by the file including this file. 9 /* global testSteps */ 10 11 var testGenerator = testSteps(); 12 13 if (!window.runTest) { 14 window.runTest = function () { 15 SimpleTest.waitForExplicitFinish(); 16 17 testGenerator.next(); 18 }; 19 } 20 21 function finishTest() { 22 SimpleTest.executeSoon(function () { 23 testGenerator.return(); 24 SimpleTest.finish(); 25 }); 26 } 27 28 function grabEventAndContinueHandler(event) { 29 testGenerator.next(event); 30 } 31 32 function continueToNextStep() { 33 SimpleTest.executeSoon(function () { 34 testGenerator.next(); 35 }); 36 } 37 38 function errorHandler(event) { 39 throw new Error("indexedDB error, code " + event.target.error.name); 40 }