Chromium Code Reviews| Index: LayoutTests/fast/dom/Window/get-set-properties.html |
| diff --git a/LayoutTests/fast/dom/Window/get-set-properties.html b/LayoutTests/fast/dom/Window/get-set-properties.html |
| index 065ebf350715526aab177fd550c6584e92983055..051ac9e12702bf8597c8341b5ec50a1d1f5db107 100644 |
| --- a/LayoutTests/fast/dom/Window/get-set-properties.html |
| +++ b/LayoutTests/fast/dom/Window/get-set-properties.html |
| @@ -43,6 +43,7 @@ function canGet(keyPath) |
| } |
| window.marker = { "foo": "bar", toString: function(){ return "window.marker.toString()"; } }; |
| +window.callableMarker = function() { return "window.callableMarker.toString()"; }; |
| function canSet(keyPath) |
| { |
| @@ -68,6 +69,18 @@ function canSetWithTypeConversion(keyPath) |
| } |
| } |
| +function canSetWithCallable(keyPath) |
| +{ |
| + var valuePath = "window.callableMarker"; |
| + |
| + try { |
| + eval("window." + keyPath + " = " + valuePath); |
| + return eval("window." + keyPath) === eval("window." + valuePath); |
| + } catch(e) { |
| + return false; |
| + } |
| +} |
| + |
| var windowReadWriteProperties = [ |
| "Attr", |
| "CDATASection", |
| @@ -225,6 +238,22 @@ var windowFunctions = [ |
| "getSelection", |
| "moveBy", |
| "moveTo", |
| + "open", |
| + "print", |
| + "prompt", |
| + "releaseEvents", |
| + "removeEventListener", |
| + "resizeBy", |
| + "resizeTo", |
| + "scroll", |
| + "scrollBy", |
| + "scrollTo", |
| + "setInterval", |
| + "setTimeout", |
| + "stop" |
| +]; |
| + |
| +var windowEventHandlers = [ |
| "onabort", |
| "onbeforeunload", |
| "onblur", |
| @@ -249,20 +278,7 @@ var windowFunctions = [ |
| "onsearch", |
| "onselect", |
| "onsubmit", |
| - "onunload", |
| - "open", |
| - "print", |
| - "prompt", |
| - "releaseEvents", |
| - "removeEventListener", |
| - "resizeBy", |
| - "resizeTo", |
| - "scroll", |
| - "scrollBy", |
| - "scrollTo", |
| - "setInterval", |
| - "setTimeout", |
| - "stop" |
| + "onunload" |
| ]; |
| window.onload = function() |
| @@ -301,5 +317,13 @@ window.onload = function() |
| shouldBeTrue("canGet('" + property + "')"); |
| shouldBeTrue("canSet('" + property + "')"); |
| } |
| + |
| + log("\n----- tests for getting/setting event handlers -----\n"); |
| + |
| + for (var i = 0; i < windowEventHandlers.length; i++) { //> |
|
arv (Not doing code reviews)
2013/08/08 14:41:28
What is //> for?
|
| + var property = windowEventHandlers[i]; |
| + shouldBeTrue("canGet('" + property + "')"); |
| + shouldBeTrue("canSetWithCallable('" + property + "')"); |
| + } |
| } |
| </script> |