test_bug790732.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=790732
  5. -->
  6. <head>
  7. <meta charset="utf-8">
  8. <title>Test for Bug 790732</title>
  9. <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  10. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  11. <script type="application/javascript">
  12. // Basic stuff
  13. ok(Components, "Components shim exists!");
  14. var Ci = Components.interfaces;
  15. ok(Ci, "interfaces shim exists!");
  16. is(typeof Components.classes, 'undefined', "Shouldn't have a Cc");
  17. // Check each interface that we shim. We start by checking specific
  18. // constants for a couple of interfaces, and then once it's pretty clear that
  19. // it's working as intended we just check that the objects themselves are the
  20. // same.
  21. is(Ci.nsIXMLHttpRequest.HEADERS_RECEIVED, XMLHttpRequest.HEADERS_RECEIVED);
  22. is(Ci.nsIDOMDOMException.DATA_CLONE_ERR, DOMException.DATA_CLONE_ERR);
  23. is(Ci.nsIDOMNode.DOCUMENT_NODE, Node.DOCUMENT_NODE);
  24. is(Ci.nsIDOMCSSPrimitiveValue.CSS_PX, CSSPrimitiveValue.CSS_PX);
  25. is(Ci.nsIDOMCSSRule.NAMESPACE_RULE, CSSRule.NAMESPACE_RULE);
  26. is(Ci.nsIDOMCSSValue.CSS_PRIMITIVE_VALUE, CSSValue.CSS_PRIMITIVE_VALUE);
  27. is(Ci.nsIDOMEvent.FOCUS, Event.FOCUS);
  28. is(Ci.nsIDOMNSEvent.CLICK, Event.CLICK);
  29. is(Ci.nsIDOMKeyEvent, KeyEvent);
  30. is(Ci.nsIDOMMouseEvent, MouseEvent);
  31. is(Ci.nsIDOMMouseScrollEvent, MouseScrollEvent);
  32. is(Ci.nsIDOMMutationEvent, MutationEvent);
  33. is(Ci.nsIDOMSimpleGestureEvent, SimpleGestureEvent);
  34. is(Ci.nsIDOMUIEvent, UIEvent);
  35. is(Ci.nsIDOMHTMLMediaElement, HTMLMediaElement);
  36. is(Ci.nsIDOMOfflineResourceList, OfflineResourceList);
  37. is(Ci.nsIDOMRange, Range);
  38. is(Ci.nsIDOMSVGLength, SVGLength);
  39. is(Ci.nsIDOMNodeFilter, NodeFilter);
  40. is(Ci.nsIDOMXPathResult, XPathResult);
  41. // Test for Bug 895231
  42. for (var k of Object.keys(Components.interfaces)) {
  43. ok(SpecialPowers.Ci.hasOwnProperty(k),
  44. k + " should be removed from the Components shim");
  45. }
  46. </script>
  47. </head>
  48. <body>
  49. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=790732">Mozilla Bug 790732</a>
  50. <p id="display"></p>
  51. <div id="content" style="display: none">
  52. </div>
  53. <pre id="test">
  54. </pre>
  55. <iframe id="ifr"></iframe>
  56. </body>
  57. </html>