Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(854)

Unified Diff: LayoutTests/http/tests/security/xss-DENIED-cross-origin-stack-overflow.html

Issue 1339023002: Rethrow cross-site exceptions as security errors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: git cl set_commit Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/security/xss-DENIED-cross-origin-stack-overflow-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | LayoutTests/http/tests/security/xss-DENIED-cross-origin-stack-overflow-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698