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

Unified Diff: third_party/WebKit/LayoutTests/media/track/track-webvtt-tc007-cue-no-id.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
Index: third_party/WebKit/LayoutTests/media/track/track-webvtt-tc007-cue-no-id.html
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc007-cue-no-id.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc007-cue-no-id.html
index 113d15fd3a146e75036ef6cb5745b0f1a9176d62..358a3afd69f5b6b4845cb7b636508ca681361a19 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc007-cue-no-id.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc007-cue-no-id.html
@@ -1,77 +1,19 @@
<!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 : 3,
- tests:
- [
- {
- property : "id",
- values : ["", "", ""],
- },
- {
- property : "startTime",
- values : [0.0, 31.0, 61.0],
- },
- {
- property : "endTime",
- values : [30.5, 60.5, 1200.5],
- },
- {
- property : "text",
- values : ["Bear is Coming!!!!!", "I said Bear is coming!!!!", "I said Bear is coming now!!!!"],
- },
- ],
- };
- testCues(0, expected);
-
- allTestsEnded();
- }
-
- function testTrack1()
- {
- findMediaElement();
- var expected =
- {
- length : 0,
- tests:
- [],
- };
- testCues(1, expected);
-
- allTestsEnded();
- }
- </script>
- </head>
- <body onload="enableAllTextTracks()">
- <p>Tests empty cue identifiers (they are optional), but makes sure "-->" found leads to discarded cue.</p>
- <video>
- <track src="captions-webvtt/tc007-cue-no-id.vtt" onload="trackLoaded()">
- <track src="captions-webvtt/tc007-cue-no-id-error.vtt" onload="trackLoaded()">
- </video>
- </body>
-</html>
+<title>Tests empty cue identifiers (they are optional), but makes sure "-->" found leads to discarded cue.</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/tc007-cue-no-id.vtt", testTrack);
+check_cues_from_track("captions-webvtt/tc007-cue-no-id-error.vtt", testTrack);
+
+function testTrack(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>

Powered by Google App Engine
This is Rietveld 408576698