blob: 0107469c28f3d758ef2a32b7319585b8e2029dc9 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="/js-test-resources/js-test.js"></script>
<script>
description("Tests that a same-origin fetch load succeeds if the server blocks cross-origin loads with a 'From-Origin: same-site' response header.");
jsTestIsAsync = true;
fetch("http://127.0.0.1:8000/from-origin/resources/fetch.php?fromOrigin=same-site").then(function(response) {
return response.json();
}).then(function(data) {
const parsedData = JSON.parse(data);
if (parsedData.Fetch)
testPassed("Fetch succeeded.");
else
testFailed("Unknown fetch response.");
finishJSTest();
}).catch(function(error) {
testFailed("Fetch blocked. " + error);
finishJSTest();
});
</script>
</head>
<body>
</body>
</html>