Bug 766694 - Add a test to check existence of each interface in the window scope, r=bz

--HG--
extra : rebase_source : a387c891b56ff48cb01601cd415c7ac85f7d3cea
This commit is contained in:
Olli Pettay 2012-06-23 15:42:32 +03:00
parent 93c588cdf7
commit c7d9142e33
2 changed files with 544 additions and 0 deletions

View File

@ -46,6 +46,7 @@ _TEST_FILES = \
file_clonewrapper.html \
file_moving_nodeList.html \
test_performance_now.html \
test_interfaces.html \
$(NULL)
_CHROME_FILES = \

View File

@ -0,0 +1,543 @@
<!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",
"MozBatteryManager",
"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",
"PageTransitionEvent",
"DataContainerEvent",
"MozCSSKeyframesRule",
"SVGAnimatedInteger",
"TouchEvent",
"OpenWindowEventDetail",
"IDBIndex",
"EventListener",
"TransitionEvent",
"XULContainerItemElement",
"HTMLTableCaptionElement",
"SVGRect",
"IDBCursor",
"History",
"HTMLTableRowElement",
"NodeFilter",
"ClientRectList",
"WebGLExtensionLoseContext",
"CanvasRenderingContext2D",
"SVGPathSegLinetoVerticalRel",
"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",
"MozMobileConnection",
"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",
"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",
"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",
"XULCommandEvent",
"HTMLMediaElement",
"SVGPathSegLinetoHorizontalAbs",
"SVGAnimatedRect",
"SVGTextContentElement",
"SyncMessageSender",
"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",
"MozNavigatorBattery",
"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",
"FrameMessageManager",
"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",
"ContentFrameMessageManager",
"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",
"ContactTelephone",
"SVGFitToViewBox",
"SVGAElement"
]
for (var i in 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>