chromeHelpers.js 757 B

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