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

Unified Diff: third_party/WebKit/LayoutTests/media/track/track-webvtt-tc006-cue-identifiers.html

Issue 2042613002: Convert track-webvtt-tc[006,007,011] tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nit and add more info in the description Created 4 years, 6 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-tc006-cue-identifiers-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-tc006-cue-identifiers.html
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc006-cue-identifiers.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc006-cue-identifiers.html
index 3ff51f34e17b321f5026bbc41fe034ce523b60e5..2fcb3d8bbda5f9ccb82ec4fa3aaf13f273a9e8f1 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc006-cue-identifiers.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc006-cue-identifiers.html
@@ -1,77 +1,27 @@
<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <script src=../media-file.js></script>
- <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
- (Please avoid writing new tests using video-test.js) -->
- <script src=../video-test.js></script>
- <script>
-
- numberOfTrackTests = 2;
-
- function trackLoaded()
- {
- numberOfTracksLoaded++;
- if (numberOfTracksLoaded == numberOfTrackTests) {
- testTrack0();
- testTrack1();
- }
- }
-
- function testTrack0()
- {
- findMediaElement();
-
- var expected =
- {
- length : 4,
- tests:
- [
- {
- property : "id",
- values : ["random_id", "another random identifier", "identifier--too", "identifier--too"],
- },
- {
- 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!!!!", "Duplicate identifier"],
- },
- ],
- };
- testCues(0, expected);
-
- allTestsEnded();
- }
-
- function testTrack1()
- {
- findMediaElement();
- var expected =
- {
- length : 0,
- tests:
- [],
- };
- testCues(1, expected);
-
- allTestsEnded();
- }
- </script>
- </head>
- <body onload="enableAllTextTracks()">
- <p>Tests that any text other than "-->" is recognized as optional cue identifier.</p>
- <video>
- <track src="captions-webvtt/tc006-cue-id.vtt" onload="trackLoaded()">
- <track src="captions-webvtt/tc006-cue-id-error.vtt" onload="trackLoaded()">
- </video>
- </body>
-</html>
+<title>Tests that any text other than "-->" is recognized as optional cue identifier.</title>
+<script src="track-helpers.js"></script>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+check_cues_from_track("captions-webvtt/tc006-cue-id.vtt", function(track) {
+ var expected = [
+ { id: "random_id", startTime: 0, endTime: 30.5, text: "Bear is Coming!!!!!" },
+ { id: "another random identifier", startTime: 31, endTime: 60.5, text: "I said Bear is coming!!!!" },
+ { id: "identifier--too", startTime: 61, endTime: 120.5, text: "I said Bear is coming now!!!!" },
+ { id: "identifier--too", startTime: 121, endTime: 180.5, text: "Duplicate identifier" }
+ ];
+
+ assert_cues_match(track.cues, expected);
+});
+
+check_cues_from_track("captions-webvtt/tc006-cue-id-error.vtt", function(track) {
+ var expected = [
+ { id: "", startTime: 0, endTime: 30.5, text: "Bear is Coming!!!!!" },
+ { id: "", startTime: 31, endTime: 60.5, text: "I said Bear is coming!!!!" },
+ { id: "", startTime: 61, endTime: 1200.5, text: "I said Bear is coming now!!!!" }
+ ];
+
+ assert_cues_match(track.cues, expected);
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/track/track-webvtt-tc006-cue-identifiers-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698