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

Unified Diff: third_party/WebKit/LayoutTests/media/track/track-text-track-cue-list.html

Issue 1952893004: Convert track-text-track* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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-text-track-cue-list-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-text-track-cue-list.html
diff --git a/third_party/WebKit/LayoutTests/media/track/track-text-track-cue-list.html b/third_party/WebKit/LayoutTests/media/track/track-text-track-cue-list.html
index dc5762cf10166c87c9f0f0a09bde416eb4e81867..d903d89af6220051c419138cf713f2b6216bfddc 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-text-track-cue-list.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-text-track-cue-list.html
@@ -1,44 +1,29 @@
<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <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>
-
- function trackLoaded()
- {
- var testTrack = document.getElementById('testTrack');
- cues = testTrack.track.cues;
-
- consoleWrite("<br>*** Testing TextTrackCueList length");
-
- testExpected("cues.length", 4);
-
- consoleWrite("<br>*** Testing TextTrackCueList [] operator");
-
- testExpected("cues[0].id", "1");
- testExpected("cues[3].id", "4");
- testExpected("cues[4]", undefined);
-
- consoleWrite("<br>*** Testing TextTrackCueList getCueById()");
-
- testExpected("cues.getCueById('1').startTime", 0);
- testExpected("cues.getCueById('4').startTime", 121);
- testExpected("cues.getCueById('junk')", undefined);
-
- endTest();
- }
-
- </script>
- </head>
- <body>
- <p>Tests TextTrackCueList functionality: length, operator[], and getCueById()</p>
- <video>
- <track id="testTrack" src="captions-webvtt/tc013-settings.vtt" kind="captions" onload="trackLoaded()" default>
- </video>
- </body>
-</html>
+<title>Tests TextTrackCueList functionality: length, operator[], and getCueById().</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<video>
+ <track src="captions-webvtt/tc013-settings.vtt" kind="captions" default>
+</video>
+<script>
+async_test(function(t) {
+ var testTrack = document.querySelector("track");
+
+ testTrack.onload = t.step_func_done(function() {
+ var cues = testTrack.track.cues;
+
+ // Testing TextTrackCueList length.
+ assert_equals(cues.length, 4);
+
+ // Testing TextTrackCueList [] operator.
+ assert_equals(cues[0].id, "1");
+ assert_equals(cues[3].id, "4");
+ assert_object_equals(cues[4], undefined);
+
+ // Testing TextTrackCueList getCueById().
+ assert_equals(cues.getCueById("1").startTime, 0);
+ assert_equals(cues.getCueById("4").startTime, 121);
+ assert_object_equals(cues.getCueById("junk"), undefined);
+ });
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/track/track-text-track-cue-list-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698