test_globalObjects_other.xul 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?xml version="1.0"?>
  2. <?xml-stylesheet type="text/css" href="chrome://global/skin"?>
  3. <?xml-stylesheet type="text/css" href="/tests/SimpleTest/test.css"?>
  4. <!--
  5. Any copyright is dedicated to the Public Domain.
  6. http://creativecommons.org/publicdomain/zero/1.0/
  7. -->
  8. <window title="Mozilla Bug 832883"
  9. xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  10. onload="runTest();">
  11. <script type="application/javascript"
  12. src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
  13. <script type="application/javascript;version=1.7">
  14. <![CDATA[
  15. function testSteps() {
  16. // Test for IDBKeyRange and indexedDB availability in bootstrap files.
  17. let test = Cc["@mozilla.org/dom/indexeddb/GlobalObjectsComponent;1"].
  18. createInstance(Ci.nsISupports).wrappedJSObject;
  19. test.ok = ok;
  20. test.finishTest = continueToNextStep;
  21. test.runTest();
  22. yield undefined;
  23. Cu.import("resource://gre/modules/AddonManager.jsm");
  24. AddonManager.getAddonByID("indexedDB-test@mozilla.org",
  25. grabEventAndContinueHandler);
  26. let addon = yield undefined;
  27. addon.uninstall();
  28. Cu.import("resource://gre/modules/Services.jsm");
  29. for (var stage of [ "install", "startup", "shutdown", "uninstall" ]) {
  30. for (var symbol of [ "IDBKeyRange", "indexedDB" ]) {
  31. let pref = Services.prefs.getBoolPref("indexeddbtest.bootstrap." + stage +
  32. "." + symbol, false);
  33. ok(pref, "Symbol '" + symbol + "' present during '" + stage + "'");
  34. }
  35. }
  36. finishTest();
  37. yield undefined;
  38. }
  39. window.runTest = function() {
  40. SimpleTest.waitForExplicitFinish();
  41. testGenerator.next();
  42. }
  43. ]]>
  44. </script>
  45. <script type="text/javascript;version=1.7" src="chromeHelpers.js"></script>
  46. <body xmlns="http://www.w3.org/1999/xhtml">
  47. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=832883"
  48. target="_blank">Mozilla Bug 832883</a>
  49. </body>
  50. </window>