Index: LayoutTests/http/tests/security/xss-DENIED-cross-origin-stack-overflow.html |
diff --git a/LayoutTests/http/tests/security/xss-DENIED-cross-origin-stack-overflow.html b/LayoutTests/http/tests/security/xss-DENIED-cross-origin-stack-overflow.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..35e6d11da5b11b0e69dbe8730742a2b1ca9be39b |
--- /dev/null |
+++ b/LayoutTests/http/tests/security/xss-DENIED-cross-origin-stack-overflow.html |
@@ -0,0 +1,40 @@ |
+<!DOCTYPE html> |
+<div id="console"></div> |
+<script> |
+if (window.testRunner) { |
+ testRunner.dumpAsText(); |
+ testRunner.waitUntilDone(); |
+} |
+ |
+var iframe = document.body.appendChild(document.createElement("iframe")); |
+var o = undefined; |
+ |
+function test() { |
+ var win = iframe.contentWindow; |
+ function recurse() { |
+ try { recurse(); } catch(e) {} |
+ try { win.location; } catch(e) { |
+ o = e; |
+ } |
+ } |
+ recurse(); |
+ if (o.constructor.constructor("return location.hostname")() == "127.0.0.1") { |
+ document.getElementById("console").innerText = "PASS: non-cross-site exception thrown."; |
+ } else { |
+ document.getElementById("console").innerText = "FAIL: cross-site exception thrown."; |
+ } |
+ if (window.testRunner) { |
+ testRunner.notifyDone(); |
+ } |
+} |
+ |
+function waitForLoaded() { |
+ try { frames[0].a; } catch(e) { |
+ clearInterval(interval); |
+ test(); |
+ } |
+} |
+ |
+var interval = setInterval(waitForLoaded, 1); |
+iframe.src = "http://localhost:8000/resources/dummy.html"; |
+</script> |