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

Unified Diff: third_party/WebKit/LayoutTests/media/track/track-cue-rendering-with-padding.html

Issue 1913423002: Convert track tests from video-test.js to testharness.js based (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comment Created 4 years, 8 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-cue-rendering-with-padding.html
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-with-padding.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-with-padding.html
index df217114a5ebfdf1e5ca9a5792603152130a153f..d02310182eb1fc37dbabb63b0fcab9744e7b31eb 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-with-padding.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-with-padding.html
@@ -1,61 +1,33 @@
<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <style type="text/css">
- video::-webkit-media-text-track-display {
- padding: 15px;
- }
- </style>
-
- <script src=../media-file.js></script>
- <script src=../media-controls.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>
- var cueContainerBottomPoint;
- var cueDisplayBottomPoint;
-
- function startTest()
- {
- if (!window.internals) {
- consoleWrite("<br><b>** This test only works in DRT! **<" + "/b>");
- return;
- }
-
- var cueContainerElement = textTrackDisplayElement(video);
- var cueDisplayElement = textTrackDisplayElement(video, 'display', 0);
-
- cueDisplayBottomPoint = cueDisplayElement.offsetTop + cueDisplayElement.offsetHeight;
- cueContainerBottomPoint = cueContainerElement.offsetTop + cueContainerElement.offsetHeight;
-
- consoleWrite("<br>** Cue should be displayed entirely within the container. **");
- testExpected("cueDisplayBottomPoint <= cueContainerBottomPoint", true);
- endTest();
- }
-
- function loaded()
- {
- consoleWrite("Rendering text track cue line with padding set.<br>");
- findMediaElement();
-
- testTrack = document.querySelector('track');
- video.src = findMediaFile('video', '../content/test');
-
- waitForEvent('seeked', startTest);
- waitForEvent('canplaythrough', function() {
- video.currentTime = .25;
- });
- }
-
- </script>
- </head>
- <body onload="loaded()">
- <video controls>
- <track src="captions-webvtt/captions-fast.vtt" kind="captions" default>
- </video>
- </body>
-</html>
+<title>Tests rendering text track cue line with padding set.</title>
+<script src="../media-file.js"></script>
+<script src="../media-controls.js"></script>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>
+video::-webkit-media-text-track-display {
+ padding: 15px;
+}
+</style>
+<video>
+ <track src="captions-webvtt/captions-fast.vtt" kind="captions" default>
+</video>
+<script>
+async_test(function(t) {
+ var video = document.querySelector("video");
+ video.src = findMediaFile("video", "../content/test");
+
+ video.onseeked = t.step_func_done(function() {
+ var cueContainerElement = textTrackDisplayElement(video);
+ var cueDisplayElement = textTrackDisplayElement(video, "display", 0);
+
+ var cueDisplayBottomPoint = cueDisplayElement.offsetTop + cueDisplayElement.offsetHeight;
+ var cueContainerBottomPoint = cueContainerElement.offsetTop + cueContainerElement.offsetHeight;
+
+ // Cue should be displayed entirely within the container.
+ assert_true(cueDisplayBottomPoint <= cueContainerBottomPoint);
+ });
+
+ video.currentTime = 0.25;
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698