blob: a1b0c80e0d3593047f7b5d4c01bf2d6587ef8e41 [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 unsafe-url referrer policy when same origin.");
jsTestIsAsync = true;
function loadImage() {
// Should be the full URL
let expected = "http://127.0.0.1:8000/referrer-policy-img/unsafe-url/same-origin.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://127.0.0.1:8000/referrer-policy/resources/image.py?expected=" + expected;
if (window.internals)
internals.setResourceLoadStatisticsEnabled(true);
}
</script>
</body>
</html>