mirror of
https://github.com/servo/servo.git
synced 2025-08-24 14:48:21 +01:00
Update web-platform-tests to revision e87f38097902e16348d4e17f4fe3bc2d0112bff1
This commit is contained in:
parent
2f8fa32e91
commit
db5631a086
381 changed files with 11610 additions and 4232 deletions
|
@ -304,6 +304,26 @@ function requestViaLinkPrefetch(url) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates a new beacon request.
|
||||
* @param {string} url The URL of a resource to prefetch.
|
||||
* @return {Promise} The promise for success/error events.
|
||||
*/
|
||||
async function requestViaSendBeacon(url) {
|
||||
function wait(ms) {
|
||||
return new Promise(resolve => step_timeout(resolve, ms));
|
||||
}
|
||||
if (!navigator.sendBeacon(url)) {
|
||||
// If mixed-content check fails, it should return false.
|
||||
throw new Error('sendBeacon() fails.');
|
||||
}
|
||||
// We don't have a means to see the result of sendBeacon() request
|
||||
// for sure. Let's wait for a while and let the generic test function
|
||||
// ask the server for the result.
|
||||
await wait(500);
|
||||
return 'allowed';
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new media element with a child source element, binds loadeddata and
|
||||
* error events, sets attributes and appends to document.body.
|
||||
|
|
|
@ -59,6 +59,7 @@ function MixedContentTestCase(scenario, description, sanityChecker) {
|
|||
var resourceMap = {
|
||||
"a-tag": requestViaAnchor,
|
||||
"area-tag": requestViaArea,
|
||||
"beacon-request": requestViaSendBeacon,
|
||||
"fetch-request": requestViaFetch,
|
||||
"form-tag": requestViaForm,
|
||||
"iframe-tag": requestViaIframe,
|
||||
|
@ -81,6 +82,7 @@ function MixedContentTestCase(scenario, description, sanityChecker) {
|
|||
var contentType = {
|
||||
"a-tag": "text/html",
|
||||
"area-tag": "text/html",
|
||||
"beacon-request": "text/plain",
|
||||
"fetch-request": "application/json",
|
||||
"form-tag": "text/html",
|
||||
"iframe-tag": "text/html",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue