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

Side by Side Diff: LayoutTests/http/tests/security/resources/referrer-attr-anchor-target.html

Issue 1291613010: Implement referrerpolicy attribute for img elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: actually fix webexposed test this time 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharness.js"></script>
5 <script src="/resources/testharnessreport.js"></script> 5 <script src="/resources/testharnessreport.js"></script>
6 </head> 6 </head>
7 <body> 7 <body>
8 <script> 8 <script>
9 var hash = document.location.hash; 9 var hash = document.location.hash;
10 if (hash.length > 0) 10 if (hash.length > 0)
11 hash = hash.substring(1); 11 hash = hash.substring(1);
12 12
13 var expected_referrer = ""; 13 var expected_referrer = "";
14 if (hash === "origin") 14 if (hash === "origin")
15 expected_referrer = "http://127.0.0.1:8000/"; 15 expected_referrer = "http://127.0.0.1:8000/";
16 else if (hash === "unsafe-url") 16 else if (hash === "unsafe-url")
17 expected_referrer = "http://127.0.0.1:8000/security/referrer-policy- attribute-anchor-unsafe-url.html"; 17 expected_referrer = "http://127.0.0.1:8000/security/referrer-policy- attribute-anchor-unsafe-url.html";
18 else if (hash === "no-policy") 18 else if (hash === "no-policy")
19 expected_referrer = "http://127.0.0.1:8000/security/referrer-policy- attribute-anchor-no-policy.html"; 19 expected_referrer = "http://127.0.0.1:8000/security/referrer-policy- attribute-no-policy.html";
20 else if (hash === "origin-when-crossorigin") 20 else if (hash === "origin-when-crossorigin")
21 expected_referrer = "http://127.0.0.1:8000/"; 21 expected_referrer = "http://127.0.0.1:8000/";
22 else if (hash === "no-referrer" || 22 else if (hash === "no-referrer" ||
23 hash === "no-referrer-when-downgrade") 23 hash === "no-referrer-when-downgrade")
24 expected_referrer = ""; 24 expected_referrer = "";
25 else 25 else
26 throw new Error("Unexpected hash value!"); 26 throw new Error("Unexpected hash value!");
27 27
28 test(function () { 28 test(function () {
29 assert_equals(expected_referrer, document.referrer); 29 assert_equals(expected_referrer, document.referrer);
30 }, "Referrer policy attribute on anchor element is applied: " + hash); 30 }, "Referrer policy attribute on anchor element is applied: " + hash);
31 </script> 31 </script>
32 </body> 32 </body>
33 </html> 33 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698