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

Side by Side 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 unified diff | Download patch
OLDNEW
1 <p>Test that controls don't increase the size of the container (i.e. are 1 <!DOCTYPE html>
2 rendered overlapping with the video canvas).<p> 2 <title>Test that controls don't increase the size of the container (i.e. are ren dered overlapping with the video canvas).</title>
3 <script src="media-file.js" type="text/javascript"></script> 3 <script src="../resources/testharness.js"></script>
4 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 4 <script src="../resources/testharnessreport.js"></script>
5 (Please avoid writing new tests using video-test.js) --> 5 <script src="media-file.js"></script>
6 <script src="video-test.js" type="text/javascript"></script> 6 <iframe style="width: 400px; height: 300px; border: 0px;"></iframe>
7 <script>
8 async_test(function(t) {
9 var iframe = document.querySelector("iframe");
7 10
8 <iframe style="width: 400px; height: 300px; border: 0px;" id="container"> </ifra me> 11 iframe.onload = t.step_func(function() {
12 var video = iframe.contentDocument.querySelector("video");
9 13
10 <script type="text/javascript"> 14 video.ontimeupdate = t.step_func_done(function() {
11 var iframe = document.getElementById("container"); 15 var controls = internals.shadowRoot(video).firstChild.firstChild;
16 assert_less_than_equal(controls.offsetTop + controls.offsetHeight, v ideo.offsetHeight);
17 });
18 });
12 19
13 function timeupdate(event) { 20 iframe.src = findMediaFile("video", "content/test");
14 var video = event.target; 21 });
15 controls = internals.shadowRoot(video).firstChild.firstChild; 22 </script>
16 testExpected("controls.offsetTop + controls.offsetHeight", video.offsetHeigh t, "<=");
17 testRunner.notifyDone();
18 };
19
20 function start() {
21 var iframeDocument = document.getElementById("container").contentDocument;
22 var video = iframeDocument.querySelector("video");
23 video.addEventListener("timeupdate", timeupdate);
24 };
25
26 iframe.onload = start;
27 iframe.src = findMediaFile("video", "content/test");
28 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698