Update web-platform-tests to revision c26470dac73f2df9d4822a0d3482f7eb1ebf57d9

This commit is contained in:
Anthony Ramine 2018-01-10 14:28:20 +01:00
parent 7de87c487b
commit 4d3c932c47
648 changed files with 9014 additions and 4821 deletions

View file

@ -7,12 +7,53 @@
<script>
test(function() {
var region = new VTTRegion();
assert_equals(region.width, 100);
assert_equals(region.lines, 3);
assert_equals(region.regionAnchorX, 0);
assert_equals(region.regionAnchorY, 100);
assert_true(region instanceof VTTRegion, "instanceof");
assert_equals(region.scroll, "");
assert_equals(region.viewportAnchorX, 0);
assert_equals(region.viewportAnchorY, 100);
assert_equals(region.scroll, '');
}, document.title + ' initial values');
assert_equals(region.regionAnchorX, 0);
assert_equals(region.regionAnchorY, 100);
assert_equals(region.lines, 3);
assert_equals(region.width, 100);
}, document.title + " initial values");
test(function() {
var region = new VTTRegion();
region.scroll = "invalid-scroll-value";
assert_equals(region.scroll, "");
checkValues([-1, 101], "IndexSizeError");
checkValues([-Infinity, Infinity, NaN], new TypeError);
function checkValues(invalidValues, exception) {
for (var value of invalidValues) {
assert_throws(exception, function() { region.viewportAnchorX = value; });
assert_equals(region.viewportAnchorX, 0);
assert_throws(exception, function() { region.viewportAnchorY = value; });
assert_equals(region.viewportAnchorY, 100);
assert_throws(exception, function() { region.regionAnchorX = value; });
assert_equals(region.regionAnchorX, 0);
assert_throws(exception, function() { region.regionAnchorY = value; });
assert_equals(region.regionAnchorY, 100);
assert_throws(exception, function() { region.width = value; });
assert_equals(region.width, 100);
}
}
assert_throws("IndexSizeError", function() { region.lines = -1; });
assert_equals(region.lines, 3);
region.lines = 130;
assert_equals(region.lines, 130);
region.viewportAnchorX = 64;
assert_equals(region.viewportAnchorX, 64);
region.viewportAnchorY = 32;
assert_equals(region.viewportAnchorY, 32);
region.regionAnchorX = 16;
assert_equals(region.regionAnchorX, 16);
region.regionAnchorY = 8;
assert_equals(region.regionAnchorY, 8);
region.width = 42;
assert_equals(region.width, 42);
}, document.title + " mutations");
</script>

View file

@ -0,0 +1,26 @@
<!DOCTYPE html>
<title>Box-less VTTCue attached to VTTRegion</title>
<script src="/common/media.js"></script>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<video></video>
<script>
setup(function() {
window.video = document.querySelector('video');
video.src = getVideoURI('/media/test');
});
async_test(function(t) {
let track = video.addTextTrack('subtitles');
let cue = new VTTCue(0, 1, '');
cue.region = new VTTRegion();
cue.onexit = t.step_func_done(function() {
video.pause();
});
track.addCue(cue);
video.onloadedmetadata = t.step_func(function() {
video.currentTime = 0.8;
video.play();
});
video.onended = t.unreached_func('test ends before video');
});
</script>