Index: third_party/WebKit/LayoutTests/external/wpt/referrer-policy/css-integration/internal-stylesheet.html |
diff --git a/third_party/WebKit/LayoutTests/external/wpt/referrer-policy/css-integration/internal-stylesheet.html b/third_party/WebKit/LayoutTests/external/wpt/referrer-policy/css-integration/internal-stylesheet.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..54384c59bf1984633a8033a90d5b3cff5b5e6bd9 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/external/wpt/referrer-policy/css-integration/internal-stylesheet.html |
@@ -0,0 +1,43 @@ |
+<!DOCTYPE html> |
+<html> |
+ <head> |
+ <title>CSS integration - image from internal stylesheet</title> |
+ <script src="/resources/testharness.js"></script> |
+ <script src="/resources/testharnessreport.js"></script> |
+ <script src="/common/utils.js"></script> |
+ <!-- Common global functions for referrer-policy tests. --> |
+ <script src="/referrer-policy/generic/common.js"></script> |
+ <meta name="referrer" content="origin"> |
+ </head> |
+ <body> |
+ <p>Check that resources from internal stylesheets are loaded with |
+ the referrer and referrer policy from the document.</p> |
+ |
+ <div class="styled"></div> |
+ |
+ <script> |
+ var css_test = async_test("Image from internal stylesheet."); |
+ var id = token(); |
+ var cssUrl = location.protocol + "//www1." + location.hostname + ":" + location.port + "/referrer-policy/generic/subresource/image.py" + "?id=" + id; |
+ var imgUrl = cssUrl + "&report-headers"; |
+ |
+ var style = document.createElement("style"); |
+ style.type = 'text/css'; |
+ style.appendChild(document.createTextNode("div.styled::before { content:url(" + cssUrl + ")}")); |
+ document.head.appendChild(style); |
+ css_test.step_timeout( |
+ queryXhr.bind(this, imgUrl, |
+ function(message) { |
+ css_test.step(function() { |
+ assert_own_property(message, "headers"); |
+ assert_own_property(message, "referrer"); |
+ assert_equals(message.referrer, location.origin + "/"); |
+ }); |
+ css_test.done(); |
+ }), |
+ 1000); |
+ </script> |
+ |
+ <div id="log"></div> |
+ </body> |
+</html> |