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

Side by Side Diff: LayoutTests/http/tests/security/w3c/resources/frame.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
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <head>
4 <script>
5 // Override the |frames| property to test that such overrides are
6 // properly ignored cross-origin.
7 window.frames = "override";
8
9 // If we get a postMessage, we grab references to everything and set
10 // document.domain to trim off our topmost subdomain.
11 window.onmessage = function(evt) {
12 window.windowReferences = [];
13 window.locationReferences = [];
14 for (var i = 0; i < parent.length; ++i) {
15 windowReferences.push(parent[i]);
16 locationReferences.push(parent[i].location);
17 }
18 document.domain = document.domain.substring(document.domain.indexOf('.') + 1 );
19 evt.source.postMessage('', '*');
20 }
21
22 function checkWindowReferences() {
23 for (var i = 0; i < parent.length; ++i) {
24 if (windowReferences[i] != parent[i])
25 throw new Error("Window references don't match for " + i + " after docum ent.domain");
26 if (locationReferences[i] != parent[i].location)
27 throw new Error("Location references don't match for " + i + " after doc ument.domain");
28 }
29 return true;
30 }
31 </script>
32 </head>
33 <body>
34 </body>
35 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698