blob: dd16d88cbe23ec0864b0a9243af730d38e6704e7 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="/js-test-resources/js-test.js"></script>
</head>
<body>
<script>
description("Tests the behavior of unsafe-url referrer policy when cross origin from HTTPS to HTTP.");
jsTestIsAsync = true;
if (window.internals) {
internals.settings.setAllowDisplayOfInsecureContent(true);
internals.setResourceLoadStatisticsEnabled(false);
}
if (window.testRunner) {
testRunner.setStatisticsShouldDowngradeReferrer(false, function () {
// Should be the full URL
let expected = "https://127.0.0.1:8443/referrer-policy-img/unsafe-url/cross-origin-http.https.html";
let img = new Image();
img.referrerPolicy = "unsafe-url";
img.onload = function() { testPassed('referrer is "' + expected + '"'); finishJSTest(); }
img.onerror = function() { testFailed("referrer is not as expected"); finishJSTest(); }
img.src = "http://localhost:8000/referrer-policy/resources/image.py?expected=" + expected;
if (window.internals)
internals.setResourceLoadStatisticsEnabled(true);
});
}
</script>
</body>
</html>