| <!DOCTYPE html><!-- webkit-test-runner [ isAppInitiated=true ] --> |
| <head> |
| <script src="../resources/js-test-pre.js"></script> |
| </head> |
| <body> |
| <p>Test that a cross-origin redirect to a server that responds is indistinguishable from one that does not. Should say PASS:</p> |
| <pre id='console'></pre> |
| <script type="text/javascript"> |
| if (window.testRunner) { |
| testRunner.dumpAsText(); |
| testRunner.waitUntilDone(); |
| } |
| |
| function log(message) |
| { |
| document.getElementById('console').appendChild(document.createTextNode(message + "\n")); |
| } |
| |
| if (window.testRunner) |
| testRunner.setAllowsAnySSLCertificate(true); |
| |
| window.jsTestIsAsync = true; |
| |
| function log(message) |
| { |
| document.getElementById('console').appendChild(document.createTextNode(message + '\n')); |
| } |
| |
| function askForAttribution() { |
| var didLoadAppInitiatedRequest = testRunner.didLoadAppInitiatedRequest(); |
| var didLoadNonAppInitiatedRequest = testRunner.didLoadNonAppInitiatedRequest(); |
| |
| if (didLoadNonAppInitiatedRequest) { |
| log("FAIL did load non app initiated request"); |
| finishJSTest(); |
| return; |
| } |
| |
| if (!didLoadAppInitiatedRequest) { |
| log("FAIL did not load app initiated request"); |
| finishJSTest(); |
| return; |
| } |
| |
| log("PASS successfully loaded only app initiated requests"); |
| |
| finishJSTest(); |
| } |
| |
| var xhr = new XMLHttpRequest; |
| xhr.onerror = function() { setTimeout(askForAttribution, 0); } |
| xhr.open("GET", "/resources/redirect.py?url=http://localhost:8000/app-privacy-report/resources/redirect.js", true); |
| xhr.send(); |
| |
| </script> |
| <script src="../resources/js-test-post.js"></script> |
| |
| </body> |
| </html> |