Index: LayoutTests/http/tests/security/referrer-policy-attribute-onclick.html |
diff --git a/LayoutTests/http/tests/security/referrer-policy-attribute-onclick.html b/LayoutTests/http/tests/security/referrer-policy-attribute-onclick.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c3e0ee7a385da64e7ebd18e8142b27e020304de7 |
--- /dev/null |
+++ b/LayoutTests/http/tests/security/referrer-policy-attribute-onclick.html |
@@ -0,0 +1,39 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+ <title>referrerpolicy attribute on click</title> |
+ <script src="/resources/testharness.js"></script> |
+ <script src="/resources/testharnessreport.js"></script> |
+</head> |
+<body> |
+ <!-- Test that the referrerpolicy does not apply to click event |
+ listeners. --> |
+ <a href="#" |
+ referrerpolicy="never" id="click-me"></a> |
+ <script> |
+ var elem = document.getElementById("click-me"); |
+ |
+ var xhr = new XMLHttpRequest; |
+ var xhrDone = (function () { |
+ if (xhr.readyState !== 4) |
+ return; |
+ |
+ assert_true(xhr.responseText.indexOf( |
+ "referrer-policy-attribute-onclick.html") !== -1); |
+ done(); |
+ }); |
+ |
+ elem.addEventListener("click", function (event) { |
+ done(); |
+ event.preventDefault(); |
+ xhr.open("GET", "resources/echo-referrer-header.php", true); |
+ xhr.onreadystatechange = xhrDone; |
+ xhr.send(); |
+ return false; |
+ }); |
+ |
+ elem.click(); |
+ |
+ </script> |
+</body> |
+</html> |