OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <title>cross-origin test</title> |
| 3 <script src="/resources/testharness.js"></script> |
| 4 <script src="/resources/testharnessreport.js"></script> |
| 5 <iframe src="../without-ports/020-1.html"></iframe> |
| 6 <div id="log"></div> |
| 7 <script> |
| 8 var iframe = document.createElement('iframe'); |
| 9 var url_prefix = location.href.replace('://', '://www1.').replace(/\/with(out)?-
ports\/[^\/]+$/, ''); |
| 10 var url = url_prefix + '/without-ports/020-1.html'; |
| 11 iframe.src = url; |
| 12 document.body.appendChild(iframe); |
| 13 </script> |
| 14 <div id=log></div> |
| 15 <script> |
| 16 onload = function() { |
| 17 window[0].postMessage(1, location.href); |
| 18 window[1].postMessage(2, url); |
| 19 var i = 0; |
| 20 onmessage = function(e) { |
| 21 i++; |
| 22 assert_equals(e.data[0], i); |
| 23 assert_equals(e.data[1], location.protocol + '//' + location.host); |
| 24 if (i == 2) { |
| 25 done(); |
| 26 } |
| 27 }; |
| 28 }; |
| 29 </script> |
| 30 |
OLD | NEW |