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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/referrer-policy/css-integration/external-import-stylesheet.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 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 cross_origin_url_prefix = location.protocol + "//www1." + location.hos tname + ":" + location.port;
23 var css_url = cross_origin_url_prefix + "/referrer-policy/generic/subresou rce/stylesheet.py?id=" + id + "&import-rule";
24 var url_prefix = location.protocol + "//" + location.hostname + ":" + loca tion.port;
25 var css_referrer = url_prefix + "/referrer-policy/generic/subresource/styl esheet.py?id=" + id;
26 var img_url = url_prefix + "/referrer-policy/generic/subresource/image.py" +
27 "?id=" + id + "&report-headers";
28
29 var link = document.createElement("link");
30 link.href = css_url;
31 link.rel = "stylesheet";
32 link.onload = function() {
33 css_test.step_timeout(
34 queryXhr.bind(this, img_url,
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, css_referrer);
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698