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,24 +32,23 @@ function makeOffscreenCanvas() { ...@@ -32,24 +32,23 @@ function makeOffscreenCanvas() {
}); });
} }
function makeVideo() { var imageBitmapVideoPromise = new Promise(function(resolve, reject) {
return new Promise(function(resolve, reject) {
var video = document.createElement("video"); var video = document.createElement("video");
video.oncanplaythrough = function() { video.oncanplaythrough = function() {
resolve(video); resolve(video);
}; };
video.onerror = reject; video.onerror = reject;
video.src = getVideoURI("/images/pattern"); video.src = getVideoURI("/images/pattern");
});
}
function makeDataUrlVideo() { // Prevent WebKit from garbage collecting event handlers.
const toDataUrl = (type, buffer) => { window._video = video;
const encoded = btoa(String.fromCodePoint(...new Uint8Array(buffer))); });
return `data:${type};base64,${encoded}`
};
return fetch(getVideoURI("/images/pattern")) function makeVideo() {
return imageBitmapVideoPromise;
}
var imageBitmapDataUrlVideoPromise = fetch(getVideoURI("/images/pattern"))
.then(response => Promise.all([response.headers.get("Content-Type"), response.arrayBuffer()])) .then(response => Promise.all([response.headers.get("Content-Type"), response.arrayBuffer()]))
.then(([type, data]) => { .then(([type, data]) => {
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
...@@ -58,9 +57,18 @@ function makeDataUrlVideo() { ...@@ -58,9 +57,18 @@ function makeDataUrlVideo() {
resolve(video); resolve(video);
}; };
video.onerror = reject; 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) { function makeMakeHTMLImage(src) {
......
import os import os
import sys import imp
# Use the file from the parent directory. # Use the file from the parent directory.
sys.path.append(os.path.dirname(os.path.dirname(__file__))) mod = imp.load_source("_parent", os.path.join(os.path.dirname(os.path.dirname(__file__)),
from redirect import main os.path.basename(__file__)))
main = mod.main
import os import os
import sys import imp
# Use the file from the parent directory. # Use the file from the parent directory.
sys.path.append(os.path.dirname(os.path.dirname(__file__))) mod = imp.load_source("_parent", os.path.join(os.path.dirname(os.path.dirname(__file__)),
from worker_interception_redirect_webworker import main os.path.basename(__file__)))
main = mod.main
...@@ -15,10 +15,13 @@ test(t => { ...@@ -15,10 +15,13 @@ test(t => {
const ct = effect.getComputedTiming(); const ct = effect.getComputedTiming();
assert_equals(ct.delay, 0, 'computed delay'); assert_equals(ct.delay, 0, 'computed delay');
assert_equals(ct.endDelay, 0, 'computed endDelay');
assert_equals(ct.fill, 'none', 'computed fill'); 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.iterations, 1.0, 'computed iterations');
assert_equals(ct.duration, 0, 'computed duration'); assert_equals(ct.duration, 0, 'computed duration');
assert_equals(ct.direction, 'normal', 'computed direction'); assert_equals(ct.direction, 'normal', 'computed direction');
assert_equals(ct.easing, 'linear', 'computed easing');
}, 'values of getComputedTiming() when a KeyframeEffect is ' + }, 'values of getComputedTiming() when a KeyframeEffect is ' +
'constructed without any KeyframeEffectOptions object'); 'constructed without any KeyframeEffectOptions object');
...@@ -28,15 +31,21 @@ const gGetComputedTimingTests = [ ...@@ -28,15 +31,21 @@ const gGetComputedTimingTests = [
expected: { } }, expected: { } },
{ desc: 'a normal KeyframeEffectOptions object', { desc: 'a normal KeyframeEffectOptions object',
input: { delay: 1000, input: { delay: 1000,
endDelay: 2000,
fill: 'auto', fill: 'auto',
iterationStart: 0.5,
iterations: 5.5, iterations: 5.5,
duration: 'auto', duration: 'auto',
direction: 'alternate' }, direction: 'alternate',
easing: 'steps(2)' },
expected: { delay: 1000, expected: { delay: 1000,
endDelay: 2000,
fill: 'none', fill: 'none',
iterationStart: 0.5,
iterations: 5.5, iterations: 5.5,
duration: 0, duration: 0,
direction: 'alternate' } }, direction: 'alternate',
easing: 'steps(2)' } },
{ desc: 'a double value', { desc: 'a double value',
input: 3000, input: 3000,
timing: { duration: 3000 }, timing: { duration: 3000 },
...@@ -78,14 +87,20 @@ for (const stest of gGetComputedTimingTests) { ...@@ -78,14 +87,20 @@ for (const stest of gGetComputedTimingTests) {
const ct = effect.getComputedTiming(); const ct = effect.getComputedTiming();
assert_equals(ct.delay, expected('delay', 0), assert_equals(ct.delay, expected('delay', 0),
'computed delay'); 'computed delay');
assert_equals(ct.endDelay, expected('endDelay', 0),
'computed endDelay');
assert_equals(ct.fill, expected('fill', 'none'), assert_equals(ct.fill, expected('fill', 'none'),
'computed fill'); 'computed fill');
assert_equals(ct.iterationStart, expected('iterationStart', 0),
'computed iterations');
assert_equals(ct.iterations, expected('iterations', 1), assert_equals(ct.iterations, expected('iterations', 1),
'computed iterations'); 'computed iterations');
assert_equals(ct.duration, expected('duration', 0), assert_equals(ct.duration, expected('duration', 0),
'computed duration'); 'computed duration');
assert_equals(ct.direction, expected('direction', 'normal'), assert_equals(ct.direction, expected('direction', 'normal'),
'computed direction'); 'computed direction');
assert_equals(ct.easing, expected('easing', 'linear'),
'computed easing');
}, 'values of getComputedTiming() when a KeyframeEffect is' }, 'values of getComputedTiming() when a KeyframeEffect is'
+ ` constructed by ${stest.desc}`); + ` 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