| <!DOCTYPE html> |
| <html> |
| <head> |
| <script src="/js-test-resources/js-test.js"></script> |
| <script> |
| description("Tests that a cross-origin fetch load fails if the server blocks it with a 'From-Origin: same-site' response header, even though the server includes an Access-Control-Allow-Origin response header."); |
| jsTestIsAsync = true; |
| |
| fetch("http://localhost: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) |
| testFailed("Fetch succeeded."); |
| else |
| testFailed("Unknown fetch response."); |
| finishJSTest(); |
| }).catch(function(error) { |
| testPassed("Fetch blocked. " + error); |
| finishJSTest(); |
| }); |
| </script> |
| </head> |
| <body> |
| </body> |
| </html> |