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

Side by Side Diff: LayoutTests/http/tests/security/postMessage/origin-unaffected-by-document-domain.html

Issue 50573004: Don't set document.domain to an IP address fragment. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: missing weboriginexport header Created 7 years, 1 month 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="resources/recv.js"></script> 4 <script src="resources/recv.js"></script>
5 <script> 5 <script>
6 if (window.testRunner) { 6 if (window.testRunner) {
7 testRunner.dumpAsText(); 7 testRunner.dumpAsText();
8 testRunner.waitUntilDone(); 8 testRunner.waitUntilDone();
9 } 9 }
10 10
11 if (window.internals)
12 internals.settings.setTreatIPAddressAsDomain(true);
13
11 addEventListener("message", recv, false); 14 addEventListener("message", recv, false);
12 15
13 function test() { 16 function test() {
14 var iframe = document.getElementById('child'); 17 var iframe = document.getElementById('child');
15 var win = iframe.contentWindow; 18 var win = iframe.contentWindow;
16 win.postMessage('Message from parent', '*'); 19 win.postMessage('Message from parent', '*');
17 20
18 win.postMessage('done', '*'); 21 win.postMessage('done', '*');
19 } 22 }
20 23
21 document.domain = "0.0.1"; 24 document.domain = "0.0.1";
22 </script> 25 </script>
23 <body> 26 <body>
24 <div>window.location.href = <script>document.write(window.location.href);</scrip t></div> 27 <div>window.location.href = <script>document.write(window.location.href);</scrip t></div>
25 <div>document.domain = <script>document.write(document.domain);</script></div> 28 <div>document.domain = <script>document.write(document.domain);</script></div>
26 <div><iframe src="http://localhost:8000/security/postMessage/resources/post-mess age-listener.html" id="child" width="800" height="300" 29 <div><iframe src="http://localhost:8000/security/postMessage/resources/post-mess age-listener.html" id="child" width="800" height="300"
27 style="border: 1px solid black;" onload="test()"> 30 style="border: 1px solid black;" onload="test()">
28 </iframe></div> 31 </iframe></div>
29 <div id="result">waiting...</div> 32 <div id="result">waiting...</div>
30 </body> 33 </body>
31 </html> 34 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698