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