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