Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(758)

Unified Diff: LayoutTests/http/tests/security/referrer-policy-attribute-onclick.html

Issue 1253413003: Implement referrerpolicy attribute for anchor elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: update webexposed layout tests Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698