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

Unified Diff: LayoutTests/http/tests/security/resources/referrer-attr-anchor-target.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/resources/referrer-attr-anchor-target.html
diff --git a/LayoutTests/http/tests/security/resources/referrer-attr-anchor-target.html b/LayoutTests/http/tests/security/resources/referrer-attr-anchor-target.html
new file mode 100644
index 0000000000000000000000000000000000000000..c829b15d2b24a26871be388a130f8c1a6c5717d2
--- /dev/null
+++ b/LayoutTests/http/tests/security/resources/referrer-attr-anchor-target.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+ <script>
+ var hash = document.location.hash;
+ if (hash.length > 0)
+ hash = hash.substring(1);
+
+ var expected_referrer = "";
+ if (hash === "origin")
+ expected_referrer = "http://127.0.0.1:8000/";
+ else if (hash === "unsafe-url")
+ expected_referrer = "http://127.0.0.1:8000/security/referrer-policy-attribute-anchor-unsafe-url.html";
+ else if (hash === "no-policy")
+ expected_referrer = "http://127.0.0.1:8000/security/referrer-policy-attribute-anchor-no-policy.html";
+ else if (hash === "origin-when-crossorigin")
+ expected_referrer = "http://127.0.0.1:8000/";
+ else if (hash === "no-referrer" ||
+ hash === "no-referrer-when-downgrade")
+ expected_referrer = "";
+ else
+ throw new Error("Unexpected hash value!");
+
+ test(function () {
+ assert_equals(expected_referrer, document.referrer);
+ }, "Referrer policy attribute on anchor element is applied: " + hash);
+ </script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698