blob: 74ad7ba4391e35823b630438bb3e54276d8860b0 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="/js-test-resources/js-test.js"></script>
<script>
description("Tests that a same-origin xhr load succeeds if the server blocks cross-origin loads with a 'From-Origin: same' response header.");
jsTestIsAsync = true;
function transferComplete() {
if (xhr.responseText === "xhr")
testPassed("Xhr succeeded.");
else
testFailed("Unknown xhr response: " + xhr.responseText);
finishJSTest();
}
function transferFailed() {
testFailed("Xhr blocked. " + xhr.statusText);
finishJSTest();
}
var xhr = new XMLHttpRequest();
xhr.addEventListener("load", transferComplete);
xhr.addEventListener("error", transferFailed);
xhr.open("GET", "http://127.0.0.1:8000/from-origin/resources/xhr.php?fromOrigin=same");
xhr.send();
</script>
</head>
<body>
</body>
</html>