dom/tests/mochitest/general/test_interfaces.html
author Andrea Marchesini <amarchesini@mozilla.com>
Thu, 08 Nov 2012 15:57:17 +0000
changeset 114057 83b3764cce455cc1ffd99fe7abb24c7f4c235139
parent 113160 86aef70706f94982d178146c7e3851064af9846f
permissions -rw-r--r--
Bug 795930 - Hide ArchiveReader feature behind a pref (disabled by default). r=mounir, a=lsblakk

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=766694
-->
<head>
  <meta charset="utf-8">
  <title>Test for Bug 766694</title>
  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=766694">Mozilla Bug 766694</a>
<p id="display"></p>
<div id="content" style="display: none">
  
</div>
<pre id="test">
<script type="application/javascript">

/** Test for Bug 766694 **/

var interfaceNamesInGlobalScope =
  [
    "MozApplicationEvent",
    "HTMLByteRanges",
    "URL",
    "BatteryManager",
    "HTMLStyleElement",
    "PropertyNodeList",
    "SVGPatternElement",
    "LinkStyle",
    "IDBTransaction",
    "CSSMediaRule",
    "SVGFEMergeNodeElement",
    "HTMLUnknownElement",
    "SVGStylable",
    "MozContactChangeEvent",
    "ToString",
    "MozBrowserFrame",
    "UserDataHandler",
    "HTMLDirectoryElement",
    "SVGNumberList",
    "SVGMaskElement",
    "DeviceMotionEvent",
    "GetSVGDocument",
    "SVGAnimatedPreserveAspectRatio",
    "MozSmsRequest",
    "SVGViewElement",
    "HTMLTableSectionElement",
    "HTMLCollection",
    "HTMLProgressElement",
    "CRMFObject",
    "CSSStyleSheet",
    "UIEvent",
    "IDBOpenDBRequest",
    "XMLHttpRequest",
    "SVGTextPathElement",
    "StorageItem",
    "SVGPolygonElement",
    "MutationRecord",
    "TimeEvent",
    "HTMLElement",
    "HTMLOptionElement",
    "Pkcs11",
    "NotifyAudioAvailableEvent",
    "Array",
    "SVGZoomAndPan",
    "XULPopupElement",
    "MediaError",
    "DeviceStorageCursor",
    "DeviceStorageChangeEvent",
    "DeviceStorageStat",
    "PageTransitionEvent",
    "DataContainerEvent",
    "MozCSSKeyframesRule",
    "SVGAnimatedInteger",
    "TouchEvent",
    "OpenWindowEventDetail",
    "IDBIndex",
    "EventListener",
    "TransitionEvent",
    "XULContainerItemElement",
    "HTMLTableCaptionElement",
    "SVGRect",
    "IDBCursor",
    "History",
    "HTMLTableRowElement",
    "NodeFilter",
    "ClientRectList",
    "WebGLExtensionLoseContext",
    "CanvasRenderingContext2D",
    "SVGPathSegLinetoVerticalRel",
    "MozAlarmsManager",
    "MozPowerManager",
    "SVGElement",
    "GeoPositionError",
    "XPathEvaluator",
    "NodeIterator",
    "MozNavigatorNetwork",
    "CryptoDialogs",
    "SVGLocatable",
    "XULElement",
    "CSSRuleList",
    "SVGMarkerElement",
    "Rect",
    "SVGPathElement",
    "WebGLUniformLocation",
    "SVGUseElement",
    "SVGAnimatedPoints",
    "DeviceAcceleration",
    "DOMError",
    "SVGAnimateMotionElement",
    "HTMLMeterElement",
    "SmartCardEvent",
    "CSSValueList",
    "ValidityState",
    "HTMLAppletElement",
    "Touch",
    "Controllers",
    "AnimationEvent",
    "NavigatorDesktopNotification",
    "LoadStatus",
    "WebGLBuffer",
    "MediaQueryList",
    "Contact",
    "MediaQueryListListener",
    "DesktopNotificationCenter",
    "PluginArray",
    "XULSelectControlElement",
    "TimeRanges",
    "ImageData",
    "SVGPathSegArcAbs",
    "MimeTypeArray",
    "DocumentFragment",
    "ParserJS",
    "CanvasPattern",
    "GeoPosition",
    "XPathExpression",
    "BarProp",
    "NSEditableElement",
    "SVGRectElement",
    "DOMRequest",
    "WindowPerformance",
    "DOMSettableTokenList",
    "SVGTransformList",
    "SVGTransformable",
    "XULControlElement",
    "HTMLFrameSetElement",
    "CSSCharsetRule",
    "TouchList",
    "DOMStringList",
    "HTMLCommandElement",
    "FileList",
    "XULRelatedElement",
    "Blob",
    "Node",
    "HTMLEmbedElement",
    "ProgressEvent",
    "SVGAnimateElement",
    "MutationEvent",
    "TreeSelection",
    "DeviceLightEvent",
    "SVGCircleElement",
    "SVGFEComponentTransferElement",
    "SVGPathSeg",
    "SVGSVGElement",
    "GlobalPropertyInitializer",
    "HTMLMenuItemElement",
    "HTMLDataListElement",
    "XPathResult",
    "XMLDocument",
    "DocumentType",
    "NamedNodeMap",
    "DeviceProximityEvent",
    "XULLabeledControlElement",
    "MozWakeLock",
    "WebGLFramebuffer",
    "MozConnection",
    "WebGLRenderingContext",
    "JSON",
    "ClientRect",
    "GetUserMediaSuccessCallback",
    "CommandEvent",
    "HTMLDocument",
    "DeviceOrientationEvent",
    "HTMLPreElement",
    "StorageEvent",
    "CSS2Properties",
    "StorageIndexedDB",
    "XULDocument",
    "XULMultiSelectControlElement",
    "SVGTitleElement",
    "ContactProperties",
    "PerformanceTiming",
    "LSProgressEvent",
    "NSEvent",
    "HTMLBRElement",
    "MouseScrollEvent",
    "WheelEvent",
    "HashChangeEvent",
    "TreeWalker",
    "HTMLTitleElement",
    "LockedFile",
    "GetUserMediaErrorCallback",
    "SVGFEMorphologyElement",
    "SVGFETurbulenceElement",
    "XULTextBoxElement",
    "SVGDocument",
    "CSSStyleDeclaration",
    "SVGAltGlyphElement",
    "Screen",
    "FileReader",
    "SVGSwitchElement",
    "SVGPolylineElement",
    "SVGPathSegLinetoAbs",
    "NavigatorDeviceStorage",
    "HTMLOptionsCollection",
    "IDBKeyRange",
    "Parser",
    "HTMLDivElement",
    "HTMLLinkElement",
    "ClientInformation",
    "SVGMpathElement",
    "HTMLTextAreaElement",
    "SVGAnimatedEnumeration",
    "Attr",
    "StyleSheet",
    "HTMLBodyElement",
    "SVGPathSegCurvetoQuadraticSmoothRel",
    "HTMLHeadingElement",
    "Document",
    "FileHandle",
    "HTMLAnchorElement",
    "SVGZoomEvent",
    "UserProximityEvent",
    "SVGAnimateTransformElement",
    "CSSMozDocumentRule",
    "HTMLQuoteElement",
    "PopStateEvent",
    "IDBVersionChangeEvent",
    "HTMLCanvasElement",
    "MouseEvent",
    "OfflineResourceList",
    "ContactAddress",
    "Range",
    "MozCSSKeyframeRule",
    "SettingsLock",
    "Screen",
    "ImageDocument",
    "TextMetrics",
    "SVGScriptElement",
    "CDATASection",
    "CanvasGradient",
    "SVGViewSpec",
    "DOMException",
    "MozSmsMessage",
    "SVGFESpecularLightingElement",
    "StorageObsolete",
    "ContactManager",
    "NSXPathExpression",
    "SVGLineElement",
    "SVGPathSegArcRel",
    "WebGLExtension",
    "WebGLExtensionDepthTexture",
    "XSLTProcessor",
    "SVGPathSegLinetoVerticalAbs",
    "SVGPathSegLinetoRel",
    "HTMLImageElement",
    "MozSmsEvent",
    "CustomEvent",
    "XMLHttpRequestUpload",
    "SVGFEFuncBElement",
    "Text",
    "SVGPathSegCurvetoCubicRel",
    "DataTransfer",
    "SVGTSpanElement",
    "SVGRadialGradientElement",
    "SVGFEDisplacementMapElement",
    "SVGPathSegCurvetoCubicSmoothAbs",
    "CSSValue",
    "DesktopNotification",
    "KeyEvent",
    "HTMLAreaElement",
    "XULLabelElement",
    "FormData",
    "IDBDatabase",
    "CSSPrimitiveValue",
    "SVGStopElement",
    "WebGLExtensionCompressedTextureS3TC",
    "WebGLExtensionCompressedTextureATC",
    "WebGLExtensionCompressedTexturePVRTC",
    "XULCommandEvent",
    "HTMLMediaElement",
    "SVGPathSegLinetoHorizontalAbs",
    "SVGAnimatedRect",
    "SVGTextContentElement",
    "WebGLRenderbuffer",
    "TreeColumn",
    "WebGLExtensionStandardDerivatives",
    "WebGLShaderPrecisionFormat",
    "XPathNamespace",
    "FontFace",
    "SVGPathSegCurvetoCubicSmoothRel",
    "HTMLMapElement",
    "SVGImageElement",
    "HTMLMetaElement",
    "NotifyPaintEvent",
    "XULTreeElement",
    "DragEvent",
    "IDBObjectStore",
    "NodeSelector",
    "NavigatorUserMedia",
    "TreeContentView",
    "MimeType",
    "SVGForeignObjectElement",
    "MozMobileNetworkInfo",
    "SVGAnimatedString",
    "HTMLPropertiesCollection",
    "WindowInternal",
    "Serializer",
    "SVGFEFuncGElement",
    "XULCheckboxElement",
    "SVGFEPointLightElement",
    "ModalContentWindow",
    "Crypto",
    "StorageManager",
    "SVGAngle",
    "Navigator",
    "SVGPathSegCurvetoQuadraticSmoothAbs",
    "HTMLButtonElement",
    "WebGLProgram",
    "SVGPointList",
    "SVGFEColorMatrixElement",
    "USSDReceivedEvent",
    "SettingsManager",
    "DeviceRotationRate",
    "HTMLAudioElement",
    "WebGLTexture",
    "SVGFEDistantLightElement",
    "HTMLOListElement",
    "ProcessingInstruction",
    "CSSUnknownRule",
    "SVGComponentTransferFunctionElement",
    "SVGEvent",
    "SVGPathSegLinetoHorizontalRel",
    "SVGAnimatedNumber",
    "HTMLHtmlElement",
    "MozSmsManager",
    "MozSmsFilter",
    "SVGFETileElement",
    "MozMobileConnectionInfo",
    "CSSRule",
    "HTMLSelectElement",
    "MessageEvent",
    "SVGFEImageElement",
    "MozURLProperty",
    "DeviceStorage",
    "SVGFEOffsetElement",
    "DOMImplementation",
    "SVGFECompositeElement",
    "MediaList",
    "HTMLFrameElement",
    "NodeList",
    "SVGPathSegCurvetoQuadraticRel",
    "IDBFactory",
    "SVGFilterPrimitiveStandardAttributes",
    "CSSImportRule",
    "SVGPathSegClosePath",
    "HTMLTableCellElement",
    "WindowUtils",
    "SVGAnimatedNumberList",
    "WindowCollection",
    "WebGLExtensionTextureFilterAnisotropic",
    "SVGPathSegMovetoRel",
    "ChromeWindow",
    "Comment",
    "HTMLSourceElement",
    "SVGStringList",
    "Storage",
    "HTMLModElement",
    "PaintRequest",
    "XPathNSResolver",
    "XULDescriptionElement",
    "SVGLinearGradientElement",
    "JSWindow",
    "SVGGElement",
    "BoxObject",
    "SVGFEBlendElement",
    "Event",
    "File",
    "HTMLOptGroupElement",
    "SVGAnimatedLengthList",
    "SVGAnimatedTransformList",
    "MozTouchEvent",
    "MozWakeLockListener",
    "Selection",
    "XULTreeBuilder",
    "ScrollAreaEvent",
    "SVGStyleElement",
    "XULContainerElement",
    "DOMTokenList",
    "HTMLHRElement",
    "HTMLFontElement",
    "SVGFEFloodElement",
    "HTMLDListElement",
    "SVGSymbolElement",
    "SVGLengthList",
    "TreeColumns",
    "PaintRequestList",
    "SVGTextElement",
    "SimpleGestureEvent",
    "SVGMatrix",
    "HTMLUListElement",
    "SVGFEConvolveMatrixElement",
    "SVGAnimationElement",
    "SVGMetadataElement",
    "EventListenerInfo",
    "CSSStyleRule",
    "IDBRequest",
    "Performance",
    "XULMenuListElement",
    "SVGTransform",
    "SVGTextPositioningElement",
    "ContactFindOptions",
    "SVGFEMergeElement",
    "FileRequest",
    "SVGDefsElement",
    "Element",
    "HTMLBaseElement",
    "WebGLShader",
    "GeoPositionErrorCallback",
    "HTMLVideoElement",
    "MozSettingsEvent",
    "SVGAnimatedPathData",
    "SVGUnitTypes",
    "SVGTests",
    "RGBColor",
    "HTMLLabelElement",
    "MozSmsCursor",
    "EventSource",
    "MozNavigatorSms",
    "SVGSetElement",
    "GlobalObjectConstructor",
    "SVGAnimatedBoolean",
    "HTMLTableElement",
    "Window",
    "SVGNumber",
    "XULImageElement",
    "Plugin",
    "SVGAnimatedLength",
    "FontFaceList",
    "EventTarget",
    "SVGFEFuncRElement",
    "SVGPathSegMovetoAbs",
    "SVGPoint",
    "GeoPositionCoords",
    "HTMLIFrameElement",
    "PerformanceNavigation",
    "MediaStream",
    "DOMStringMap",
    "HTMLFieldSetElement",
    "SVGFEDiffuseLightingElement",
    "StyleSheetList",
    "ElementCSSInlineStyle",
    "HTMLInputElement",
    "CharacterData",
    "HTMLObjectElement",
    "SVGURIReference",
    "GeoGeolocation",
    "HTMLParamElement",
    "HTMLTableColElement",
    "MozBlobBuilder",
    "SVGFESpotLightElement",
    "PopupBlockedEvent",
    "XULButtonElement",
    "CSSPageRule",
    "Location",
    "DocumentXBL",
    "HTMLHeadElement",
    "XULTemplateBuilder",
    "GeoPositionCallback",
    "XULCommandDispatcher",
    "DocumentTouch",
    "XULSelectControlItemElement",
    "SVGPathSegCurvetoQuadraticAbs",
    "MutationObserver",
    "RequestService",
    "Counter",
    "SVGAnimatedAngle",
    "SVGPathSegList",
    "SVGFEFuncAElement",
    "WebSocket",
    "ElementTimeControl",
    "HTMLLegendElement",
    "SVGFEGaussianBlurElement",
    "SVGEllipseElement",
    "SVGDescElement",
    "BeforeUnloadEvent",
    "NSRGBAColor",
    "MozBrowserFrame",
    "SVGPreserveAspectRatio",
    "HTMLMenuElement",
    "CloseEvent",
    "IDBCursorWithValue",
    "CSSFontFaceRule",
    "XMLHttpRequestEventTarget",
    "CompositionEvent",
    "HTMLOutputElement",
    "HTMLFormElement",
    "SVGLength",
    "SVGFilterElement",
    "HTMLScriptElement",
    "SVGPathSegCurvetoCubicAbs",
    "HTMLLIElement",
    "SVGClipPathElement",
    "NavigatorGeolocation",
    "HTMLParagraphElement",
    "EventTarget",
    "File",
    "WebGLActiveInfo",
    "SVGGradientElement",
    "ContactTelField",
    "ContactField",
    "SVGFitToViewBox",
    "SVGAElement",
    "NavigatorCamera",
    "CameraControl",
    "CameraCapabilities",
    "CameraManager",
    "CSSSupportsRule",
    "MozMobileCellInfo",
    "MozCanvasPrintState",
    "TCPSocket",
    "MozTimeManager",
    "MozNavigatorTime",
    "PermissionSettings",
    "DataErrorEvent",
    "DataChannel",
    "MozNetworkStatsManager",
    "MozNetworkStats",
    "MozNetworkStatsData",
    "RTCSessionDescription",
    "RTCIceCandidate",
    "RTCPeerConnection"
  ]

for (var i in SpecialPowers.Components.interfaces) {
  var s = i.toString();
  var name = null;
  if (s.indexOf("nsIDOM") == 0) {
    name = s.substring("nsIDOM".length);
  } else if (s.indexOf("nsI") == 0) {
    name = s.substring("nsI".length);
  } 
  if (name && (name in window)) {
    ok(interfaceNamesInGlobalScope.indexOf(name) >= 0,
       "Unexpected interface name in global scope: " + name);
  }
}

</script>
</pre>
</body>
</html>