Commit f0e11293 authored by Chromium WPT Sync's avatar Chromium WPT Sync Committed by Commit Bot

Import wpt@170bf8330e41fd6ba0af816dd6fca4816cbf8d8d

Using wpt-import in Chromium 8a67bbae.
With Chromium commits locally applied on WPT:
303956b6 "Enable WPT tests for the Generic Sensor classes"
afb472c0 "Try to fix crash when terminating a worker while it is XHR-ing to a blob."


Build: https://ci.chromium.org/buildbot/chromium.infra.cron/wpt-importer/16248

Note to sheriffs: This CL imports external tests and adds
expectations for those tests; if this CL is large and causes
a few new failures, please fix the failures by adding new
lines to TestExpectations rather than reverting. See:
https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md

Directory owners for changes in this CL:
meade@chromium.org:
  external/wpt/web-animations

TBR=markdittmer

No-Export: true
Change-Id: I85211ab928f7aa846dac4b0fa294302186fd4acf
Reviewed-on: https://chromium-review.googlesource.com/1027790
Commit-Queue: Blink WPT Bot <blink-w3c-test-autoroller@chromium.org>
Reviewed-by: default avatarBlink WPT Bot <blink-w3c-test-autoroller@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553522}
parent bd7da54b
......@@ -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;
var encoded = btoa(String.fromCodePoint(...new Uint8Array(data)));
var dataUrl = `data:${type};base64,${encoded}`;
video.src = dataUrl;
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);
});
// Prevent WebKit from garbage collecting event handlers.
window._dataVideo = video;
});
});
function makeDataUrlVideo() {
return imageBitmapDataUrlVideoPromise;
}
function makeMakeHTMLImage(src) {
......
import os
import sys
import imp
# Use the file from the parent directory.
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
from redirect import main
mod = imp.load_source("_parent", os.path.join(os.path.dirname(os.path.dirname(__file__)),
os.path.basename(__file__)))
main = mod.main
import os
import sys
import imp
# Use the file from the parent directory.
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
from worker_interception_redirect_webworker import main
mod = imp.load_source("_parent", os.path.join(os.path.dirname(os.path.dirname(__file__)),
os.path.basename(__file__)))
main = mod.main
......@@ -15,10 +15,13 @@ test(t => {
const ct = effect.getComputedTiming();
assert_equals(ct.delay, 0, 'computed delay');
assert_equals(ct.endDelay, 0, 'computed endDelay');
assert_equals(ct.fill, 'none', 'computed fill');
assert_equals(ct.iterationStart, 0.0, 'computed iterationStart');
assert_equals(ct.iterations, 1.0, 'computed iterations');
assert_equals(ct.duration, 0, 'computed duration');
assert_equals(ct.direction, 'normal', 'computed direction');
assert_equals(ct.easing, 'linear', 'computed easing');
}, 'values of getComputedTiming() when a KeyframeEffect is ' +
'constructed without any KeyframeEffectOptions object');
......@@ -28,15 +31,21 @@ const gGetComputedTimingTests = [
expected: { } },
{ desc: 'a normal KeyframeEffectOptions object',
input: { delay: 1000,
endDelay: 2000,
fill: 'auto',
iterationStart: 0.5,
iterations: 5.5,
duration: 'auto',
direction: 'alternate' },
direction: 'alternate',
easing: 'steps(2)' },
expected: { delay: 1000,
endDelay: 2000,
fill: 'none',
iterationStart: 0.5,
iterations: 5.5,
duration: 0,
direction: 'alternate' } },
direction: 'alternate',
easing: 'steps(2)' } },
{ desc: 'a double value',
input: 3000,
timing: { duration: 3000 },
......@@ -78,14 +87,20 @@ for (const stest of gGetComputedTimingTests) {
const ct = effect.getComputedTiming();
assert_equals(ct.delay, expected('delay', 0),
'computed delay');
assert_equals(ct.endDelay, expected('endDelay', 0),
'computed endDelay');
assert_equals(ct.fill, expected('fill', 'none'),
'computed fill');
assert_equals(ct.iterationStart, expected('iterationStart', 0),
'computed iterations');
assert_equals(ct.iterations, expected('iterations', 1),
'computed iterations');
assert_equals(ct.duration, expected('duration', 0),
'computed duration');
assert_equals(ct.direction, expected('direction', 'normal'),
'computed direction');
assert_equals(ct.easing, expected('easing', 'linear'),
'computed easing');
}, 'values of getComputedTiming() when a KeyframeEffect is'
+ ` constructed by ${stest.desc}`);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment