OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <!-- TODO(kristijanburnik): Remove subres. duplication. Reuse a template. --> |
| 3 <html> |
| 4 <head> |
| 5 <title>Script messaging - cross-origin Script request</title> |
| 6 <script src="/resources/testharness.js"></script> |
| 7 <script src="/resources/testharnessreport.js"></script> |
| 8 <!-- Common global functions for referrer-policy tests. --> |
| 9 <script src="/referrer-policy/generic/common.js"></script> |
| 10 </head> |
| 11 <body> |
| 12 <h1>Script messaging - cross-origin Script request</h1> |
| 13 <p>If you can read JSON encoded HTTP request headers of the Script below, |
| 14 the messaging works as expected.</p> |
| 15 |
| 16 <pre id="received_message">Running...</pre> |
| 17 |
| 18 <script> |
| 19 var messaging_test = async_test("Script is responding with HTTP headers"); |
| 20 var urlPath = '/referrer-policy/generic/subresource/script.py'; |
| 21 var url = location.protocol + "//www1." + location.hostname + ":" + locati
on.port + |
| 22 urlPath; |
| 23 queryScript(url, function(message) { |
| 24 var pre = document.getElementById('received_message') |
| 25 var headers = message.headers; |
| 26 pre.innerHTML = ""; |
| 27 pre.innerHTML += url + ":\n\n"; |
| 28 pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n" |
| 29 messaging_test.step(function() { |
| 30 assert_own_property(headers, "host") |
| 31 assert_own_property(headers, "connection") |
| 32 }); |
| 33 messaging_test.done(); |
| 34 }); |
| 35 </script> |
| 36 |
| 37 <div id="log"></div> |
| 38 </body> |
| 39 </html> |
OLD | NEW |