Index: webkit/data/layout_tests/chrome/fast/dom/location-shadowing.html |
=================================================================== |
--- webkit/data/layout_tests/chrome/fast/dom/location-shadowing.html (revision 13273) |
+++ webkit/data/layout_tests/chrome/fast/dom/location-shadowing.html (working copy) |
@@ -1,85 +0,0 @@ |
-<html> |
-<body onload="test()"> |
-<div id="result"> |
-<p> |
-This tests that the location property on the window object cannot be |
-shadowed by using 'var' declarations or accessors defined using |
-__defineGetter__ and __defineSetter__ and that functions on location |
-objects are read-only. |
-</p> |
-</div> |
-<iframe id="testFrame"></iframe> |
-<script> |
-if (window.layoutTestController) { |
- layoutTestController.dumpAsText(); |
- layoutTestController.waitUntilDone(); |
-} |
- |
-function notifyDone() { |
- if (window.layoutTestController) { |
- layoutTestController.notifyDone(); |
- } |
-} |
- |
-var resultDiv = document.getElementById("result"); |
- |
-function check(passed) { |
- if (passed) { |
- resultDiv.innerHTML += "PASS<br>"; |
- } else { |
- resultDiv.innerHTML += "FAIL<br>"; |
- } |
-} |
- |
-var locationFunctions = ["reload", "replace", "assign", "toString", "valueOf"]; |
- |
-function overwrite() { return 'overwrite'; }; |
- |
-function testFunctionOverwrite() { |
- for (var i = 0; i < locationFunctions.length; i++) { |
- location[locationFunctions[i]] = overwrite; |
- check(location[locationFunctions[i]] != overwrite); |
- delete location[locationFunctions[i]]; |
- location[locationFunctions[i]] = overwrite; |
- check(location[locationFunctions[i]] != overwrite); |
- location.__defineGetter__(locationFunctions[i], failIfCalled); |
- location[locationFunctions[i]]; |
- } |
-} |
- |
-function failIfCalled() { check(false); } |
- |
-function testAccessorOverwrite() { |
- __defineGetter__("location", failIfCalled); |
- location; |
- window.__defineGetter__("location", failIfCalled); |
- window.location; |
- this.__defineGetter__("location", failIfCalled); |
- this.location; |
- delete location; |
- __defineGetter__("location", failIfCalled); |
- location; |
-} |
- |
- |
-function testHrefOverwrite() { |
- location.__defineGetter__("href", failIfCalled); |
- location.href; |
- delete location.href; |
- location.__defineGetter__("href", failIfCalled); |
- location.href; |
-} |
- |
-function testVarShadowing() { |
- testFrame.location = "resources/location-shadowing-inner.html"; |
-} |
- |
-function test() { |
- testFunctionOverwrite(); |
- testAccessorOverwrite(); |
- testHrefOverwrite(); |
- testVarShadowing(); |
-} |
-</script> |
-</body> |
-</html> |