| <!DOCTYPE html> |
| |
| <link rel="author" href="mtrzos@google.com" title="Maciek Trzos"> |
| <script src=/resources/testharness.js></script> |
| <script src=/resources/testharnessreport.js></script> |
| <script src=/fetch/sec-metadata/resources/helper.js></script> |
| <body> |
| |
| <!-- redirect Same-Site -> Cross-Site --> |
| <img onload="test_cross_site()" onerror="test_cross_site()" src="https://{{hosts[][www]}}:{{ports[https][0]}}/xhr/resources/redirect.py?location=https://{{hosts[alt][www]}}:{{ports[https][0]}}/fetch/sec-metadata/resources/record-header.py?file=redirect-same-site-cross-site"></img> |
| </body> |
| |
| <script> |
| function test_cross_site(){ |
| var cross_site_test = async_test("Same-Site -> Cross-Site redirect"); |
| cross_site_test.step(function () { |
| key = "redirect-same-site-cross-site"; |
| expected_cross_site = {"destination":"image", "site":"same-site"}; |
| |
| // Requests from the server the saved value of the Sec-Metadata header |
| cross_site_xhr = new XMLHttpRequest(); |
| cross_site_xhr.open("GET", "/fetch/sec-metadata/resources/record-header.py?retrieve=true&file=" + key); |
| |
| // Async test step triggered when the response is loaded |
| cross_site_xhr.onreadystatechange = cross_site_test.step_func(function () { |
| verify_response(cross_site_xhr, cross_site_test, expected_cross_site) |
| }); |
| cross_site_xhr.send(); |
| }); |
| } |
| </script> |