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

Unified Diff: third_party/WebKit/LayoutTests/media/track/track-webvtt-tc009-timings-hour.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
Index: third_party/WebKit/LayoutTests/media/track/track-webvtt-tc009-timings-hour.html
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc009-timings-hour.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc009-timings-hour.html
index f41f79d3d979c59721d00e82f2975b9ae53a47ff..22c6b83a3c09ee09ec9260e9f39d5280de44c263 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc009-timings-hour.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc009-timings-hour.html
@@ -1,76 +1,61 @@
<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Tests cue timings that contain hours (they are optional), and tests various syntax errors in timings with 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/tc009-timings-hour.vtt">
+ <track src="captions-webvtt/tc009-timings-hour-error.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 : 3,
- tests:
- [
- {
- property : "id",
- values : ["1", "2", "3"],
- },
- {
- property : "startTime",
- values : [0.0, 31.0, 61.0],
- },
- {
- property : "endTime",
- values : [30.5, 60.5, 361200.5],
- },
- {
- property : "text",
- values : ["Bear is Coming!!!!!", "I said Bear is coming!!!!", "I said Bear is coming now!!!!"],
- },
- ],
- };
- 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 : 361200.5,
+ text : "I said Bear is coming now!!!!"
}
+ ];
- 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 contain hours (they are optional), and tests various syntax errors in timings with hours.</p>
- <video>
- <track src="captions-webvtt/tc009-timings-hour.vtt" onload="trackLoaded()">
- <track src="captions-webvtt/tc009-timings-hour-error.vtt" onload="trackLoaded()">
- </video>
- </body>
-</html>
+ function testTrack1() {
+ // Test that all the cues are ignored.
+ assert_cues_equal(video.textTracks[1].cues, []);
+ }
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698