Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <title>CSS integration - image from external stylesheet</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="never"> | |
| 11 </head> | |
| 12 <body> | |
| 13 <p>Check that resources from external stylesheets are loaded with | |
| 14 the referrer and referrer policy from the external stylesheet.</p> | |
| 15 | |
| 16 <div class="styled"></div> | |
| 17 | |
| 18 <script> | |
| 19 var css_test = async_test("Image from external stylesheet."); | |
| 20 var id = token(); | |
| 21 var urlPrefix = location.protocol + "//www1." + location.hostname + ":" + location.port; | |
| 22 var cssUrl = urlPrefix + "/referrer-policy/generic/subresource/stylesheet. py?id=" + id; | |
| 23 var imgUrl = urlPrefix + "/referrer-policy/generic/subresource/image.py" + | |
| 24 "?id=" + id + "&report-headers"; | |
| 25 | |
| 26 var link = document.createElement("link"); | |
| 27 link.href = cssUrl; | |
| 28 link.rel = "stylesheet"; | |
| 29 link.onload = function() { | |
| 30 css_test.step_timeout( | |
| 31 queryXhr.bind(this, imgUrl, | |
|
estark
2017/03/28 18:17:21
Same here, I'm confused why this XHR uses the styl
| |
| 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 }; | |
| 42 document.head.appendChild(link); | |
| 43 </script> | |
| 44 | |
| 45 <div id="log"></div> | |
| 46 </body> | |
| 47 </html> | |
| OLD | NEW |