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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="/resources/testharness.js"></script>
5 <script src="/resources/testharnessreport.js"></script>
6 </head>
7 <body>
8 <script>
9 var hash = document.location.hash;
10 if (hash.length > 0)
11 hash = hash.substring(1);
12
13 var expected_referrer = "";
14 if (hash === "origin")
15 expected_referrer = "http://127.0.0.1:8000/";
16 else if (hash === "unsafe-url")
17 expected_referrer = "http://127.0.0.1:8000/security/referrer-policy- attribute-anchor-unsafe-url.html";
18 else if (hash === "no-policy")
19 expected_referrer = "http://127.0.0.1:8000/security/referrer-policy- attribute-anchor-no-policy.html";
20 else if (hash === "origin-when-crossorigin")
21 expected_referrer = "http://127.0.0.1:8000/";
22 else if (hash === "no-referrer" ||
23 hash === "no-referrer-when-downgrade")
24 expected_referrer = "";
25 else
26 throw new Error("Unexpected hash value!");
27
28 test(function () {
29 assert_equals(expected_referrer, document.referrer);
30 }, "Referrer policy attribute on anchor element is applied: " + hash);
31 </script>
32 </body>
33 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698