mirror of
https://github.com/servo/servo.git
synced 2025-08-17 11:25:35 +01:00
Update web-platform-tests to revision 5084587f6b05bf99ad09e7844be66dcc61070cdf
This commit is contained in:
parent
6d42d2f1e8
commit
7d1071a6a4
408 changed files with 8968 additions and 2608 deletions
|
@ -32,35 +32,43 @@ function makeOffscreenCanvas() {
|
|||
});
|
||||
}
|
||||
|
||||
var imageBitmapVideoPromise = new Promise(function(resolve, reject) {
|
||||
var video = document.createElement("video");
|
||||
video.oncanplaythrough = function() {
|
||||
resolve(video);
|
||||
};
|
||||
video.onerror = reject;
|
||||
video.src = getVideoURI("/images/pattern");
|
||||
|
||||
// Prevent WebKit from garbage collecting event handlers.
|
||||
window._video = video;
|
||||
});
|
||||
|
||||
function makeVideo() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var video = document.createElement("video");
|
||||
video.oncanplaythrough = function() {
|
||||
resolve(video);
|
||||
};
|
||||
video.onerror = reject;
|
||||
video.src = getVideoURI("/images/pattern");
|
||||
});
|
||||
return imageBitmapVideoPromise;
|
||||
}
|
||||
|
||||
function makeDataUrlVideo() {
|
||||
const toDataUrl = (type, buffer) => {
|
||||
const encoded = btoa(String.fromCodePoint(...new Uint8Array(buffer)));
|
||||
return `data:${type};base64,${encoded}`
|
||||
};
|
||||
var imageBitmapDataUrlVideoPromise = fetch(getVideoURI("/images/pattern"))
|
||||
.then(response => Promise.all([response.headers.get("Content-Type"), response.arrayBuffer()]))
|
||||
.then(([type, data]) => {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var video = document.createElement("video");
|
||||
video.oncanplaythrough = function() {
|
||||
resolve(video);
|
||||
};
|
||||
video.onerror = reject;
|
||||
|
||||
return fetch(getVideoURI("/images/pattern"))
|
||||
.then(response => Promise.all([response.headers.get("Content-Type"), response.arrayBuffer()]))
|
||||
.then(([type, data]) => {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var video = document.createElement("video");
|
||||
video.oncanplaythrough = function() {
|
||||
resolve(video);
|
||||
};
|
||||
video.onerror = reject;
|
||||
video.src = toDataUrl(type, data);
|
||||
});
|
||||
var encoded = btoa(String.fromCodePoint(...new Uint8Array(data)));
|
||||
var dataUrl = `data:${type};base64,${encoded}`;
|
||||
video.src = dataUrl;
|
||||
|
||||
// Prevent WebKit from garbage collecting event handlers.
|
||||
window._dataVideo = video;
|
||||
});
|
||||
});
|
||||
|
||||
function makeDataUrlVideo() {
|
||||
return imageBitmapDataUrlVideoPromise;
|
||||
}
|
||||
|
||||
function makeMakeHTMLImage(src) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue