blob: 11d60473981cf056ebc56b15905f27c070dad9c8 [file] [log] [blame]
<!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 -> Same-Site -->
<img onload="test_same_site()" onerror="test_same_site()" src="https://{{hosts[][www]}}:{{ports[https][0]}}/xhr/resources/redirect.py?location=https://{{hosts[][www]}}:{{ports[https][0]}}/fetch/sec-metadata/resources/record-header.py?file=redirect-same-site-same-site"></img>
</body>
<script>
function test_same_site(){
var same_site_test = async_test("Same-Site -> Same-Site redirect");
same_site_test.step(function () {
key = "redirect-same-site-same-site";
expected_same_site = {"destination":"image", "site":"same-site"};
// Requests from the server the saved value of the Sec-Metadata header
same_site_xhr = new XMLHttpRequest();
same_site_xhr.open("GET", "/fetch/sec-metadata/resources/record-header.py?retrieve=true&file=" + key);
// Async test step triggered when the response is loaded
same_site_xhr.onreadystatechange = same_site_test.step_func(function () {
verify_response(same_site_xhr, same_site_test, expected_same_site)
});
same_site_xhr.send();
});
}
</script>