mirror of
https://github.com/servo/servo.git
synced 2025-08-24 06:45:33 +01:00
Update web-platform-tests to revision 181f8381fe9373e027f4b5ba5d1439843ad2c2e6
This commit is contained in:
parent
0dda115609
commit
0355b8e70d
105 changed files with 2775 additions and 764 deletions
|
@ -7,6 +7,7 @@
|
|||
<script src="/common/utils.js"></script>
|
||||
<!-- Common global functions for referrer-policy tests. -->
|
||||
<script src="/referrer-policy/generic/common.js"></script>
|
||||
<script src="/referrer-policy/generic/referrer-policy-test-case.js"></script>
|
||||
<meta name="referrer" content="never">
|
||||
</head>
|
||||
<body>
|
||||
|
@ -16,27 +17,27 @@
|
|||
<div class="styled"></div>
|
||||
|
||||
<script>
|
||||
async_test(function(css_test) {
|
||||
promise_test(function(css_test) {
|
||||
let id = token();
|
||||
let url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port;
|
||||
let css_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py?id=" + id + "&type=font";
|
||||
let font_url = url_prefix + "/referrer-policy/generic/subresource/font.py" +
|
||||
"?id=" + id + "&report-headers";
|
||||
|
||||
let link = document.createElement("link");
|
||||
link.href = css_url;
|
||||
link.rel = "stylesheet";
|
||||
link.onload = function() {
|
||||
css_test.step_timeout(function() {
|
||||
queryXhr(font_url, function(message) {
|
||||
assert_own_property(message, "headers");
|
||||
assert_own_property(message, "referrer");
|
||||
assert_equals(message.referrer, css_url);
|
||||
css_test.done();
|
||||
}, null, null, css_test);
|
||||
}, 1000);
|
||||
};
|
||||
document.head.appendChild(link);
|
||||
return new Promise(resolve => {
|
||||
let link = document.createElement("link");
|
||||
link.href = css_url;
|
||||
link.rel = "stylesheet";
|
||||
link.onload = resolve;
|
||||
document.head.appendChild(link);
|
||||
})
|
||||
.then(() => timeoutPromise(css_test, 1000))
|
||||
.then(() => requestViaXhr(font_url))
|
||||
.then(function(message) {
|
||||
assert_own_property(message, "headers");
|
||||
assert_own_property(message, "referrer");
|
||||
assert_equals(message.referrer, css_url);
|
||||
});
|
||||
}, "Font from external stylesheet.");
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue