OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <title>CSS integration - image from imported stylesheet (internal)</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 stylesheets (imported from internal |
| 14 stylesheets) are loaded with the referrer and referrer policy from the |
| 15 document.</p> |
| 16 |
| 17 <div class="styled"></div> |
| 18 |
| 19 <script> |
| 20 var css_test = async_test("Image from imported stylesheet (internal)."); |
| 21 var id = token(); |
| 22 var urlPrefix = location.protocol + "//www1." + location.hostname + ":" +
location.port + "/referrer-policy/generic/subresource/"; |
| 23 var cssUrl = urlPrefix + "stylesheet.py?id=" + id; |
| 24 var imgUrl = urlPrefix + "image.py?report-headers&id=" + id; |
| 25 |
| 26 var style = document.createElement("style"); |
| 27 style.type = 'text/css'; |
| 28 style.appendChild(document.createTextNode("@import url('" + cssUrl + "');"
)); |
| 29 document.head.appendChild(style); |
| 30 css_test.step_timeout( |
| 31 queryXhr.bind(this, imgUrl, |
| 32 function(message) { |
| 33 css_test.step(function() { |
| 34 assert_own_property(message, "headers"); |
| 35 assert_own_property(message, "referrer"); |
| 36 assert_equals(message.referrer, cssUrl); |
| 37 }); |
| 38 css_test.done(); |
| 39 }), |
| 40 1000); |
| 41 </script> |
| 42 |
| 43 <div id="log"></div> |
| 44 </body> |
| 45 </html> |
OLD | NEW |