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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <div id="console"></div>
3 <script>
4 if (window.testRunner) {
5 testRunner.dumpAsText();
6 testRunner.waitUntilDone();
7 }
8
9 var iframe = document.body.appendChild(document.createElement("iframe"));
10 var o = undefined;
11
12 function test() {
13 var win = iframe.contentWindow;
14 function recurse() {
15 try { recurse(); } catch(e) {}
16 try { win.location; } catch(e) {
17 o = e;
18 }
19 }
20 recurse();
21 if (o.constructor.constructor("return location.hostname")() == "127.0.0.1") {
22 document.getElementById("console").innerText = "PASS: non-cross-site exc eption thrown.";
23 } else {
24 document.getElementById("console").innerText = "FAIL: cross-site excepti on thrown.";
25 }
26 if (window.testRunner) {
27 testRunner.notifyDone();
28 }
29 }
30
31 function waitForLoaded() {
32 try { frames[0].a; } catch(e) {
33 clearInterval(interval);
34 test();
35 }
36 }
37
38 var interval = setInterval(waitForLoaded, 1);
39 iframe.src = "http://localhost:8000/resources/dummy.html";
40 </script>
OLDNEW
« 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