Update web-platform-tests to revision 181f8381fe9373e027f4b5ba5d1439843ad2c2e6

This commit is contained in:
WPT Sync Bot 2019-02-21 21:02:15 -05:00
parent 0dda115609
commit 0355b8e70d
105 changed files with 2775 additions and 764 deletions

View file

@ -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>
@ -17,7 +18,7 @@
<div class="styled"></div>
<script>
async_test(function(css_test) {
promise_test(function(css_test) {
var id = token();
var css_url = location.protocol + "//www1." + location.hostname + ":" + location.port +
"/referrer-policy/generic/subresource/stylesheet.py?id=" + id +
@ -29,20 +30,20 @@
var img_url = url_prefix + "/referrer-policy/generic/subresource/image.py" +
"?id=" + id + "&report-headers";
var link = document.createElement("link");
link.href = css_url;
link.rel = "stylesheet";
link.onload = function() {
css_test.step_timeout(function() {
queryXhr(img_url, function(message) {
assert_own_property(message, "headers");
assert_own_property(message, "referrer");
assert_equals(message.referrer, css_referrer);
css_test.done();
}, null, null, css_test);
}, 1000);
};
document.head.appendChild(link);
return new Promise(resolve => {
var 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(img_url))
.then(function(message) {
assert_own_property(message, "headers");
assert_own_property(message, "referrer");
assert_equals(message.referrer, css_referrer);
});
}, "Image from imported stylesheet (external).");
</script>

View file

@ -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) {
var id = token();
var url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port;
var css_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py?id=" + id;
var img_url = url_prefix + "/referrer-policy/generic/subresource/image.py" +
"?id=" + id + "&report-headers";
var link = document.createElement("link");
link.href = css_url;
link.rel = "stylesheet";
link.onload = css_test.step_func(function() {
css_test.step_timeout(function() {
queryXhr(img_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 => {
var 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(img_url))
.then(function(message) {
assert_own_property(message, "headers");
assert_own_property(message, "referrer");
assert_equals(message.referrer, css_url);
});
}, "Image from external stylesheet.");
</script>

View file

@ -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="origin">
</head>
<body>
@ -16,21 +17,20 @@
<div class="styled"></div>
<script>
async_test(function(css_test) {
promise_test(function(css_test) {
var id = token();
var css_url = location.protocol + "//www1." + location.hostname + ":" + location.port + "/referrer-policy/generic/subresource/image.py" + "?id=" + id;
var img_url = css_url + "&report-headers";
var div = document.querySelector("div.styled");
div.style = "content:url(" + css_url + ")";
css_test.step_timeout(function() {
queryXhr(img_url, function(message) {
assert_own_property(message, "headers");
assert_own_property(message, "referrer");
assert_equals(message.referrer, location.origin + "/");
css_test.done();
}, null, null, css_test);
}, 1000);
return timeoutPromise(css_test, 1000)
.then(() => requestViaXhr(img_url))
.then(function(message) {
assert_own_property(message, "headers");
assert_own_property(message, "referrer");
assert_equals(message.referrer, location.origin + "/");
});
}, "Image from inline styles.");
</script>

View file

@ -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="origin">
</head>
<body>
@ -17,7 +18,7 @@
<div class="styled"></div>
<script>
async_test(function(css_test) {
promise_test(function(css_test) {
var id = token();
var url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port + "/referrer-policy/generic/subresource/";
var css_url = url_prefix + "stylesheet.py?id=" + id;
@ -27,14 +28,13 @@
style.type = 'text/css';
style.appendChild(document.createTextNode("@import url('" + css_url + "');"));
document.head.appendChild(style);
css_test.step_timeout(function() {
queryXhr(img_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);
return timeoutPromise(css_test, 1000)
.then(() => requestViaXhr(img_url))
.then(function(message) {
assert_own_property(message, "headers");
assert_own_property(message, "referrer");
assert_equals(message.referrer, css_url);
});
}, "Image from imported stylesheet (internal).");
</script>

View file

@ -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="origin">
</head>
<body>
@ -16,7 +17,7 @@
<div class="styled"></div>
<script>
async_test(function(css_test) {
promise_test(function(css_test) {
var id = token();
var css_url = location.protocol + "//www1." + location.hostname + ":" + location.port + "/referrer-policy/generic/subresource/image.py" + "?id=" + id;
var img_url = css_url + "&report-headers";
@ -25,14 +26,13 @@
style.type = 'text/css';
style.appendChild(document.createTextNode("div.styled::before { content:url(" + css_url + ")}"));
document.head.appendChild(style);
css_test.step_timeout(function() {
queryXhr(img_url, function(message) {
assert_own_property(message, "headers");
assert_own_property(message, "referrer");
assert_equals(message.referrer, location.origin + "/");
css_test.done();
}, null, null, css_test);
}, 1000);
return timeoutPromise(css_test, 1000)
.then(() => requestViaXhr(img_url))
.then(function(message) {
assert_own_property(message, "headers");
assert_own_property(message, "referrer");
assert_equals(message.referrer, location.origin + "/");
});
}, "Image from internal stylesheet.");
</script>

View file

@ -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="origin">
</head>
<body>
@ -14,20 +15,19 @@
the referrer and referrer policy from the document.</p>
<script>
async_test(function(css_test) {
promise_test(function(css_test) {
var id = token();
var css_url = location.protocol + "//www1." + location.hostname + ":" + location.port + "/referrer-policy/generic/subresource/image.py" + "?id=" + id;
var img_url = css_url + "&report-headers";
document.body.background = css_url;
css_test.step_timeout(function() {
queryXhr(img_url, function(message) {
assert_own_property(message, "headers");
assert_own_property(message, "referrer");
assert_equals(message.referrer, location.origin + "/");
css_test.done();
}, null, null, css_test);
}, 1000);
return timeoutPromise(css_test, 1000)
.then(() => requestViaXhr(img_url))
.then(function(message) {
assert_own_property(message, "headers");
assert_own_property(message, "referrer");
assert_equals(message.referrer, location.origin + "/");
});
}, "Image from presentation attributes.");
</script>

View file

@ -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>
@ -17,7 +18,7 @@
<div class="styled"></div>
<script>
async_test(function(css_test) {
promise_test(function(css_test) {
var id = token();
var url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port;
var css_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py?id=" + id;
@ -25,15 +26,14 @@
"?id=" + id + "&report-headers";
var processingInstruction = document.createProcessingInstruction("xml-stylesheet", "href=\"" + css_url + "\" type=\"text/css\"");
css_test.step_timeout(function() {
queryXhr(img_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.insertBefore(processingInstruction, document.firstChild);
return timeoutPromise(css_test, 1000)
.then(() => requestViaXhr(img_url))
.then(function(message) {
assert_own_property(message, "headers");
assert_own_property(message, "referrer");
assert_equals(message.referrer, css_url);
});
}, "Image from external stylesheet (from ProcessingInstruction).");
</script>