Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/external/wpt/referrer-policy/css-integration/external-stylesheet.html |
| diff --git a/third_party/WebKit/LayoutTests/external/wpt/referrer-policy/css-integration/external-stylesheet.html b/third_party/WebKit/LayoutTests/external/wpt/referrer-policy/css-integration/external-stylesheet.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..73ec08fd9f2794f0967e6c71d4d90de25562fdc1 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/external/wpt/referrer-policy/css-integration/external-stylesheet.html |
| @@ -0,0 +1,47 @@ |
| +<!DOCTYPE html> |
| +<html> |
| + <head> |
| + <title>CSS integration - image from external 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="never"> |
| + </head> |
| + <body> |
| + <p>Check that resources from external stylesheets are loaded with |
| + the referrer and referrer policy from the external stylesheet.</p> |
| + |
| + <div class="styled"></div> |
| + |
| + <script> |
| + var css_test = async_test("Image from external stylesheet."); |
| + var id = token(); |
| + var urlPrefix = location.protocol + "//www1." + location.hostname + ":" + location.port; |
| + var cssUrl = urlPrefix + "/referrer-policy/generic/subresource/stylesheet.py?id=" + id; |
| + var imgUrl = urlPrefix + "/referrer-policy/generic/subresource/image.py" + |
| + "?id=" + id + "&report-headers"; |
| + |
| + var link = document.createElement("link"); |
| + link.href = cssUrl; |
| + link.rel = "stylesheet"; |
| + link.onload = function() { |
| + css_test.step_timeout( |
| + queryXhr.bind(this, imgUrl, |
|
estark
2017/03/28 18:17:21
Same here, I'm confused why this XHR uses the styl
|
| + function(message) { |
| + css_test.step(function() { |
| + assert_own_property(message, "headers"); |
| + assert_own_property(message, "referrer"); |
| + assert_equals(message.referrer, cssUrl); |
| + }); |
| + css_test.done(); |
| + }), |
| + 1000); |
| + }; |
| + document.head.appendChild(link); |
| + </script> |
| + |
| + <div id="log"></div> |
| + </body> |
| +</html> |