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

Unified Diff: third_party/WebKit/LayoutTests/media/track/track-webvtt-tc019-cue-size.html

Issue 2029663002: Convert track-webvtt-tc[019-021] tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments 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-tc019-cue-size.html
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc019-cue-size.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc019-cue-size.html
index aea78174feccd928c8578212e1053f6565eb2ad2..cace5ac866a4d58059181c3f1054e94d9edaf5cf 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc019-cue-size.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc019-cue-size.html
@@ -1,69 +1,26 @@
<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Tests cue size from settings.</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/tc019-cue-size.vtt", function(track) {
+ var expected = [
+ { size: 100 },
+ { size: 10 },
+ { size: 0 }
+ ];
- <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);
+});
- var numberOfTrackTests = 2;
+check_cues_from_track("captions-webvtt/tc019-cue-size-bad.vtt", function(track) {
+ var expected = [
+ { size: 100 },
+ { size: 100 },
+ { size: 100 }
+ ];
- function trackLoaded()
- {
- numberOfTracksLoaded++;
- if (numberOfTracksLoaded == numberOfTrackTests) {
- testTrack(0);
- testTrackError(1);
- }
- }
-
- function testTrack(i)
- {
- findMediaElement();
- var expected =
- {
- length : 3,
- tests:
- [
- {
- property : "size",
- values : [100, 10, 0],
- },
- ],
- };
- testCues(i, expected);
-
- allTestsEnded();
- }
-
- function testTrackError(i)
- {
- findMediaElement();
- var expected =
- {
- length : 3,
- tests:
- [
- {
- property : "size",
- values : [100, 100, 100],
- },
- ],
- };
- testCues(i, expected);
-
- allTestsEnded();
- }
- </script>
- </head>
- <body onload="enableAllTextTracks()">
- <p>Tests cue size from settings.</p>
- <video>
- <track src="captions-webvtt/tc019-cue-size.vtt" onload="trackLoaded()">
- <track src="captions-webvtt/tc019-cue-size-bad.vtt" onload="trackLoaded()">
- </video>
- </body>
-</html>
+ assert_cues_match(track.cues, expected);
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698