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

Unified Diff: third_party/WebKit/LayoutTests/media/track/track-webvtt-tc013-settings.html

Issue 2043513002: Convert track-webvtt-tc[013-015] tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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-tc013-settings-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-tc013-settings.html
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc013-settings.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc013-settings.html
index 9ac839b192a4f1a7237c21cc3ef65e10e930c97a..43e137c72b5ef104a288a305a6167a18a7cad4d9 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc013-settings.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc013-settings.html
@@ -1,86 +1,28 @@
<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Tests WebVTT 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/tc013-settings.vtt", function(track) {
+ var expected = [
+ { line: 100, position: "auto", align: "start", vertical: "" },
+ { line: 15, position: 40, align: "middle", vertical: "rl" },
+ { line: "auto", position: 10, align: "middle", vertical: "" },
+ { line: 95, position: "auto", align: "end", vertical: "lr" }
+ ];
- <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/tc013-settings-bad-separation.vtt", function(track) {
+ var expected = [
+ { line: 43, position: 10, align: "middle", vertical: "" },
+ { line: "auto", position: 50, align: "end", vertical: "" },
+ { line: "auto", position: "auto", align: "middle", vertical: "" },
+ { line: "auto", position: 90, align: "middle", vertical: "lr" }
+ ];
- function trackLoaded()
- {
- numberOfTracksLoaded++;
- if (numberOfTracksLoaded == numberOfTrackTests) {
- for (var i = 0; i <= numberOfTrackTests; ++i)
- testTrack(i);
- }
- }
-
- function testTrack(i)
- {
- findMediaElement();
- var expected =
- [
- {
- length : 4,
- tests:
- [
- {
- property : "line",
- values : [100, 15, "auto", 95],
- },
- {
- property : "position",
- values : ["auto", 40, 10, "auto"],
- },
- {
- property : "align",
- values : ["start", "middle", "middle", "end"],
- },
- {
- property : "vertical",
- values : ["", "rl", "", "lr"],
- },
- ],
- },
- {
- length : 4,
- tests:
- [
- {
- property : "line",
- values : [43, "auto", "auto", "auto"],
- },
- {
- property : "position",
- values : [10, 50, "auto", 90],
- },
- {
- property : "align",
- values : ["middle", "end", "middle", "middle"],
- },
- {
- property : "vertical",
- values : ["", "", "", "lr"],
- },
- ],
- }
- ]
- testCues(i, expected[i]);
-
- allTestsEnded();
- }
- </script>
- </head>
- <body onload="enableAllTextTracks()">
- <p>Tests WebVTT settings.</p>
- <video>
- <track src="captions-webvtt/tc013-settings.vtt" onload="trackLoaded()">
- <track src="captions-webvtt/tc013-settings-bad-separation.vtt" onload="trackLoaded()">
- </video>
- </body>
-</html>
+ assert_cues_match(track.cues, expected);
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/track/track-webvtt-tc013-settings-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698