Modified: trunk/LayoutTests/ChangeLog (99004 => 99005)
--- trunk/LayoutTests/ChangeLog 2011-11-01 22:32:33 UTC (rev 99004)
+++ trunk/LayoutTests/ChangeLog 2011-11-01 22:36:54 UTC (rev 99005)
@@ -1,3 +1,15 @@
+2011-11-01 Sam Weinig <[email protected]>
+
+ Expand fast/dom/getter-on-window-object2.html to test Object.getOwnPropertyDescriptor as well
+ https://bugs.webkit.org/show_bug.cgi?id=71332
+
+ Reviewed by Anders Carlsson.
+
+ * fast/dom/getter-on-window-object2-expected.txt:
+ * fast/dom/getter-on-window-object2.html:
+ Convert to shouldBe style tests and expand test to also test Object.getOwnPropertyDescriptor,
+ which currently fail for getters/setters defined over window properties.
+
2011-11-01 John Gregg <[email protected]>
Suppress svg/filters/invalidate-on-child-layout.svg until the fix lands.
Modified: trunk/LayoutTests/fast/dom/getter-on-window-object2-expected.txt (99004 => 99005)
--- trunk/LayoutTests/fast/dom/getter-on-window-object2-expected.txt 2011-11-01 22:32:33 UTC (rev 99004)
+++ trunk/LayoutTests/fast/dom/getter-on-window-object2-expected.txt 2011-11-01 22:36:54 UTC (rev 99005)
@@ -1,14 +1,25 @@
-This page tests what happens when a getter / setter on the window object conflicts with another property or declared variable.
+This page tests what happens when a getter / setter on the window object conflicts with another property or declared variable
-window.x is: 1
-typeof window.__lookupGetter__("x") is: undefined
-window.x is: 2
-typeof window.__lookupSetter__("x") is: undefined
-window.y is: window.y __getter__
-typeof window.__lookupGetter__("y") is: function
-window.y __setter__ called
-window.y is: window.y __getter__
-typeof window.__lookupSetter__("y") is: function
-window.z __setter__ called
-typeof window.__lookupSetter__("z") is: undefined
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+PASS window.x is 1
+PASS typeof window.__lookupGetter__('x') is 'undefined'
+PASS typeof Object.getOwnPropertyDescriptor(window, 'x').get is 'undefined'
+
+PASS window.x is 2
+PASS typeof window.__lookupGetter__('x') is 'undefined'
+PASS typeof Object.getOwnPropertyDescriptor(window, 'x').get is 'undefined'
+
+PASS window.y is 'window.y __getter__'
+PASS typeof window.__lookupGetter__('y') is 'function'
+FAIL typeof Object.getOwnPropertyDescriptor(window, 'y').get should be function. Was undefined.
+
+PASS window.y is 'window.y __getter__'
+PASS typeof window.__lookupGetter__('y') is 'function'
+FAIL typeof Object.getOwnPropertyDescriptor(window, 'y').get should be function. Was undefined.
+
+PASS window.z is undefined.
+PASS typeof window.__lookupSetter__('z') is 'function'
+PASS typeof Object.getOwnPropertyDescriptor(window, 'z').set is 'function'
+
Modified: trunk/LayoutTests/fast/dom/getter-on-window-object2.html (99004 => 99005)
--- trunk/LayoutTests/fast/dom/getter-on-window-object2.html 2011-11-01 22:32:33 UTC (rev 99004)
+++ trunk/LayoutTests/fast/dom/getter-on-window-object2.html 2011-11-01 22:36:54 UTC (rev 99005)
@@ -1,52 +1,59 @@
-<p>
-This page tests what happens when a getter / setter on the window object conflicts
-with another property or declared variable.
-</p>
+<script src=""
-<pre id="console"></pre>
-
<script>
-function log(s)
-{
- document.getElementById("console").appendChild(document.createTextNode(s + "\n"));
-}
+description("This page tests what happens when a getter / setter on the window object conflicts with another property or declared variable");
-if (window.layoutTestController)
- layoutTestController.dumpAsText();
-
var x = 1;
-
try {
window.__defineGetter__("x", function() { return "window.x __getter__"; });
-} catch(e) { log(e); }
-log("window.x is: " + window.x);
-log("typeof window.__lookupGetter__(\"x\") is: " + typeof window.__lookupGetter__("x"));
+} catch(e) { debug(e); }
+shouldBe("window.x", "1");
+shouldBe("typeof window.__lookupGetter__('x')", "'undefined'");
+shouldBe("typeof Object.getOwnPropertyDescriptor(window, 'x').get", "'undefined'");
+debug("");
+
+
try {
-window.__defineSetter__("x", function() { log("window.x __setter__ called"); });
-} catch(e) { log(e); }
+window.__defineSetter__("x", function() { debug("window.x __setter__ called"); });
+} catch(e) { debug(e); }
x = 2;
-log("window.x is: " + window.x);
-log("typeof window.__lookupSetter__(\"x\") is: " + typeof window.__lookupGetter__("x"));
-y = 1;
+shouldBe("window.x", "2");
+shouldBe("typeof window.__lookupGetter__('x')", "'undefined'");
+shouldBe("typeof Object.getOwnPropertyDescriptor(window, 'x').get", "'undefined'");
+debug("");
+
+window.y = 1;
try {
window.__defineGetter__("y", function() { return "window.y __getter__"; });
-} catch(e) { log(e); }
-log("window.y is: " + window.y);
-log("typeof window.__lookupGetter__(\"y\") is: " + typeof window.__lookupGetter__("y"));
+} catch(e) { debug(e); }
+shouldBe("window.y", "'window.y __getter__'");
+shouldBe("typeof window.__lookupGetter__('y')", "'function'");
+shouldBe("typeof Object.getOwnPropertyDescriptor(window, 'y').get", "'function'");
+debug("");
+
+
try {
-window.__defineSetter__("y", function() { log("window.y __setter__ called"); });
-} catch(e) { log(e); }
-y = 2;
-log("window.y is: " + window.y);
-log("typeof window.__lookupSetter__(\"y\") is: " + typeof window.__lookupGetter__("y"));
+window.__defineSetter__("y", function() { "window.y __setter__ called"; });
+} catch(e) { debug(e); }
+window.y = 2;
+shouldBe("window.y", "'window.y __getter__'");
+shouldBe("typeof window.__lookupGetter__('y')", "'function'");
+shouldBe("typeof Object.getOwnPropertyDescriptor(window, 'y').get", "'function'");
+debug("");
+
+
try {
-window.__defineSetter__("z", function() { log("window.z __setter__ called"); });
-} catch(e) { log(e); }
+window.__defineSetter__("z", function() { "window.z __setter__ called"; });
+} catch(e) { debug(e); }
window.z = 1;
-log("typeof window.__lookupSetter__(\"z\") is: " + typeof window.__lookupGetter__("z"));
+
+shouldBeUndefined("window.z");
+shouldBe("typeof window.__lookupSetter__('z')", "'function'");
+shouldBe("typeof Object.getOwnPropertyDescriptor(window, 'z').set", "'function'");
+
</script>