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

Unified Diff: third_party/WebKit/LayoutTests/media/video-controls-in-media-document.html

Issue 2120793002: Convert video-controls-hide* and video-controls-in* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/video-controls-in-media-document.html
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-in-media-document.html b/third_party/WebKit/LayoutTests/media/video-controls-in-media-document.html
index 498e9b2b5e827254a883a0f4c72853abe0c53973..05b878d8dc7dbd5c329c69c3c53a556453b2b86a 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-in-media-document.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-in-media-document.html
@@ -1,28 +1,22 @@
-<p>Test that controls don't increase the size of the container (i.e. are
-rendered overlapping with the video canvas).<p>
-<script src="media-file.js" type="text/javascript"></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" type="text/javascript"></script>
+<!DOCTYPE html>
+<title>Test that controls don't increase the size of the container (i.e. are rendered overlapping with the video canvas).</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<iframe style="width: 400px; height: 300px; border: 0px;"></iframe>
+<script>
+async_test(function(t) {
+ var iframe = document.querySelector("iframe");
-<iframe style="width: 400px; height: 300px; border: 0px;" id="container"> </iframe>
+ iframe.onload = t.step_func(function() {
+ var video = iframe.contentDocument.querySelector("video");
-<script type="text/javascript">
-var iframe = document.getElementById("container");
+ video.ontimeupdate = t.step_func_done(function() {
+ var controls = internals.shadowRoot(video).firstChild.firstChild;
+ assert_less_than_equal(controls.offsetTop + controls.offsetHeight, video.offsetHeight);
+ });
+ });
-function timeupdate(event) {
- var video = event.target;
- controls = internals.shadowRoot(video).firstChild.firstChild;
- testExpected("controls.offsetTop + controls.offsetHeight", video.offsetHeight, "<=");
- testRunner.notifyDone();
-};
-
-function start() {
- var iframeDocument = document.getElementById("container").contentDocument;
- var video = iframeDocument.querySelector("video");
- video.addEventListener("timeupdate", timeupdate);
-};
-
-iframe.onload = start;
-iframe.src = findMediaFile("video", "content/test");
-</script>
+ iframe.src = findMediaFile("video", "content/test");
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698