let fakeWindow = { /* eslint-disable object-shorthand */
VTTCue: function () {},
VTTRegion: function () {}, /* eslint-enable object-shorthand */
};
// We have a better parser check in WPT. Here I want to check that incomplete // lines are correctly parsable.
let tests = [ // Signature
{ input: ["WEBVTT"], cue: 0, region: 0 },
{ input: ["", "WE", "BVT", "T"], cue: 0, region: 0 },
{ input: ["WEBVTT - This file has no cues."], cue: 0, region: 0 },
{ input: ["WEBVTT", " - ", "This file has no cues."], cue: 0, region: 0 },
// Body with IDs
{
input: [ "WEB", "VTT - This file has cues.\n", "\n", "14\n", "00:01:14", ".815 --> 00:0", "1:18.114\n", "- What?\n", "- Where are we now?\n", "\n", "15\n", "00:01:18.171 --> 00:01:20.991\n", "- T", "his is big bat country.\n", "\n", "16\n", "00:01:21.058 --> 00:01:23.868\n", "- [ Bat", "s Screeching ]\n", "- They won't get in your hair. They're after the bug", "s.\n",
],
cue: 3,
region: 0,
},
// Body without IDs
{
input: [ "WEBVTT - This file has c", "ues.\n", "\n", "00:01:14.815 --> 00:01:18.114\n", "- What?\n", "- Where are we now?\n", "\n", "00:01:18.171 --> 00:01:2", "0.991\n", "- ", "This is big bat country.\n", "\n", "00:01:21.058 --> 00:01:23.868\n", "- [ Bats S", "creeching ]\n", "- They won't get in your hair. They're after the bugs.\n",
],
cue: 3,
region: 0,
},
// Note
{
input: ["WEBVTT - This file has no cues.\n", "\n", "NOTE what"],
cue: 0,
region: 0,
},
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.