OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <title>CSS integration - image from inline style</title> |
| 5 <script src="/resources/testharness.js"></script> |
| 6 <script src="/resources/testharnessreport.js"></script> |
| 7 <script src="/common/utils.js"></script> |
| 8 <!-- Common global functions for referrer-policy tests. --> |
| 9 <script src="/referrer-policy/generic/common.js"></script> |
| 10 <meta name="referrer" content="origin"> |
| 11 </head> |
| 12 <body> |
| 13 <p>Check that resources from inline styles are loaded with |
| 14 the referrer and referrer policy from the document.</p> |
| 15 |
| 16 <div class="styled"></div> |
| 17 |
| 18 <script> |
| 19 var css_test = async_test("Image from inline styles."); |
| 20 var id = token(); |
| 21 var cssUrl = location.protocol + "//www1." + location.hostname + ":" + loc
ation.port + "/referrer-policy/generic/subresource/image.py" + "?id=" + id; |
| 22 var imgUrl = cssUrl + "&report-headers"; |
| 23 |
| 24 var div = document.querySelector("div.styled"); |
| 25 div.style = "content:url(" + cssUrl + ")"; |
| 26 css_test.step_timeout( |
| 27 queryXhr.bind(this, imgUrl, |
| 28 function(message) { |
| 29 css_test.step(function() { |
| 30 assert_own_property(message, "headers"); |
| 31 assert_own_property(message, "referrer"); |
| 32 assert_equals(message.referrer, location.origin + "/
"); |
| 33 }); |
| 34 css_test.done(); |
| 35 }), |
| 36 1000); |
| 37 </script> |
| 38 |
| 39 <div id="log"></div> |
| 40 </body> |
| 41 </html> |
OLD | NEW |