Update web-platform-tests to revision 0d318188757a9c996e20b82db201fd04de5aa255

This commit is contained in:
James Graham 2015-03-27 09:15:38 +00:00
parent b2a5225831
commit 1a81b18b9f
12321 changed files with 544385 additions and 6 deletions

View file

@ -0,0 +1,96 @@
<!doctype html>
<title>WebVTT parser tests</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
setup({explicit_done: true});
var files = [];
var path = 'support/';
var cueDefaults = {
"id":"",
"startTime":0,
"endTime":1,
"pauseOnExit":false,
//"vertical":"", (not supported)
"snapToLines":true,
"line":-1,
"position":50,
"size":100,
"align":"middle"
}
var cueCounts;
(function(){
var xhr = new XMLHttpRequest();
xhr.open('GET', path+'cue-counts.json', true);
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
cueCounts = JSON.parse(xhr.responseText);
for (var file in cueCounts) {
files.push(file);
}
startTests();
}
}
xhr.send();
})();
function checkProps(cue, exp, i) {
for (var prop in cueDefaults) {
if (!(prop in exp))
exp[prop] = cueDefaults[prop];
assert_equals(cue[prop], exp[prop], prop + ' (cue '+(i+1)+')');
}
}
function startTests() {
files.forEach(function(file) {
var t = async_test(document.title+', '+file);
t.step(function(){
var video = document.createElement('video');
var track = document.createElement('track');
assert_true('src' in track, 'track element not supported');
track.src = path + file;
track['default'] = true;
track.kind = 'subtitles';
track.onload = this.step_func(trackLoaded);
track.onerror = this.step_func(trackError);
video.appendChild(track);
document.body.appendChild(video);
});
});
done();
}
function trackLoaded(e) {
var track = e.target;
var video = track.parentNode;
setTimeout(removeElm, 0, video);
var cues = video.textTracks[0].cues;
var file = track.src.substr(track.src.lastIndexOf('/') + 1);
assert_equals(cues.length, cueCounts[file], 'number of cues');
var expected;
var cue;
for (var i = 0; i < cues.length; ++i) {
cue = cues[i];
expected = JSON.parse(cue.text);
assert_not_equals(expected, 'FAIL', 'cue '+(i+1)+' should have been dropped');
checkProps(cue, expected, i);
}
this.done();
}
function trackError(e) {
var track = e.target;
var video = track.parentNode;
setTimeout(removeElm, 0, video);
var file = track.src.substr(track.src.lastIndexOf('/') + 1);
assert_equals('error', cueCounts[file], 'got unexpected error event');
this.done();
}
function removeElm(elm) {
document.body.removeChild(elm);
}
</script>

View file

@ -0,0 +1,19 @@
WEBVTT
-->
00:00:00.000 --> 00:00:01.000
{}
foo-->
00:00:00.000 --> 00:00:01.000
{}
-->foo
00:00:00.000 --> 00:00:01.000
{}
--->
00:00:00.000 --> 00:00:01.000
{}
-->-->
00:00:00.000 --> 00:00:01.000
{}
00:00:00.000 --> 00:00:01.000
{}

View file

@ -0,0 +1,36 @@
{"settings-vertical.vtt":6,
"settings-size.vtt":12,
"settings-position.vtt":13,
"settings-multiple.vtt":2,
"settings-line.vtt":29,
"settings-align.vtt":9,
"signature-bom.vtt":0,
"signature-space.vtt":0,
"signature-space-no-newline.vtt":0,
"signature-tab.vtt":0,
"signature-tab-no-newline.vtt":0,
"signature-timings.vtt":0,
"signature-two-boms.vtt":"error",
"signature-lowercase.vtt":"error",
"signature-too-short.vtt":"error",
"signature-websrt.vtt":"error",
"signature-formfeed.vtt":"error",
"signature-null.vtt":"error",
"signature-no-newline.vtt":0,
"no-signature.vtt":"error",
"nulls.vtt":7,
"header-garbage.vtt":1,
"header-timings.vtt":1,
"header-space.vtt":1,
"header-tab.vtt":1,
"ids.vtt":5,
"arrows.vtt":6,
"space-chars.vtt":3,
"timings-garbage.vtt":0,
"timings-too-short.vtt":2,
"timings-too-long.vtt":2,
"newlines.vtt":4,
"omitted-hours.vtt":3,
"timings-60.vtt":2,
"timings-negative.vtt":4
}

View file

@ -0,0 +1,5 @@
WEBVTT
foobar
00:00:00.000 --> 00:00:01.000
{}

View file

@ -0,0 +1,4 @@
WEBVTT
00:00:00.000 --> 00:00:01.000
{}

View file

@ -0,0 +1,4 @@
WEBVTT
00:00:00.000 --> 00:00:01.000
{}

View file

@ -0,0 +1,3 @@
WEBVTT
00:00:00.000 --> 00:00:01.000
{}

View file

@ -0,0 +1,21 @@
WEBVTT
leading space
00:00:00.000 --> 00:00:01.000
{"id":" leading space"}
trailing space
00:00:00.000 --> 00:00:01.000
{"id":"trailing space "}
-- >
00:00:00.000 --> 00:00:01.000
{"id":"-- >"}
->
00:00:00.000 --> 00:00:01.000
{"id":"->"}
00:00:00.000 --> 00:00:01.000
{"id":" "}

View file

@ -0,0 +1,12 @@
WEBVTT cr 00:00:00.000 --> 00:00:01.000 {"id":"cr"}
lf
00:00:00.000 --> 00:00:01.000
{"id":"lf"}
crlf
00:00:00.000 --> 00:00:01.000
{"id":"crlf"}
lfcr 00:00:00.000 --> 00:00:01.000
{"id":"lfcr"}

View file

@ -0,0 +1,2 @@
00:00:00.000 --> 00:00:01.000
"FAIL"

View file

@ -0,0 +1,10 @@
WEBVTT
00:00.000 --> 00:00:01.000
{}
00:00:00.000 --> 00:01.000
{}
00:00.000 --> 00:01.000
{}

View file

@ -0,0 +1,88 @@
WEBVTT
00:00:00.000 --> 00:00:01.000 line:-1
{"line":-1}
00:00:00.000 --> 00:00:01.000 line:0
{"line":0}
00:00:00.000 --> 00:00:01.000 line:-0
{"line":0}
00:00:00.000 --> 00:00:01.000 line:1
{"line":1}
00:00:00.000 --> 00:00:01.000 line:100
{"line":100}
00:00:00.000 --> 00:00:01.000 line:101
{"line":101}
00:00:00.000 --> 00:00:01.000 line:65536
{"line":65536}
00:00:00.000 --> 00:00:01.000 line:4294967296
{"line":2147483647}
00:00:00.000 --> 00:00:01.000 line:18446744073709552000
{"line":2147483647}
00:00:00.000 --> 00:00:01.000 line:10000000000000000000000000000000000
{"line":2147483647}
00:00:00.000 --> 00:00:01.000 line:65536%
{}
00:00:00.000 --> 00:00:01.000 line:4294967296%
{}
00:00:00.000 --> 00:00:01.000 line:18446744073709552000%
{}
00:00:00.000 --> 00:00:01.000 line:10000000000000000000000000000000000%
{}
00:00:00.000 --> 00:00:01.000 line:1.5
{}
00:00:00.000 --> 00:00:01.000 line:0%
{"snapToLines":false, "line":0}
00:00:00.000 --> 00:00:01.000 line:-0%
{}
00:00:00.000 --> 00:00:01.000 line:101%
{}
00:00:00.000 --> 00:00:01.000 line:100%
{"snapToLines":false, "line":100}
00:00:00.000 --> 00:00:01.000 line:1%-
{}
00:00:00.000 --> 00:00:01.000 line:1-
{}
00:00:00.000 --> 00:00:01.000 line:%1
{}
00:00:00.000 --> 00:00:01.000 line:1%%
{}
00:00:00.000 --> 00:00:01.000 line:00%
{"snapToLines":false, "line":0}
00:00:00.000 --> 00:00:01.000 line:0%0
{}
00:00:00.000 --> 00:00:01.000 line: 0%
{}
00:00:00.000 --> 00:00:01.000 line:0%x
{}
00:00:00.000 --> 00:00:01.000 line:-
{}
00:00:00.000 --> 00:00:01.000 line:%
{}

View file

@ -0,0 +1,16 @@
WEBVTT
00:00:00.000 --> 00:00:01.000 align:start line:1% vertical:lr size:50% position:25%
{"align":"start",
"line":1,
"snapToLines":false,
"vertical":"lr",
"size":50,
"position":25}
00:00:00.000 --> 00:00:01.000 align:middle line:1 vertical:rl size:0% position:100%
{"align":"middle",
"line":1,
"vertical":"rl",
"size":0,
"position":100}

View file

@ -0,0 +1,40 @@
WEBVTT
00:00:00.000 --> 00:00:01.000 position:-1%
{}
00:00:00.000 --> 00:00:01.000 position:1
{}
00:00:00.000 --> 00:00:01.000 position:1x
{}
00:00:00.000 --> 00:00:01.000 position:1%x
{}
00:00:00.000 --> 00:00:01.000 position:
{}
00:00:00.000 --> 00:00:01.000 position: 1%
{}
00:00:00.000 --> 00:00:01.000 position:1%
{"position":1}
00:00:00.000 --> 00:00:01.000 position:100%
{"position":100}
00:00:00.000 --> 00:00:01.000 position:101%
{}
00:00:00.000 --> 00:00:01.000 position:1% position:x
{"position":1}
00:00:00.000 --> 00:00:01.000 position:1.5%
{}
00:00:00.000 --> 00:00:01.000 position:65536%
{}
00:00:00.000 --> 00:00:01.000 position:4294967296%
{}

View file

@ -0,0 +1,37 @@
WEBVTT
00:00:00.000 --> 00:00:01.000 size:
{}
00:00:00.000 --> 00:00:01.000 size:x
{}
00:00:00.000 --> 00:00:01.000 size:1xx size:2%
{"size":2}
00:00:00.000 --> 00:00:01.000 size:%
{}
00:00:00.000 --> 00:00:01.000 size:%%
{}
00:00:00.000 --> 00:00:01.000 size:1%%
{}
00:00:00.000 --> 00:00:01.000 size:1%x
{}
00:00:00.000 --> 00:00:01.000 size:0%
{"size":0}
00:00:00.000 --> 00:00:01.000 size:00%
{"size":0}
00:00:00.000 --> 00:00:01.000 size:50% size:100%
{"size":100}
00:00:00.000 --> 00:00:01.000 size:101%
{}
00:00:00.000 --> 00:00:01.000 size:50% size:101%
{"size":50}

View file

@ -0,0 +1,19 @@
WEBVTT
00:00:00.000 --> 00:00:01.000 vertical:lr
{"vertical":"lr"}
00:00:00.000 --> 00:00:01.000 vertical:rl
{"vertical":"rl"}
00:00:00.000 --> 00:00:01.000 vertical:rl vertical:lr
{"vertical":"lr"}
00:00:00.000 --> 00:00:01.000 vertical:
{}
00:00:00.000 --> 00:00:01.000 vertical:RL
{}
00:00:00.000 --> 00:00:01.000 vertical:vertical-rl
{}

View file

@ -0,0 +1,2 @@
WEBVTT 00:00:00.000 --> 00:00:01.000
"FAIL"

View file

@ -0,0 +1,17 @@
WEBVTT
spaces
00:00:00.000 --> 00:00:01.000
{"id":"spaces"}
tabs
00:00:00.000 --> 00:00:01.000
{"id":"tabs"}
form feed
00:00:00.000 --> 00:00:01.000
{"id":"form feed"}
vertical tab
00:00:00.000 --> 00:00:01.000
"FAIL"

View file

@ -0,0 +1,20 @@
WEBVTT
00:00:60.000 --> 00:00:01.000
"FAIL"
00:60:00.000 --> 00:00:01.000
"FAIL"
00:00:00.000 --> 00:00:60.000
"FAIL"
00:00:00.000 --> 00:60:00.000
"FAIL"
00:00:00.000 --> 60:00:01.000
{"endTime":216001}
60:00:00.000 --> 60:00:01.000
{"startTime":216000,
"endTime":216001}

View file

@ -0,0 +1,190 @@
WEBVTT
x00:00:00.000 --> 00:00:01.000
"FAIL"
0x0:00:00.000 --> 00:00:01.000
"FAIL"
00x:00:00.000 --> 00:00:01.000
"FAIL"
00:x00:00.000 --> 00:00:01.000
"FAIL"
00:0x0:00.000 --> 00:00:01.000
"FAIL"
00:00x:00.000 --> 00:00:01.000
"FAIL"
00:00:x00.000 --> 00:00:01.000
"FAIL"
00:00:0x0.000 --> 00:00:01.000
"FAIL"
00:00:00x.000 --> 00:00:01.000
"FAIL"
00:00:00.x000 --> 00:00:01.000
"FAIL"
00:00:00.0x00 --> 00:00:01.000
"FAIL"
00:00:00.00x0 --> 00:00:01.000
"FAIL"
00:00:00.000x --> 00:00:01.000
"FAIL"
00:00:00.000 x--> 00:00:01.000
"FAIL"
00:00:00.000 -x-> 00:00:01.000
"FAIL"
00:00:00.000 --x> 00:00:01.000
"FAIL"
00:00:00.000 -->x 00:00:01.000
"FAIL"
00:00:00.000 --> x00:00:01.000
"FAIL"
00:00:00.000 --> 0x0:00:01.000
"FAIL"
00:00:00.000 --> 00x:00:01.000
"FAIL"
00:00:00.000 --> 00:x00:01.000
"FAIL"
00:00:00.000 --> 00:0x0:01.000
"FAIL"
00:00:00.000 --> 00:00x:01.000
"FAIL"
00:00:00.000 --> 00:00:x01.000
"FAIL"
00:00:00.000 --> 00:00:0x1.000
"FAIL"
00:00:00.000 --> 00:00:01x.000
"FAIL"
00:00:00.000 --> 00:00:01.x000
"FAIL"
00:00:00.000 --> 00:00:01.0x00
"FAIL"
00:00:00.000 --> 00:00:01.00x0
"FAIL"
x0:00:00.000 --> 00:00:01.000
"FAIL"
0x:00:00.000 --> 00:00:01.000
"FAIL"
00x00:00.000 --> 00:00:01.000
"FAIL"
00:x0:00.000 --> 00:00:01.000
"FAIL"
00:0x:00.000 --> 00:00:01.000
"FAIL"
00:00x00.000 --> 00:00:01.000
"FAIL"
00:00:x0.000 --> 00:00:01.000
"FAIL"
00:00:0x.000 --> 00:00:01.000
"FAIL"
00:00:00x000 --> 00:00:01.000
"FAIL"
00:00:00.x00 --> 00:00:01.000
"FAIL"
00:00:00.0x0 --> 00:00:01.000
"FAIL"
00:00:00.00x --> 00:00:01.000
"FAIL"
00:00:00.000x--> 00:00:01.000
"FAIL"
00:00:00.000 x-> 00:00:01.000
"FAIL"
00:00:00.000 -x> 00:00:01.000
"FAIL"
00:00:00.000 --x 00:00:01.000
"FAIL"
00:00:00.000 -->x00:00:01.000
"FAIL"
00:00:00.000 --> x0:00:01.000
"FAIL"
00:00:00.000 --> 0x:00:01.000
"FAIL"
00:00:00.000 --> 00x00:01.000
"FAIL"
00:00:00.000 --> 00:x0:01.000
"FAIL"
00:00:00.000 --> 00:0x:01.000
"FAIL"
00:00:00.000 --> 00:00x01.000
"FAIL"
00:00:00.000 --> 00:00:x1.000
"FAIL"
00:00:00.000 --> 00:00:0x.000
"FAIL"
00:00:00.000 --> 00:00:01x000
"FAIL"
00:00:00.000 --> 00:00:01.x00
"FAIL"
00:00:00.000 --> 00:00:01.0x0
"FAIL"
00:00:00.000 --> 00:00:01.00x
"FAIL"
00.00:00.000 --> 00:00:01.000
"FAIL"
00:00.00.000 --> 00:00:01.000
"FAIL"
00:00:00:000 --> 00:00:01.000
"FAIL"
00:00.00:000 --> 00:00:01.000
"FAIL"
00:00:00,000 --> 00:00:01,000
"FAIL"

View file

@ -0,0 +1,13 @@
WEBVTT
00:00:00.000 --> 00:00:00.000
{"endTime":0}
00:00:01.000 --> 00:00:00.999
{"startTime":1, "endTime":0.999}
00:01:00.000 --> 00:00:59.999
{"startTime":60, "endTime":59.999}
01:00:00.000 --> 00:59:59.999
{"startTime":3600, "endTime":3599.999}

View file

@ -0,0 +1,47 @@
WEBVTT
000:00:00.000 --> 00:00:01.000
{}
00::00:00.000 --> 00:00:01.000
"FAIL"
00:000:00.000 --> 00:00:01.000
"FAIL"
00:00::00.000 --> 00:00:01.000
"FAIL"
00:00:000.000 --> 00:00:01.000
"FAIL"
00:00:00..000 --> 00:00:01.000
"FAIL"
00:00:00.0000 --> 00:00:01.000
"FAIL"
00:00.0000 --> 00:00:01.000
"FAIL"
000:00.000 --> 00:01.000
"FAIL"
00::00.000 --> 00:01.000
"FAIL"
00:000.000 --> 00:01.000
"FAIL"
00:00..000 --> 00:01.000
"FAIL"
00:00.0000 --> 00:01.000
"FAIL"
00:00.000 --> 000:01.000
"FAIL"
00:00:00.000 --> 000:00:01.000
{}

View file

@ -0,0 +1,98 @@
WEBVTT
0:00:00.000 --> 00:00:01.000
{}
0000:00.000 --> 00:00:01.000
"FAIL"
00:0:00.000 --> 00:00:01.000
"FAIL"
00:0000.000 --> 00:00:01.000
"FAIL"
00:00:0.000 --> 00:00:01.000
"FAIL"
00:00:00000 --> 00:00:01.000
"FAIL"
00:00:00.00 --> 00:00:01.000
"FAIL"
00:00:00.0 --> 00:00:01.000
"FAIL"
00:00:00. --> 00:00:01.000
"FAIL"
00:00:00 --> 00:00:01.000
"FAIL"
00:00:0 --> 00:00:01.000
"FAIL"
00:00: --> 00:00:01.000
"FAIL"
00:00 --> 00:00:01.000
"FAIL"
00:0 --> 00:00:01.000
"FAIL"
00: --> 00:00:01.000
"FAIL"
00 --> 00:00:01.000
"FAIL"
0 --> 00:00:01.000
"FAIL"
--> 00:00:01.000
"FAIL"
0:00.000 --> 00:01.000
"FAIL"
0000.000 --> 00:01.000
"FAIL"
00:0.000 --> 00:01.000
"FAIL"
00:00000 --> 00:01.000
"FAIL"
00:00.00 --> 00:01.000
"FAIL"
00:00.0 --> 00:01.000
"FAIL"
00:00. --> 00:01.000
"FAIL"
0:00. --> 00:01.000
"FAIL"
:00. --> 00:01.000
"FAIL"
00. --> 00:01.000
"FAIL"
0. --> 00:01.000
"FAIL"
. --> 00:01.000
"FAIL"
00:00.000 --> 0:01.000
"FAIL"
00:00:00.000 --> 0:00:01.000
{}