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

Unified Diff: third_party/WebKit/LayoutTests/media/track/track-webvtt-tc011-blank-lines.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-tc011-blank-lines.html
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc011-blank-lines.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc011-blank-lines.html
index a8b18630150b2b812aebda54c87b3f9283d9095a..e2f5f39aa54f049fa82aecc1a87411f593521b24 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc011-blank-lines.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc011-blank-lines.html
@@ -1,76 +1,26 @@
<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Tests that cues are affected neither by multiple newlines \n, \r, and \r\n nor by the absence of a seperating line.</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/tc011-cues.vtt", function(track) {
+ 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!!!!" }
+ ];
- <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>
+ assert_cues_match(track.cues, expected);
+});
- numberOfTrackTests = 2;
+check_cues_from_track("captions-webvtt/tc011-cues-no-separation.vtt", function(track) {
+ var expected = [
+ { id: "1", startTime: 0, endTime: 30.5, text: "Bear is Coming!!!!!\n2" },
+ { id: "", startTime: 31, endTime: 60.5, text: "I said Bear is coming!!!!" },
+ { id: "", startTime: 61, endTime: 361200.5, text: "I said Bear is coming now!!!!" }
+ ];
- function trackLoaded()
- {
- numberOfTracksLoaded++;
- if (numberOfTracksLoaded == numberOfTrackTests) {
- testTrack0();
- testTrack1();
- }
- }
-
- 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);
-
- allTestsEnded();
- }
-
- function testTrack1()
- {
- findMediaElement();
- var expected =
- {
- length : 1,
- tests:
- [],
- };
- testCues(1, expected);
-
- allTestsEnded();
- }
- </script>
- </head>
- <body onload="enableAllTextTracks()">
- <p>Tests that cues are not affected by multiple newlines \n, \r, and \r\n and that cue not properly separated are treated as one big cue.</p>
- <video>
- <track src="captions-webvtt/tc011-cues.vtt" onload="trackLoaded()">
- <track src="captions-webvtt/tc011-cues-no-separation.vtt" onload="trackLoaded()">
- </video>
- </body>
-</html>
+ assert_cues_match(track.cues, expected);
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698