Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/referrer-policy/css-integration/processing-instruction.html

Issue 2780533002: Use Referrer-Policy headers for CSS stylesheets (Closed)
Patch Set: updates Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>CSS integration - image from external stylesheet inserted via a Proce ssingInstruction</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 (referenced from a
14 ProcessingInstruction) are loaded with the referrer and referrer policy
15 from the external stylesheet.</p>
16
17 <div class="styled"></div>
18
19 <script>
20 var css_test = async_test("Image from external stylesheet (from Processing Instruction).");
21 var id = token();
22 var url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port;
23 var css_url = url_prefix + "/referrer-policy/generic/subresource/styleshee t.py?id=" + id;
24 var img_url = url_prefix + "/referrer-policy/generic/subresource/image.py" +
25 "?id=" + id + "&report-headers";
26
27 var processingInstruction = document.createProcessingInstruction("xml-styl esheet", "href=\"" + css_url + "\" type=\"text/css\"");
28 css_test.step_timeout(
29 queryXhr.bind(this, img_url,
30 function(message) {
31 css_test.step(function() {
32 assert_own_property(message, "headers");
33 assert_own_property(message, "referrer");
34 assert_equals(message.referrer, css_url);
35 });
36 css_test.done();
37 }),
38 1000);
39 document.insertBefore(processingInstruction, document.firstChild);
40 </script>
41
42 <div id="log"></div>
43 </body>
44 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698