Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1037)

Unified Diff: third_party/WebKit/LayoutTests/media/track/track-webvtt-tc008-timings-no-hours.html

Issue 1962593002: Convert track-webvtt-tc[008-010] tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test failure Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/track/track-webvtt-tc008-timings-no-hours-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/media/track/track-webvtt-tc008-timings-no-hours.html
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc008-timings-no-hours.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc008-timings-no-hours.html
index 8508619f73650b71af152d9f4b85179db78ffe4a..773c1d3cb919e1fbb49d6ed9e56c03ec61b20a81 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc008-timings-no-hours.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc008-timings-no-hours.html
@@ -1,76 +1,67 @@
<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Tests cue timings that do not contain hours (they are optional), and tests various syntax errors in timings without hours.</title>
+<script src="track-helpers.js"></script>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<video>
+ <track src="captions-webvtt/tc008-timings-no-hour.vtt">
+ <track src="captions-webvtt/tc008-timings-no-hour-errors.vtt">
+</video>
+<script>
+async_test(function(t) {
+ var video = document.querySelector("video");
- <script src=../media-file.js></script>
- <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
- (Please avoid writing new tests using video-test.js) -->
- <script src=../video-test.js></script>
- <script>
+ var trackElements = document.querySelectorAll("track");
+ for (var i = 0; i < video.textTracks.length; i++)
+ trackElements[i].onload = t.step_func(trackLoaded);
- numberOfTrackTests = 2;
+ enableAllTextTracks(video.textTracks);
- function trackLoaded()
- {
- numberOfTracksLoaded++;
- if (numberOfTracksLoaded == numberOfTrackTests) {
- testTrack0();
- testTrack1();
- }
- }
+ var numberOfTracksLoaded = 0;
+ function trackLoaded() {
+ numberOfTracksLoaded++;
+ if (numberOfTracksLoaded != 2)
+ return;
- function testTrack0()
- {
- findMediaElement();
- var expected =
- {
- length : 4,
- tests:
- [
- {
- property : "id",
- values : ["1", "2", "3", "4"],
- },
- {
- property : "startTime",
- values : [0.0, 31.0, 61.0, 121.0],
- },
- {
- property : "endTime",
- values : [30.5, 60.5, 120.5, 180.5],
- },
- {
- property : "text",
- values : ["Bear is Coming!!!!!", "I said Bear is coming!!!!", "I said Bear is coming now!!!!", "tab separators"],
- },
- ],
- };
- testCues(0, expected);
+ testTrack0();
+ testTrack1();
+ t.done();
+ }
- allTestsEnded();
+ function testTrack0() {
+ var expected = [
+ {
+ id : "1",
+ startTime : 0,
+ endTime : 30.5,
+ text : "Bear is Coming!!!!!"
+ },
+ {
+ id : "2",
+ startTime : 31,
+ endTime : 60.5,
+ text : "I said Bear is coming!!!!"
+ },
+ {
+ id : "3",
+ startTime : 61,
+ endTime : 120.5,
+ text : "I said Bear is coming now!!!!"
+ },
+ {
+ id : "4",
+ startTime : 121,
+ endTime : 180.5,
+ text : "tab separators"
}
+ ];
- function testTrack1()
- {
- findMediaElement();
- var expected =
- {
- length : 0,
- tests:
- [],
- };
- testCues(1, expected);
+ assert_cues_equal(video.textTracks[0].cues, expected);
+ }
- allTestsEnded();
- }
- </script>
- </head>
- <body onload="enableAllTextTracks()">
- <p>Tests cue timings that do not contain hours (they are optional), and tests various syntax errors in timings without hours.</p>
- <video>
- <track src="captions-webvtt/tc008-timings-no-hour.vtt" onload="trackLoaded()">
- <track src="captions-webvtt/tc008-timings-no-hour-errors.vtt" onload="trackLoaded()">
- </video>
- </body>
-</html>
+ function testTrack1() {
+ // Test that all the cues are ignored.
+ assert_cues_equal(video.textTracks[1].cues, []);
+ }
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/track/track-webvtt-tc008-timings-no-hours-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698