Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <title>CSS integration - image from imported stylesheet (external)</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 imported stylesheets (loaded from external | |
| 14 stylesheets) are loaded with the referrer and referrer policy from the | |
| 15 external stylesheet.</p> | |
| 16 | |
| 17 <div class="styled"></div> | |
| 18 | |
| 19 <script> | |
| 20 var css_test = async_test("Image from imported stylesheet (external)."); | |
| 21 var id = token(); | |
| 22 var crossOriginUrlPrefix = location.protocol + "//www1." + location.hostna me + ":" + location.port; | |
|
estark
2017/03/28 18:17:20
nit: naming convention differs here from line 20
(
jochen (gone - plz use gerrit)
2017/03/29 08:13:11
I opted for this_style
| |
| 23 var cssUrl = crossOriginUrlPrefix + "/referrer-policy/generic/subresource/ stylesheet.py?id=" + id + "&import-rule"; | |
| 24 var urlPrefix = location.protocol + "//" + location.hostname + ":" + locat ion.port; | |
| 25 var cssReferrer = urlPrefix + "/referrer-policy/generic/subresource/styles heet.py?id=" + id; | |
|
estark
2017/03/28 18:17:21
I've been staring at this test and can't figure ou
| |
| 26 var imgUrl = urlPrefix + "/referrer-policy/generic/subresource/image.py" + | |
| 27 "?id=" + id + "&report-headers"; | |
| 28 | |
| 29 var link = document.createElement("link"); | |
| 30 link.href = cssUrl; | |
| 31 link.rel = "stylesheet"; | |
| 32 link.onload = function() { | |
| 33 css_test.step_timeout( | |
| 34 queryXhr.bind(this, imgUrl, | |
| 35 function(message) { | |
| 36 css_test.step(function() { | |
| 37 assert_own_property(message, "headers"); | |
| 38 assert_own_property(message, "referrer"); | |
| 39 assert_equals(message.referrer, cssReferrer); | |
| 40 }); | |
| 41 css_test.done(); | |
| 42 }), | |
| 43 1000); | |
| 44 }; | |
| 45 document.head.appendChild(link); | |
| 46 </script> | |
| 47 | |
| 48 <div id="log"></div> | |
| 49 </body> | |
| 50 </html> | |
| OLD | NEW |