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

Side by Side Diff: LayoutTests/http/tests/security/w3c/resources/win-documentdomain.html

Issue 1182073002: cross-origin: Adds W3C cross-origin security tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated a comment. Created 5 years, 6 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 | « LayoutTests/http/tests/security/w3c/resources/frame.html ('k') | no next file » | 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 <html>
3 <head>
4 <script>
5 function loadFrames() {
6 window.A = document.getElementById('A').contentWindow;
7 window.B = document.getElementById('B').contentWindow;
8 window.C = document.getElementById('C').contentWindow;
9 window.D = document.getElementById('D').contentWindow;
10
11 var path = location.pathname.substring(0, location.pathname.lastIndexOf('/ ')) + '/frame.html';
12 A.location = 'frame.html';
13 B.location = frameURI = 'http://www2.web-platform.test:' + location.port + path;
14 C.location = frameURI = 'http://www2.web-platform.test:' + location.port + path;
15 D.location = frameURI = 'http://www1.web-platform.test:' + location.port + path;
16
17 var loadCount = 0;
18 function frameLoaded() {
19 if (++loadCount == 4)
20 go();
21 }
22 Array.prototype.forEach.call(document.getElementsByTagName('iframe'), func tion(ifr) { ifr.onload = frameLoaded; });
23 }
24
25
26 var results = [];
27 function assert(cond, msg) {
28 results.push({pass: !!cond, message: msg});
29 }
30
31 function go() {
32 window.onmessage = function() {
33 assert(B.checkWindowReferences(), "B's Window references are still self- consistent after document.domain");
34 for (var i = 0; i < window.length; ++i) {
35 assert(window[i] === B.windowReferences[i],
36 "Window reference " + i + " consistent between globals after do cument.domain");
37 assert(window[i].location === B.locationReferences[i],
38 "Location reference " + i + " consistent between globals after document.domain");
39 }
40 opener.postMessage(results, '*');
41 };
42 A.document.domain = A.document.domain;
43 document.domain = document.domain;
44 B.postMessage('', '*');
45 }
46
47 </script>
48 </head>
49 <body onload="loadFrames()">
50 <iframe id="A"></iframe>
51 <iframe id="B"></iframe>
52 <iframe id="C"></iframe>
53 <iframe id="D"></iframe>
54 </body>
55 </html>
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/security/w3c/resources/frame.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698