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

Unified Diff: LayoutTests/http/tests/security/referrer-policy-attribute-img-removeattr.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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/security/referrer-policy-attribute-img-removeattr.html
diff --git a/LayoutTests/http/tests/security/referrer-policy-attribute-img-removeattr.html b/LayoutTests/http/tests/security/referrer-policy-attribute-img-removeattr.html
new file mode 100644
index 0000000000000000000000000000000000000000..cbb4a4425145aadf80dad8a9f8df4b399e898bbf
--- /dev/null
+++ b/LayoutTests/http/tests/security/referrer-policy-attribute-img-removeattr.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+ <img src="http://127.0.0.1:8000/security/resources/green-if-referrer-is-origin.php"
+ referrerpolicy="origin" id="image" />
+ <script>
+ // Remove the image's referrerpolicy attribute and set a new
+ // src to send a new request.
+ var img = document.getElementById("image");
+ img.removeAttribute("referrerpolicy");
+ img.src = "http://127.0.0.1:8000/security/resources/green-if-no-referrer.php";
+ // The expected result is a red square because a referrer will be
+ // sent according to the default referrerpolicy.
+ </script>
+</body>
+</html

Powered by Google App Engine
This is Rietveld 408576698