Commit 25261d93 authored by vrk@chromium.org's avatar vrk@chromium.org

Tests for validating a new WebVTT parser and tokenizer for TextTrackCue content.

https://bugs.webkit.org/show_bug.cgi?id=65884

Patch by Anna Cavender <annacc@chromium.org> on 2011-08-25
Reviewed by Eric Carlson.

* media/track/captions-webvtt/tc000-empty.vtt: Renamed from media/track/captions/tc000_empty.vtt.
* media/track/captions-webvtt/tc001-iso2022jp3.vtt: Renamed from media/track/captions/tc001_iso2022jp3.vtt.
* media/track/captions-webvtt/tc001-utf8.vtt: Renamed from media/track/captions/tc001_utf8.vtt.
* media/track/captions-webvtt/tc002-bom.vtt: Renamed from media/track/captions/tc002_bom.vtt.
* media/track/captions-webvtt/tc003-newlines.vtt: Renamed from media/track/captions/tc003_newlines.vtt
* media/track/captions-webvtt/tc003-no-newline-at-eof.vtt: Renamed from media/track/captions/tc003_nonewlineateof.vtt
* media/track/captions-webvtt/tc004-no-webvtt.vtt: Renamed from media/track/captions/tc004_nowebvtt.vtt.
* media/track/captions-webvtt/tc004-webvtt-file.vtt: Renamed from media/track/captions/tc004_webvttfile.vtt.
* media/track/captions-webvtt/tc004-webvtt-rubbish.vtt: Renamed from media/track/captions/tc004_webvttrubbish.vtt.
* media/track/captions-webvtt/tc005-default-styles.vtt: Renamed from media/track/captions/tc005_defaultstyles.vtt.
* media/track/captions-webvtt/tc005-metadata-area.vtt: Renamed from media/track/captions/tc005_metadataarea.vtt.
* media/track/captions-webvtt/tc006-cue-id-error.vtt: Renamed from media/track/captions/tc006_cueiderror.vtt.
* media/track/captions-webvtt/tc006-cue-id.vtt: Renamed from media/track/captions/tc006_cueid.vtt.
* media/track/captions-webvtt/tc007-cue-no-id-error.vtt: Renamed from media/track/captions/tc007_cuenoid.vtt.
* media/track/captions-webvtt/tc007-cue-no-id.vtt: Renamed from media/track/captions/tc007_cuenoiderror.vtt.
* media/track/captions-webvtt/tc008-timings-no-hour-errors.vtt: Renamed from media/track/captions/tc008_timingsnohourerrors.vtt.
* media/track/captions-webvtt/tc008-timings-no-hour.vtt: Renamed from media/track/captions/tc008_timingsnohour.vtt.
* media/track/captions-webvtt/tc009-timings-hour-error.vtt: Renamed from media/track/captions/tc009_timingshourerror.vtt.
* media/track/captions-webvtt/tc009-timings-hour.vtt: Renamed from media/track/captions/tc009_timingshour.vtt.
* media/track/captions-webvtt/tc010-no-timings.vtt: Renamed from media/track/captions/tc010_notimings.vtt.
* media/track/captions-webvtt/tc011-cues-no-separation.vtt: Copied from media/track/captions/tc011_cuesnosep.vtt.
* media/track/captions-webvtt/tc011-cues.vtt: Renamed from media/track/captions/tc011_cues.vtt.
* media/track/captions-webvtt/tc012-out-of-order.vtt: Renamed from media/track/captions/tc012_outoforder.vtt.
* media/track/captions-webvtt/tc013-settings-bad-separation.vtt: Renamed from media/track/captions/tc013_settingsbadsep.vtt.
* media/track/captions-webvtt/tc013-settings.vtt: Renamed from media/track/captions/tc013_settings.vtt.
* media/track/captions-webvtt/tc014-alignment-bad.vtt: Added.
* media/track/captions-webvtt/tc014-alignment-ltr.vtt: Added.
* media/track/captions-webvtt/tc014-alignment.vtt: Added.
* media/track/captions-webvtt/tc015-positioning-bad.vtt: Added.
* media/track/captions-webvtt/tc015-positioning-ltr.vtt: Added.
* media/track/captions-webvtt/tc015-positioning.vtt: Added.
* media/track/captions-webvtt/tc016-align-positioning-bad.vtt: Added.
* media/track/captions-webvtt/tc016-align-positioning.vtt: Added.
* media/track/captions-webvtt/tc017-line-position-bad.vtt: Added.
* media/track/captions-webvtt/tc017-line-position.vtt: Added.
* media/track/captions-webvtt/tc018-align-text-line-position-bad.vtt: Added.
* media/track/captions-webvtt/tc018-align-text-line-position.vtt: Added.
* media/track/captions-webvtt/tc019-cue-size-bad.vtt: Added.
* media/track/captions-webvtt/tc019-cue-size.vtt: Added.
* media/track/captions-webvtt/tc020-cue-size-align-bad.vtt: Added.
* media/track/captions-webvtt/tc020-cue-size-align.vtt: Added.
* media/track/captions-webvtt/tc021-valign-bad.vtt: Added.
* media/track/captions-webvtt/tc021-valign-ltr.vtt: Added.
* media/track/captions-webvtt/tc021-valign.vtt: Added.
* media/track/captions-webvtt/tc022-entities-wrong.vtt: Added.
* media/track/captions-webvtt/tc022-entities.vtt: Added.
* media/track/captions-webvtt/tc023-markup-bad.vtt: Added.
* media/track/captions-webvtt/tc023-markup.vtt: Added.
* media/track/captions-webvtt/tc024-timestamp-bad.vtt: Added.
* media/track/captions-webvtt/tc024-timestamp.vtt: Added.
* media/track/captions-webvtt/tc025-class-bad.vtt: Added.
* media/track/captions-webvtt/tc025-class.vtt: Added.
* media/track/captions-webvtt/tc026-voice-bad.vtt: Added.
* media/track/captions-webvtt/tc026-voice.vtt: Added.
* media/track/captions-webvtt/tc027-empty-cue.vtt: Added.
* media/track/captions-webvtt/tc028-unsupported-markup.vtt: Added.
* media/track/track-webvtt-tc000-empty.html:
* media/track/track-webvtt-tc001-utf8-expected.txt:
* media/track/track-webvtt-tc001-utf8.html:
* media/track/track-webvtt-tc002-bom-expected.txt:
* media/track/track-webvtt-tc002-bom.html:
* media/track/track-webvtt-tc003-newlines-expected.txt:
* media/track/track-webvtt-tc003-newlines.html:
* media/track/track-webvtt-tc004-magic-header-expected.txt: Renamed from media/track/track-webvtt-tc004-magicheader-expected.txt.
* media/track/track-webvtt-tc004-magic-header.html: Renamed from media/track/track-webvtt-tc004-magicheader.html.
* media/track/track-webvtt-tc005-header-comment-expected.txt: Renamed from media/track/track-webvtt-tc005-headercomment-expected.txt.
* media/track/track-webvtt-tc005-header-comment.html: Renamed from media/track/track-webvtt-tc005-headercomment.html.
* media/track/track-webvtt-tc006-cue-identifiers-expected.txt: Renamed from media/track/track-webvtt-tc006-cueidentifiers-expected.txt.
* media/track/track-webvtt-tc006-cue-identifiers.html: Renamed from media/track/track-webvtt-tc006-cueidentifiers.html.
* media/track/track-webvtt-tc007-cue-no-id-expected.txt: Renamed from media/track/track-webvtt-tc007-cuenoid-expected.txt.
* media/track/track-webvtt-tc007-cue-no-id.html: Renamed media/track/track-webvtt-tc007-cuenoid.html.
* media/track/track-webvtt-tc008-timings-no-hours-expected.txt: Renamed from media/track/track-webvtt-tc008-timingsnohours-expected.txt.
* media/track/track-webvtt-tc008-timings-no-hours.html: Renamed from media/track/track-webvtt-tc008-timingsnohours.html.
* media/track/track-webvtt-tc009-timings-hour-expected.txt: Renamed from media/track/track-webvtt-tc009-timingshour-expected.txt.
* media/track/track-webvtt-tc009-timings-hour.html: Renamed from media/track/track-webvtt-tc009-timingshour.html.
* media/track/track-webvtt-tc010-no-timings-expected.txt: Copied from media/track/track-webvtt-tc010-notimings-expected.txt.
* media/track/track-webvtt-tc010-no-timings.html: Renamed from media/track/track-webvtt-tc012-outoforder.html.
* media/track/track-webvtt-tc011-blank-lines-expected.txt: Renamed from media/track/track-webvtt-tc011-blanklines-expected.txt.
* media/track/track-webvtt-tc011-blank-lines.html: Renamed from media/track/track-webvtt-tc011-blanklines.html.
* media/track/track-webvtt-tc012-out-of-order-expected.txt: Renamed from media/track/track-webvtt-tc012-outoforder-expected.txt.
* media/track/track-webvtt-tc012-out-of-order.html: Copied from media/track/track-webvtt-tc000-empty.html.
* media/track/track-webvtt-tc013-settings-expected.txt:
* media/track/track-webvtt-tc013-settings.html:
* media/track/track-webvtt-tc014-alignment-expected.txt: Added.
* media/track/track-webvtt-tc014-alignment.html: Added.
* media/track/track-webvtt-tc015-positioning-expected.txt: Added.
* media/track/track-webvtt-tc015-positioning.html: Added.
* media/track/track-webvtt-tc016-align-positioning-expected.txt: Added.
* media/track/track-webvtt-tc016-align-positioning.html: Added.
* media/track/track-webvtt-tc017-line-position-expected.txt: Added.
* media/track/track-webvtt-tc017-line-position.html: Added.
* media/track/track-webvtt-tc018-align-text-line-position-expected.txt: Added.
* media/track/track-webvtt-tc018-align-text-line-position.html: Added.
* media/track/track-webvtt-tc019-cue-size-expected.txt: Added.
* media/track/track-webvtt-tc019-cue-size.html: Added.
* media/track/track-webvtt-tc020-cue-size-align-expected.txt: Added.
* media/track/track-webvtt-tc020-cue-size-align.html: Added.
* media/track/track-webvtt-tc021-valign-expected.txt: Added.
* media/track/track-webvtt-tc021-valign.html: Added.
* media/track/track-webvtt-tc022-entities-expected.txt: Added.
* media/track/track-webvtt-tc022-entities.html: Added.
* media/track/track-webvtt-tc023-markup-expected.txt: Added.
* media/track/track-webvtt-tc023-markup.html: Added.
* media/track/track-webvtt-tc024-timestamp-expected.txt: Added.
* media/track/track-webvtt-tc024-timestamp.html: Added.
* media/track/track-webvtt-tc025-class-markup-expected.txt: Added.
* media/track/track-webvtt-tc025-class-markup.html: Added.
* media/track/track-webvtt-tc026-voice-expected.txt: Added.
* media/track/track-webvtt-tc026-voice.html: Added.
* media/track/track-webvtt-tc027-empty-cue-expected.txt: Added.
* media/track/track-webvtt-tc027-empty-cue.html: Added.
* media/track/track-webvtt-tc028-unsupported-markup-expected.txt: Added.
* media/track/track-webvtt-tc028-unsupported-markup.html: Added.
* media/video-test.js:
(testCues):
(allTestsEnded):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@93885 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2ca257c5
2011-08-25 Anna Cavender <annacc@chromium.org>
Tests for validating a new WebVTT parser and tokenizer for TextTrackCue content.
https://bugs.webkit.org/show_bug.cgi?id=65884
Reviewed by Eric Carlson.
* media/track/captions-webvtt/tc000-empty.vtt: Renamed from media/track/captions/tc000_empty.vtt.
* media/track/captions-webvtt/tc001-iso2022jp3.vtt: Renamed from media/track/captions/tc001_iso2022jp3.vtt.
* media/track/captions-webvtt/tc001-utf8.vtt: Renamed from media/track/captions/tc001_utf8.vtt.
* media/track/captions-webvtt/tc002-bom.vtt: Renamed from media/track/captions/tc002_bom.vtt.
* media/track/captions-webvtt/tc003-newlines.vtt: Renamed from media/track/captions/tc003_newlines.vtt
* media/track/captions-webvtt/tc003-no-newline-at-eof.vtt: Renamed from media/track/captions/tc003_nonewlineateof.vtt
* media/track/captions-webvtt/tc004-no-webvtt.vtt: Renamed from media/track/captions/tc004_nowebvtt.vtt.
* media/track/captions-webvtt/tc004-webvtt-file.vtt: Renamed from media/track/captions/tc004_webvttfile.vtt.
* media/track/captions-webvtt/tc004-webvtt-rubbish.vtt: Renamed from media/track/captions/tc004_webvttrubbish.vtt.
* media/track/captions-webvtt/tc005-default-styles.vtt: Renamed from media/track/captions/tc005_defaultstyles.vtt.
* media/track/captions-webvtt/tc005-metadata-area.vtt: Renamed from media/track/captions/tc005_metadataarea.vtt.
* media/track/captions-webvtt/tc006-cue-id-error.vtt: Renamed from media/track/captions/tc006_cueiderror.vtt.
* media/track/captions-webvtt/tc006-cue-id.vtt: Renamed from media/track/captions/tc006_cueid.vtt.
* media/track/captions-webvtt/tc007-cue-no-id-error.vtt: Renamed from media/track/captions/tc007_cuenoid.vtt.
* media/track/captions-webvtt/tc007-cue-no-id.vtt: Renamed from media/track/captions/tc007_cuenoiderror.vtt.
* media/track/captions-webvtt/tc008-timings-no-hour-errors.vtt: Renamed from media/track/captions/tc008_timingsnohourerrors.vtt.
* media/track/captions-webvtt/tc008-timings-no-hour.vtt: Renamed from media/track/captions/tc008_timingsnohour.vtt.
* media/track/captions-webvtt/tc009-timings-hour-error.vtt: Renamed from media/track/captions/tc009_timingshourerror.vtt.
* media/track/captions-webvtt/tc009-timings-hour.vtt: Renamed from media/track/captions/tc009_timingshour.vtt.
* media/track/captions-webvtt/tc010-no-timings.vtt: Renamed from media/track/captions/tc010_notimings.vtt.
* media/track/captions-webvtt/tc011-cues-no-separation.vtt: Copied from media/track/captions/tc011_cuesnosep.vtt.
* media/track/captions-webvtt/tc011-cues.vtt: Renamed from media/track/captions/tc011_cues.vtt.
* media/track/captions-webvtt/tc012-out-of-order.vtt: Renamed from media/track/captions/tc012_outoforder.vtt.
* media/track/captions-webvtt/tc013-settings-bad-separation.vtt: Renamed from media/track/captions/tc013_settingsbadsep.vtt.
* media/track/captions-webvtt/tc013-settings.vtt: Renamed from media/track/captions/tc013_settings.vtt.
* media/track/captions-webvtt/tc014-alignment-bad.vtt: Added.
* media/track/captions-webvtt/tc014-alignment-ltr.vtt: Added.
* media/track/captions-webvtt/tc014-alignment.vtt: Added.
* media/track/captions-webvtt/tc015-positioning-bad.vtt: Added.
* media/track/captions-webvtt/tc015-positioning-ltr.vtt: Added.
* media/track/captions-webvtt/tc015-positioning.vtt: Added.
* media/track/captions-webvtt/tc016-align-positioning-bad.vtt: Added.
* media/track/captions-webvtt/tc016-align-positioning.vtt: Added.
* media/track/captions-webvtt/tc017-line-position-bad.vtt: Added.
* media/track/captions-webvtt/tc017-line-position.vtt: Added.
* media/track/captions-webvtt/tc018-align-text-line-position-bad.vtt: Added.
* media/track/captions-webvtt/tc018-align-text-line-position.vtt: Added.
* media/track/captions-webvtt/tc019-cue-size-bad.vtt: Added.
* media/track/captions-webvtt/tc019-cue-size.vtt: Added.
* media/track/captions-webvtt/tc020-cue-size-align-bad.vtt: Added.
* media/track/captions-webvtt/tc020-cue-size-align.vtt: Added.
* media/track/captions-webvtt/tc021-valign-bad.vtt: Added.
* media/track/captions-webvtt/tc021-valign-ltr.vtt: Added.
* media/track/captions-webvtt/tc021-valign.vtt: Added.
* media/track/captions-webvtt/tc022-entities-wrong.vtt: Added.
* media/track/captions-webvtt/tc022-entities.vtt: Added.
* media/track/captions-webvtt/tc023-markup-bad.vtt: Added.
* media/track/captions-webvtt/tc023-markup.vtt: Added.
* media/track/captions-webvtt/tc024-timestamp-bad.vtt: Added.
* media/track/captions-webvtt/tc024-timestamp.vtt: Added.
* media/track/captions-webvtt/tc025-class-bad.vtt: Added.
* media/track/captions-webvtt/tc025-class.vtt: Added.
* media/track/captions-webvtt/tc026-voice-bad.vtt: Added.
* media/track/captions-webvtt/tc026-voice.vtt: Added.
* media/track/captions-webvtt/tc027-empty-cue.vtt: Added.
* media/track/captions-webvtt/tc028-unsupported-markup.vtt: Added.
* media/track/track-webvtt-tc000-empty.html:
* media/track/track-webvtt-tc001-utf8-expected.txt:
* media/track/track-webvtt-tc001-utf8.html:
* media/track/track-webvtt-tc002-bom-expected.txt:
* media/track/track-webvtt-tc002-bom.html:
* media/track/track-webvtt-tc003-newlines-expected.txt:
* media/track/track-webvtt-tc003-newlines.html:
* media/track/track-webvtt-tc004-magic-header-expected.txt: Renamed from media/track/track-webvtt-tc004-magicheader-expected.txt.
* media/track/track-webvtt-tc004-magic-header.html: Renamed from media/track/track-webvtt-tc004-magicheader.html.
* media/track/track-webvtt-tc005-header-comment-expected.txt: Renamed from media/track/track-webvtt-tc005-headercomment-expected.txt.
* media/track/track-webvtt-tc005-header-comment.html: Renamed from media/track/track-webvtt-tc005-headercomment.html.
* media/track/track-webvtt-tc006-cue-identifiers-expected.txt: Renamed from media/track/track-webvtt-tc006-cueidentifiers-expected.txt.
* media/track/track-webvtt-tc006-cue-identifiers.html: Renamed from media/track/track-webvtt-tc006-cueidentifiers.html.
* media/track/track-webvtt-tc007-cue-no-id-expected.txt: Renamed from media/track/track-webvtt-tc007-cuenoid-expected.txt.
* media/track/track-webvtt-tc007-cue-no-id.html: Renamed media/track/track-webvtt-tc007-cuenoid.html.
* media/track/track-webvtt-tc008-timings-no-hours-expected.txt: Renamed from media/track/track-webvtt-tc008-timingsnohours-expected.txt.
* media/track/track-webvtt-tc008-timings-no-hours.html: Renamed from media/track/track-webvtt-tc008-timingsnohours.html.
* media/track/track-webvtt-tc009-timings-hour-expected.txt: Renamed from media/track/track-webvtt-tc009-timingshour-expected.txt.
* media/track/track-webvtt-tc009-timings-hour.html: Renamed from media/track/track-webvtt-tc009-timingshour.html.
* media/track/track-webvtt-tc010-no-timings-expected.txt: Copied from media/track/track-webvtt-tc010-notimings-expected.txt.
* media/track/track-webvtt-tc010-no-timings.html: Renamed from media/track/track-webvtt-tc012-outoforder.html.
* media/track/track-webvtt-tc011-blank-lines-expected.txt: Renamed from media/track/track-webvtt-tc011-blanklines-expected.txt.
* media/track/track-webvtt-tc011-blank-lines.html: Renamed from media/track/track-webvtt-tc011-blanklines.html.
* media/track/track-webvtt-tc012-out-of-order-expected.txt: Renamed from media/track/track-webvtt-tc012-outoforder-expected.txt.
* media/track/track-webvtt-tc012-out-of-order.html: Copied from media/track/track-webvtt-tc000-empty.html.
* media/track/track-webvtt-tc013-settings-expected.txt:
* media/track/track-webvtt-tc013-settings.html:
* media/track/track-webvtt-tc014-alignment-expected.txt: Added.
* media/track/track-webvtt-tc014-alignment.html: Added.
* media/track/track-webvtt-tc015-positioning-expected.txt: Added.
* media/track/track-webvtt-tc015-positioning.html: Added.
* media/track/track-webvtt-tc016-align-positioning-expected.txt: Added.
* media/track/track-webvtt-tc016-align-positioning.html: Added.
* media/track/track-webvtt-tc017-line-position-expected.txt: Added.
* media/track/track-webvtt-tc017-line-position.html: Added.
* media/track/track-webvtt-tc018-align-text-line-position-expected.txt: Added.
* media/track/track-webvtt-tc018-align-text-line-position.html: Added.
* media/track/track-webvtt-tc019-cue-size-expected.txt: Added.
* media/track/track-webvtt-tc019-cue-size.html: Added.
* media/track/track-webvtt-tc020-cue-size-align-expected.txt: Added.
* media/track/track-webvtt-tc020-cue-size-align.html: Added.
* media/track/track-webvtt-tc021-valign-expected.txt: Added.
* media/track/track-webvtt-tc021-valign.html: Added.
* media/track/track-webvtt-tc022-entities-expected.txt: Added.
* media/track/track-webvtt-tc022-entities.html: Added.
* media/track/track-webvtt-tc023-markup-expected.txt: Added.
* media/track/track-webvtt-tc023-markup.html: Added.
* media/track/track-webvtt-tc024-timestamp-expected.txt: Added.
* media/track/track-webvtt-tc024-timestamp.html: Added.
* media/track/track-webvtt-tc025-class-markup-expected.txt: Added.
* media/track/track-webvtt-tc025-class-markup.html: Added.
* media/track/track-webvtt-tc026-voice-expected.txt: Added.
* media/track/track-webvtt-tc026-voice.html: Added.
* media/track/track-webvtt-tc027-empty-cue-expected.txt: Added.
* media/track/track-webvtt-tc027-empty-cue.html: Added.
* media/track/track-webvtt-tc028-unsupported-markup-expected.txt: Added.
* media/track/track-webvtt-tc028-unsupported-markup.html: Added.
* media/video-test.js:
(testCues):
(allTestsEnded):
2011-08-26 Pavel Podivilov <podivilov@chromium.org>
Unreviewed, rolling out r93870.
WEBVTT FILE
1
00:00:00.000 --> 00:00:30.500
$B7J5$H=CG(B
2
00:00:31.000 --> 00:20:00.500
$BEENOITB-(B
WEBVTT
1
00:00:00.000 --> 00:00:30.500
景気判断
2
00:00:31.000 --> 00:20:00.500
電力不足
\ No newline at end of file
WEBVTT FILE
1
00:00:00.000 --> 00:00:30.500
Bear is Coming!!!!!
2
00:00:31.000 --> 00:20:00.500
I said Bear is coming!!!!
\ No newline at end of file
WEBVTT
1
00:00:00.000 --> 00:00:30.500 Bear is Coming!!!!!
WEBVTT 1 00:00:00.000 --> 00:00:30.500 Bear is Coming!!!!!
\ No newline at end of file
AWEBVTT FILE
1
00:00:00.000 --> 00:00:30.500
Bear is Coming!!!!!
2
00:00:31.000 --> 00:20:00.500
I said Bear is coming!!!!
\ No newline at end of file
WEBVTT FILE
1
00:00:00.000 --> 00:00:30.500
Bear is Coming!!!!!
2
00:00:31.000 --> 00:20:00.500
I said Bear is coming!!!!
\ No newline at end of file
WEBVTT asdfasdfauhio
1
00:00:00.000 --> 00:00:30.500
Bear is Coming!!!!!
2
00:00:31.000 --> 00:20:00.500
I said Bear is coming!!!!
\ No newline at end of file
WEBVTT
COMMENT-->
this is a comment, that will parse as part of the header;
the STYLE and DEFAULTS below are parsed as invalid cues
STYLE-->
::cue(.narration) { color: blue; }
DEFAULTS -->
L:-1 A:middle S:50%
1
00:00:00.000 --> 00:00:30.500
Bear is Coming!!!!!
2
00:00:31.000 --> 00:20:00.500
I said Bear is coming!!!!
\ No newline at end of file
WEBVTT
This is where metadata would go and these lines should be skipped.
author = silviapf@google.com
COMMENT-->
this is a comment, that will parse as part of the header;
the STYLE and DEFAULTS below are parsed as invalid cues
1
00:00:00.000 --> 00:00:30.500
Bear is Coming!!!!!
2
00:00:31.000 --> 00:20:00.500
I said Bear is coming!!!!
\ No newline at end of file
WEBVTT
random_id
00:00:00.000 --> 00:00:30.500
Bear is Coming!!!!!
another random identifier
00:00:31.000 --> 00:01:00.500
I said Bear is coming!!!!
identifier--too
00:01:01.000 --> 00:02:00.500
I said Bear is coming now!!!!
identifier--too
00:02:01.000 --> 00:03:00.500
Duplicate identifier
\ No newline at end of file
WEBVTT
-->random_id
00:00:00.000 --> 00:00:30.500
Bear is Coming!!!!!
another random identifier-->
00:00:31.000 --> 00:01:00.500
I said Bear is coming!!!!
identifier-->too
00:01:01.000 --> 00:20:00.500
I said Bear is coming now!!!!
\ No newline at end of file
WEBVTT
00:00:00.000 --> 00:00:30.500
Bear is Coming!!!!!
00:00:31.000 --> 00:01:00.500
I said Bear is coming!!!!
00:01:01.000 --> 00:20:00.500
I said Bear is coming now!!!!
\ No newline at end of file
WEBVTT
-->
00:00:00.000 --> 00:00:30.500
Bear is Coming!!!!!
-->
00:00:31.000 --> 00:01:00.500
I said Bear is coming!!!!
-->
00:01:01.000 --> 00:20:00.500
I said Bear is coming now!!!!
\ No newline at end of file
WEBVTT
1
00:00.000 --> 00:30.500
Bear is Coming!!!!!
2
00:31.000 --> 01:00.500
I said Bear is coming!!!!
3
01:01.000 --> 02:00.500
I said Bear is coming now!!!!
4
02:01.000 --> 03:00.500
tab separators
\ No newline at end of file
WEBVTT
1
00.00.000 --> 00:30.500
Bear is Coming!!!!!
2
00:31.000 --> 01:00:500
I said Bear is coming!!!!
3
01:01.000 --> 120:00.500
I said Bear is coming now!!!!
4
01:01.000 - 02:00.500
I said Bear is coming now!!!!
5
02:01.000 --> 03m:00.500
I said Bear is coming now!!!!
6
03:01.000-->04:00.500
I said Bear is coming now!!!!
\ No newline at end of file
WEBVTT
1
00:00:00.000 --> 00:00:30.500
Bear is Coming!!!!!
2
00:00:31.000 --> 00:01:00.500
I said Bear is coming!!!!
3
00:01:01.000 --> 100:20:00.500
I said Bear is coming now!!!!
\ No newline at end of file
WEBVTT
1
00:00.00.000 --> 00:00:30.500
Bear is Coming!!!!!
2
00:00:31.000 --> 00:01:00:500
I said Bear is coming!!!!
3
00:01:01.000 --> 00:120:00.500
I said Bear is coming now!!!!
4
00:02:01.000 - 00:03:00.500
I said Bear is coming now!!!!
5
00h:03m:01s.000ms --> 00h:03m:00s.500ms
I said Bear is coming now!!!!
6
00:04:01.000-->00:03:00.500
I said Bear is coming now!!!!
\ No newline at end of file
WEBVTT
1
00:00:00.000
Bear is Coming!!!!!
2
00h:00m:31s.000ms
I said Bear is coming!!!!
3
I said Bear is coming now!!!!
\ No newline at end of file
WEBVTT
1
00:00:00.000 --> 00:00:30.500 Bear is Coming!!!!!
2
00:00:31.000 --> 00:01:00.500
I said Bear is coming!!!!
3
00:01:01.000 --> 100:20:00.500
I said Bear is coming now!!!!
\ No newline at end of file
WEBVTT
1
00:00:00.000 --> 00:00:30.500
Bear is Coming!!!!!
2
00:00:31.000 --> 00:01:00.500
I said Bear is coming!!!!
00:01:01.000 --> 100:20:00.500
I said Bear is coming now!!!!
\ No newline at end of file
WEBVTT
1
00:00:00.000 --> 00:00:30.500
Bear is Coming!!!!!
2
00:00:20.000 --> 00:01:00.500
I said Bear is coming!!!!
3
00:00:01.000 --> 100:20:00.500
I said Bear is coming now!!!!
\ No newline at end of file
WEBVTT
1
00:00:00.000 --> 00:00:30.500 L:100%
Bear is Coming!!!!! One blank.
2
00:00:31.000 --> 00:01:00.500 T:50%
I said Bear is coming!!!! Several blanks.
3
00:01:01.000 --> 00:02:00.500 A:middle T:50%
I said Bear is coming now!!!! Tab separator.
4
00:02:01.000 --> 100:20:00.500 D:horizontal
I said Bear is coming now!!!! Tab separators.
\ No newline at end of file
WEBVTT
1
00:00:00.000 --> 00:00:30.500 - L:100%
Bear is Coming!!!!! Bad separator
2
00:00:31.000 --> 00:01:00.500 --> T:50%
I said Bear is coming!!!! Bad separator.
3
00:01:01.000 --> 00:02:00.500 <A:middle> <T:50%>
I said Bear is coming now!!!! Bad setting markup.
4
00:02:01.000 --> 100:20:00.500 / D:horizontal
I said Bear is coming now!!!! Bad separators.
\ No newline at end of file
......@@ -19,7 +19,7 @@
<body>
<p>Tests that an empty file is not recognized as a WebVTT file.</p>
<video>
<track src="captions/tc000_empty.vtt" onload="trackLoaded()">
<track src="captions-webvtt/tc000-empty.vtt" onload="trackLoaded()">
</video>
</body>
</html>
\ No newline at end of file
Tests that UTF-8 encoded characters are recognized properly and that different encodings (iconv) are not recognized as WebVTT a file (we do allow it, it just looks ugly).
EXPECTED (video.textTracks[0].cues.length == '2') OK
EXPECTED (video.textTracks[0].cues[0].id == '1') OK
EXPECTED (video.textTracks[0].cues[0].startTime == '0.0') OK
EXPECTED (video.textTracks[0].cues[0].endTime == '30.5') OK
EXPECTED (video.textTracks[0].cues[0].getCueAsSource() == '景気判断') OK
EXPECTED (video.textTracks[0].cues[1].id == '2') OK
EXPECTED (video.textTracks[0].cues[1].startTime == '31.0') OK
EXPECTED (video.textTracks[0].cues[1].endTime == '1200.5') OK
EXPECTED (video.textTracks[0].cues[1].getCueAsSource() == '電力不足') OK
EXPECTED (video.textTracks[1].cues.length == '2') OK
Tests that UTF-8 encoded characters are recognized properly and that different encodings (iconv) are not recognized as a WebVTT file (we do allow it, it just looks ugly).
*** Testing text track 0
EXPECTED (cues.length == '2') OK
EXPECTED (cues[i].id == '1') OK
EXPECTED (cues[i].startTime == '0') OK
EXPECTED (cues[i].endTime == '30.5') OK
EXPECTED (cues[i].getCueAsSource() == '景気判断') OK
EXPECTED (cues[i].id == '2') OK
EXPECTED (cues[i].startTime == '31') OK
EXPECTED (cues[i].endTime == '1200.5') OK
EXPECTED (cues[i].getCueAsSource() == '電力不足') OK
*** Testing text track 1
EXPECTED (cues.length == '2') OK
END OF TEST
......@@ -4,49 +4,71 @@
<script src=../media-file.js></script>
<script src=../video-test.js></script>
<script>
var numberTests = 0;
<script>
numberOfTrackTests = 2;
function track1Loaded()
function trackLoaded()
{
numberOfTracksLoaded++;
if (numberOfTracksLoaded == numberOfTrackTests) {
testTrack0();
testTrack1();
}
}
function testTrack0()
{
findMediaElement();
testExpected("video.textTracks[0].cues.length", "2");
testExpected("video.textTracks[0].cues[0].id","1");
testExpected("video.textTracks[0].cues[0].startTime","0.0");
testExpected("video.textTracks[0].cues[0].endTime","30.5");
testExpected("video.textTracks[0].cues[0].getCueAsSource()", "景気判断");
testExpected("video.textTracks[0].cues[1].id","2");
testExpected("video.textTracks[0].cues[1].startTime","31.0");
testExpected("video.textTracks[0].cues[1].endTime","1200.5");
testExpected("video.textTracks[0].cues[1].getCueAsSource()", "電力不足");
var expected =
{
length : 2,
tests:
[
{
property : "id",
values : [1, 2],
},
{
property : "startTime",
values : [0.0, 31.0],
},
{
property : "endTime",
values : [30.5, 1200.5],
},
{
property : "getCueAsSource()",
values : ["景気判断", "電力不足"],
},
],
};
testCues(0, expected);
allTestsEnded();
}
function track2Loaded()
function testTrack1()
{
findMediaElement();
testExpected("video.textTracks[1].cues.length", "2");
var expected =
{
length : 2,
tests:
[],
};
testCues(1, expected);
allTestsEnded();
}
function allTestsEnded()
{
numberTests++;
if (numberTests >= 2)
endTest();
}
</script>
</head>
<body>
<p>Tests that UTF-8 encoded characters are recognized properly and that different encodings (iconv) are not recognized as WebVTT a file (we do allow it, it just looks ugly).</p>
<p>Tests that UTF-8 encoded characters are recognized properly and that different encodings (iconv) are not recognized as a WebVTT file (we do allow it, it just looks ugly).</p>
<video>
<track src="captions/tc001_utf8.vtt" onload="track1Loaded()">
<track src="captions/tc001_iso2022jp3.vtt" onload="track2Loaded()">
<track src="captions-webvtt/tc001-utf8.vtt" onload="trackLoaded()">
<track src="captions-webvtt/tc001-iso2022jp3.vtt" onload="trackLoaded()">
</video>
</body>
</html>
\ No newline at end of file
Tests that the parser properly ignores a UTF-8 BOM character at the beginning of a file and all other cues are properly parsed.
EXPECTED (video.textTracks[0].cues.length == '2') OK
EXPECTED (video.textTracks[0].cues[0].id == '1') OK
EXPECTED (video.textTracks[0].cues[0].startTime == '0.0') OK
EXPECTED (video.textTracks[0].cues[0].endTime == '30.5') OK
EXPECTED (video.textTracks[0].cues[0].getCueAsSource() == 'Bear is Coming!!!!!') OK