blob: 23419d8b8350662e8d5a5d17383b8ebed936e50c [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 no-referrer referrer policy when cross origin.");
jsTestIsAsync = true;
if (window.internals)
internals.setResourceLoadStatisticsEnabled(false);
function loadImage() {
// Should be the empty string
let expected = "";
let img = new Image();
img.referrerPolicy = "no-referrer";
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.php?expected=" + expected;
if (window.internals)
internals.setResourceLoadStatisticsEnabled(true);
}
</script>
</body>
</html>