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-cue-container-rendering-position.html

Issue 1882583002: 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 review comments 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-container-rendering-position.html
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-container-rendering-position.html b/third_party/WebKit/LayoutTests/media/track/track-cue-container-rendering-position.html
index 3e617d51cdb43f7851aebbcbda4a618a8c9f4a39..0b9d32d83014e2aabf7b2c59bdc3165960df3bae 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-container-rendering-position.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-container-rendering-position.html
@@ -1,51 +1,26 @@
<!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 src=../media-controls.js></script>
-
- <script>
-
- var cueDisplayElement;
-
- function testPosition()
- {
- if (!window.internals) {
- consoleWrite("<br><b>** This test only works in DRT! **<" + "/b>");
- return;
- }
-
- consoleWrite("");
- cueDisplayElement = textTrackDisplayElement(video, 'display', 0);
- document.body.offsetTop; // Force layout.
- testExpected("cueDisplayElement.offsetTop > (video.videoHeight * .75)", true);
- endTest();
- }
-
- function loaded()
- {
- consoleWrite("The top of the text track container should be in the bottom 25% of the video element.");
-
- findMediaElement();
- video.src = findMediaFile('video', '../content/test');
- waitForEvent('canplaythrough', testPosition);
- }
-
- </script>
- </head>
- <body onload="loaded()">
- <video controls>
- <track src="captions-webvtt/captions-snap-to-lines-not-set.vtt" kind="captions" >
- <track src="captions-webvtt/simple-captions.vtt" kind="captions" >
- <track src="captions-webvtt/sorted-dispatch.vtt" kind="captions" >
- <track src="captions-webvtt/captions-fast.vtt" kind="captions" >
- <track src="captions-webvtt/captions-html.vtt" kind="captions" >
- <track src="captions-webvtt/captions.vtt" kind="captions" default>
- </video>
- </body>
-</html>
+<title>The top of the text track container should be in the bottom 25% of the video element.</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>
+<video>
+ <track src="captions-webvtt/captions-snap-to-lines-not-set.vtt" kind="captions" >
+ <track src="captions-webvtt/simple-captions.vtt" kind="captions" >
+ <track src="captions-webvtt/sorted-dispatch.vtt" kind="captions" >
+ <track src="captions-webvtt/captions-fast.vtt" kind="captions" >
+ <track src="captions-webvtt/captions-html.vtt" kind="captions" >
+ <track src="captions-webvtt/captions.vtt" kind="captions" default>
+</video>
+<script>
+async_test(function(t) {
+ var video = document.querySelector("video");
+ video.src = findMediaFile("video", "../content/test");
+
+ video.oncanplaythrough = t.step_func_done(function() {
+ var cueDisplayElement = textTrackDisplayElement(video, "display", 0);
+ document.body.offsetTop; // Force layout.
+ assert_true(cueDisplayElement.offsetTop > (video.videoHeight * 0.75));
+ });
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698