Skip to content
Permalink
Browse files
2010-07-19 Kent Hansen <kent.hansen@nokia.com>
        Reviewed by Sam Weinig.

        Improve coverage of fast/dom/Window/window-properties test
        https://bugs.webkit.org/show_bug.cgi?id=42258

        Use Object.getOwnPropertyNames to cover ECMA properties
        and other native properties.

        * fast/dom/Window/window-properties-expected.txt:
        * fast/dom/Window/window-properties.html:
        * platform/gtk/fast/dom/Window/window-properties-expected.txt:
        * platform/qt/fast/dom/Window/window-properties-expected.txt:

Canonical link: https://commits.webkit.org/54485@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@63645 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Kent Hansen committed Jul 19, 2010
1 parent 0211622 commit 938264baed4664c51cbc5dfbec11019a46b5f840
@@ -1,3 +1,18 @@
2010-07-19 Kent Hansen <kent.hansen@nokia.com>

Reviewed by Sam Weinig.

Improve coverage of fast/dom/Window/window-properties test
https://bugs.webkit.org/show_bug.cgi?id=42258

Use Object.getOwnPropertyNames to cover ECMA properties
and other native properties.

* fast/dom/Window/window-properties-expected.txt:
* fast/dom/Window/window-properties.html:
* platform/gtk/fast/dom/Window/window-properties-expected.txt:
* platform/qt/fast/dom/Window/window-properties-expected.txt:

2010-07-18 Maciej Stachowiak <mjs@apple.com>

Reviewed by Sam Weinig.
@@ -1,6 +1,7 @@
This test dumps all of the properties that are reachable from the window object, along with their types.

window [object DOMWindow]
window.Array [function]
window.Attr [object AttrConstructor]
window.Attr.prototype [object AttrPrototype]
window.Attr.prototype.ATTRIBUTE_NODE [number]
@@ -40,6 +41,7 @@ window.Attr.prototype.removeChild [function]
window.Attr.prototype.removeEventListener [function]
window.Attr.prototype.replaceChild [function]
window.Audio [object AudioConstructor]
window.Audio.length [number]
window.Audio.prototype [object HTMLAudioElementPrototype]
window.Audio.prototype.ATTRIBUTE_NODE [number]
window.Audio.prototype.CDATA_SECTION_NODE [number]
@@ -154,6 +156,7 @@ window.BlobBuilder [object BlobBuilderConstructor]
window.BlobBuilder.prototype [object BlobBuilderPrototype]
window.BlobBuilder.prototype.append [function]
window.BlobBuilder.prototype.getBlob [function]
window.Boolean [function]
window.CDATASection [object CDATASectionConstructor]
window.CDATASection.prototype [object CDATASectionPrototype]
window.CDATASection.prototype.ATTRIBUTE_NODE [number]
@@ -544,6 +547,7 @@ window.DOMException.prototype.TYPE_MISMATCH_ERR [number]
window.DOMException.prototype.URL_MISMATCH_ERR [number]
window.DOMException.prototype.VALIDATION_ERR [number]
window.DOMException.prototype.WRONG_DOCUMENT_ERR [number]
window.DOMException.prototype.toString [function]
window.DOMImplementation [object DOMImplementationConstructor]
window.DOMImplementation.prototype [object DOMImplementationPrototype]
window.DOMImplementation.prototype.createCSSStyleSheet [function]
@@ -560,6 +564,7 @@ window.DOMStringList.prototype.contains [function]
window.DOMStringList.prototype.item [function]
window.DOMStringMap [object DOMStringMapConstructor]
window.DOMStringMap.prototype [object DOMStringMapPrototype]
window.Date [function]
window.Document [object DocumentConstructor]
window.Document.prototype [object DocumentPrototype]
window.Document.prototype.ATTRIBUTE_NODE [number]
@@ -855,6 +860,7 @@ window.EntityReference.prototype.normalize [function]
window.EntityReference.prototype.removeChild [function]
window.EntityReference.prototype.removeEventListener [function]
window.EntityReference.prototype.replaceChild [function]
window.Error [function]
window.EvalError [function]
window.Event [object EventConstructor]
window.Event.AT_TARGET [number]
@@ -904,10 +910,12 @@ window.EventException [object EventExceptionConstructor]
window.EventException.UNSPECIFIED_EVENT_TYPE_ERR [number]
window.EventException.prototype [object EventExceptionPrototype]
window.EventException.prototype.UNSPECIFIED_EVENT_TYPE_ERR [number]
window.EventException.prototype.toString [function]
window.EventSource [object EventSourceConstructor]
window.EventSource.CLOSED [number]
window.EventSource.CONNECTING [number]
window.EventSource.OPEN [number]
window.EventSource.length [number]
window.EventSource.prototype [object EventSourcePrototype]
window.EventSource.prototype.CLOSED [number]
window.EventSource.prototype.CONNECTING [number]
@@ -924,6 +932,7 @@ window.FileList.prototype.item [function]
window.FormData [object FormDataConstructor]
window.FormData.prototype [object FormDataPrototype]
window.FormData.prototype.append [function]
window.Function [function]
window.HTMLAllCollection [object HTMLAllCollectionConstructor]
window.HTMLAllCollection.prototype [object HTMLAllCollectionPrototype]
window.HTMLAllCollection.prototype.item [function]
@@ -1073,8 +1082,39 @@ window.Image [object ImageConstructor]
window.Image.prototype [printed above as window.Element.prototype]
window.ImageData [object ImageDataConstructor]
window.ImageData.prototype [object ImageDataPrototype]
window.Infinity [number]
window.JSON [object JSON]
window.JSON.parse [function]
window.JSON.stringify [function]
window.KeyboardEvent [object KeyboardEventConstructor]
window.KeyboardEvent.prototype [printed above as window.Event.prototype]
window.Math [object Math]
window.Math.E [number]
window.Math.LN10 [number]
window.Math.LN2 [number]
window.Math.LOG10E [number]
window.Math.LOG2E [number]
window.Math.PI [number]
window.Math.SQRT1_2 [number]
window.Math.SQRT2 [number]
window.Math.abs [function]
window.Math.acos [function]
window.Math.asin [function]
window.Math.atan [function]
window.Math.atan2 [function]
window.Math.ceil [function]
window.Math.cos [function]
window.Math.exp [function]
window.Math.floor [function]
window.Math.log [function]
window.Math.max [function]
window.Math.min [function]
window.Math.pow [function]
window.Math.random [function]
window.Math.round [function]
window.Math.sin [function]
window.Math.sqrt [function]
window.Math.tan [function]
window.MediaError [object MediaErrorConstructor]
window.MediaError.MEDIA_ERR_ABORTED [number]
window.MediaError.MEDIA_ERR_DECODE [number]
@@ -1115,6 +1155,7 @@ window.MutationEvent.ADDITION [number]
window.MutationEvent.MODIFICATION [number]
window.MutationEvent.REMOVAL [number]
window.MutationEvent.prototype [printed above as window.Event.prototype]
window.NaN [number]
window.NamedNodeMap [object NamedNodeMapConstructor]
window.NamedNodeMap.prototype [object NamedNodeMapPrototype]
window.NamedNodeMap.prototype.getNamedItem [function]
@@ -1220,7 +1261,10 @@ window.NodeList.prototype [object NodeListPrototype]
window.NodeList.prototype.item [function]
window.Notation [object NotationConstructor]
window.Notation.prototype [printed above as window.Node.prototype]
window.Number [function]
window.Object [function]
window.Option [object OptionConstructor]
window.Option.length [number]
window.Option.prototype [printed above as window.Element.prototype]
window.OverflowEvent [object OverflowEventConstructor]
window.OverflowEvent.BOTH [number]
@@ -1295,9 +1339,11 @@ window.RangeException.INVALID_NODE_TYPE_ERR [number]
window.RangeException.prototype [object RangeExceptionPrototype]
window.RangeException.prototype.BAD_BOUNDARYPOINTS_ERR [number]
window.RangeException.prototype.INVALID_NODE_TYPE_ERR [number]
window.RangeException.prototype.toString [function]
window.Rect [object RectConstructor]
window.Rect.prototype [object RectPrototype]
window.ReferenceError [function]
window.RegExp [function]
window.SQLException [object SQLExceptionConstructor]
window.SQLException.CONSTRAINT_ERR [number]
window.SQLException.DATABASE_ERR [number]
@@ -1410,6 +1456,7 @@ window.SVGException.prototype [object SVGExceptionPrototype]
window.SVGException.prototype.SVG_INVALID_VALUE_ERR [number]
window.SVGException.prototype.SVG_MATRIX_NOT_INVERTABLE [number]
window.SVGException.prototype.SVG_WRONG_TYPE_ERR [number]
window.SVGException.prototype.toString [function]
window.SVGFEBlendElement [object SVGFEBlendElementConstructor]
window.SVGFEBlendElement.SVG_FEBLEND_MODE_DARKEN [number]
window.SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN [number]
@@ -1874,14 +1921,21 @@ window.SVGViewElement.prototype [printed above as window.Element.prototype]
window.SVGZoomEvent [object SVGZoomEventConstructor]
window.SVGZoomEvent.prototype [printed above as window.Event.prototype]
window.SharedWorker [object SharedWorkerConstructor]
window.SharedWorker.length [number]
window.SharedWorker.prototype [object SharedWorkerPrototype]
window.SharedWorker.prototype.addEventListener [function]
window.SharedWorker.prototype.dispatchEvent [function]
window.SharedWorker.prototype.removeEventListener [function]
window.Storage [object StorageConstructor]
window.Storage.prototype [object StoragePrototype]
window.Storage.prototype.clear [function]
window.Storage.prototype.getItem [function]
window.Storage.prototype.key [function]
window.Storage.prototype.removeItem [function]
window.Storage.prototype.setItem [function]
window.StorageEvent [object StorageEventConstructor]
window.StorageEvent.prototype [printed above as window.Event.prototype]
window.String [function]
window.StyleSheet [object StyleSheetConstructor]
window.StyleSheet.prototype [object StyleSheetPrototype]
window.StyleSheetList [object StyleSheetListConstructor]
@@ -1909,13 +1963,15 @@ window.WebKitCSSKeyframeRule.prototype [printed above as window.CSSRule.prototyp
window.WebKitCSSKeyframesRule [object WebKitCSSKeyframesRuleConstructor]
window.WebKitCSSKeyframesRule.prototype [printed above as window.CSSRule.prototype]
window.WebKitCSSMatrix [object WebKitCSSMatrixConstructor]
window.WebKitCSSMatrix.length [number]
window.WebKitCSSMatrix.prototype [object WebKitCSSMatrixPrototype]
window.WebKitCSSMatrix.prototype.inverse [function]
window.WebKitCSSMatrix.prototype.multiply [function]
window.WebKitCSSMatrix.prototype.rotate [function]
window.WebKitCSSMatrix.prototype.rotateAxisAngle [function]
window.WebKitCSSMatrix.prototype.scale [function]
window.WebKitCSSMatrix.prototype.setMatrixValue [function]
window.WebKitCSSMatrix.prototype.toString [function]
window.WebKitCSSMatrix.prototype.translate [function]
window.WebKitCSSTransformValue [object WebKitCSSTransformValueConstructor]
window.WebKitCSSTransformValue.CSS_MATRIX [number]
@@ -1941,13 +1997,15 @@ window.WebKitCSSTransformValue.CSS_TRANSLATEY [number]
window.WebKitCSSTransformValue.CSS_TRANSLATEZ [number]
window.WebKitCSSTransformValue.prototype [printed above as window.CSSValue.prototype]
window.WebKitPoint [object WebKitPointConstructor]
window.WebKitPoint.length [number]
window.WebKitPoint.prototype [object WebKitPointPrototype]
window.WebKitTransitionEvent [object WebKitTransitionEventConstructor]
window.WebKitTransitionEvent.prototype [printed above as window.Event.prototype]
window.WebSocket [object WebSocketConstructor]
window.WebSocket.CLOSED [number]
window.WebSocket.CONNECTING [number]
window.WebSocket.OPEN [number]
window.WebSocket.length [number]
window.WebSocket.prototype [object WebSocketPrototype]
window.WebSocket.prototype.CLOSED [number]
window.WebSocket.prototype.CONNECTING [number]
@@ -1960,6 +2018,7 @@ window.WebSocket.prototype.send [function]
window.WheelEvent [object WheelEventConstructor]
window.WheelEvent.prototype [printed above as window.Event.prototype]
window.Worker [object WorkerConstructor]
window.Worker.length [number]
window.Worker.prototype [object WorkerPrototype]
window.Worker.prototype.addEventListener [function]
window.Worker.prototype.dispatchEvent [function]
@@ -1995,6 +2054,7 @@ window.XMLHttpRequestException.NETWORK_ERR [number]
window.XMLHttpRequestException.prototype [object XMLHttpRequestExceptionPrototype]
window.XMLHttpRequestException.prototype.ABORT_ERR [number]
window.XMLHttpRequestException.prototype.NETWORK_ERR [number]
window.XMLHttpRequestException.prototype.toString [function]
window.XMLHttpRequestUpload [object XMLHttpRequestUploadConstructor]
window.XMLHttpRequestUpload.prototype [object XMLHttpRequestUploadPrototype]
window.XMLHttpRequestUpload.prototype.addEventListener [function]
@@ -2014,6 +2074,7 @@ window.XPathException.TYPE_ERR [number]
window.XPathException.prototype [object XPathExceptionPrototype]
window.XPathException.prototype.INVALID_EXPRESSION_ERR [number]
window.XPathException.prototype.TYPE_ERR [number]
window.XPathException.prototype.toString [function]
window.XPathResult [object XPathResultConstructor]
window.XPathResult.ANY_TYPE [number]
window.XPathResult.ANY_UNORDERED_NODE_TYPE [number]
@@ -2116,16 +2177,23 @@ window.console.memory.usedJSHeapSize [number]
window.console.profile [function]
window.console.profileEnd [function]
window.console.profiles [object Array]
window.console.profiles.length [number]
window.console.time [function]
window.console.timeEnd [function]
window.console.trace [function]
window.console.warn [function]
window.crypto [undefined]
window.decodeURI [function]
window.decodeURIComponent [function]
window.defaultStatus [string]
window.defaultstatus [string]
window.devicePixelRatio [number]
window.dispatchEvent [function]
window.document [printed above as window.Document.prototype]
window.encodeURI [function]
window.encodeURIComponent [function]
window.escape [function]
window.eval [function]
window.event [undefined]
window.find [function]
window.flushLog [function]
@@ -2144,6 +2212,8 @@ window.history.pushState [function]
window.history.replaceState [function]
window.innerHeight [number]
window.innerWidth [number]
window.isFinite [function]
window.isNaN [function]
window.length [number]
window.localStorage [printed above as window.Storage.prototype]
window.location [object Location]
@@ -2158,6 +2228,7 @@ window.location.protocol [string]
window.location.reload [function]
window.location.replace [function]
window.location.search [string]
window.location.toString [function]
window.locationbar [object BarInfo]
window.locationbar.visible [boolean]
window.log [function]
@@ -2244,11 +2315,14 @@ window.outerWidth [number]
window.pageXOffset [number]
window.pageYOffset [number]
window.parent [printed above as window]
window.parseFloat [function]
window.parseInt [function]
window.personalbar [object BarInfo]
window.personalbar.visible [boolean]
window.postMessage [function]
window.print [function]
window.prompt [function]
window.propertiesOnObject [function]
window.releaseEvents [function]
window.removeEventListener [function]
window.resizeBy [function]
@@ -2282,6 +2356,9 @@ window.statusbar [object BarInfo]
window.statusbar.visible [boolean]
window.stop [function]
window.styleMedia [object StyleMedia]
window.styleMedia.constructor [object StyleMediaConstructor]
window.styleMedia.constructor.prototype [object StyleMediaPrototype]
window.styleMedia.constructor.prototype.matchMedium [function]
window.styleMedia.matchMedium [function]
window.styleMedia.type [string]
window.toolbar [object BarInfo]
@@ -2290,6 +2367,8 @@ window.top [printed above as window]
window.tryEval [function]
window.typeOfNullAware [function]
window.typeStringNullAware [function]
window.undefined [undefined]
window.unescape [function]
window.webkitConvertPointFromNodeToPage [function]
window.webkitConvertPointFromPageToNode [function]
window.window [printed above as window]
@@ -2318,5 +2397,6 @@ window.getSelection().removeAllRanges [function]
window.getSelection().selectAllChildren [function]
window.getSelection().setBaseAndExtent [function]
window.getSelection().setPosition [function]
window.getSelection().toString [function]
window.getSelection().type [string]

@@ -126,12 +126,28 @@
}
}

function propertiesOnObject(o) {
var namesSet = {};
while (true) {
var names = Object.getOwnPropertyNames(o);
for (var i = 0; i < names.length; ++i)
namesSet[names[i]] = 1;
o = Object.getPrototypeOf(o);
if (!o)
break;
// Avoid polluting results with built-in prototype properties.
if ((o == Array.prototype) || (o == Object.prototype))
break;
}
var result = [];
for (var p in namesSet)
result.push(p);
return result;
}

function logProperties(object, objectName)
{
var array = new Array;
for (var property in object) {
array.push(property);
}
var array = propertiesOnObject(object);
array.sort();
for (var i = 0; i < array.length; i++) {
var property = array[i];

0 comments on commit 938264b

Please sign in to comment.