OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="media-file.js"></script> | 3 <script src="media-file.js"></script> |
| 4 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 |
| 5 (Please avoid writing new tests using video-test.js) --> |
4 <script src="video-test.js"></script> | 6 <script src="video-test.js"></script> |
5 <script> | 7 <script> |
6 function canPlayThrough(event) { | 8 function canPlayThrough(event) { |
7 var video = event.target; | 9 var video = event.target; |
8 testExpected(video.offsetWidth, 200); | 10 testExpected(video.offsetWidth, 200); |
9 testExpected(video.offsetHeight, 164); | 11 testExpected(video.offsetHeight, 164); |
10 endTest(); | 12 endTest(); |
11 } | 13 } |
12 | 14 |
13 function iframeLoad() { | 15 function iframeLoad() { |
14 var iframe = document.querySelector("iframe"); | 16 var iframe = document.querySelector("iframe"); |
15 var video = iframe.contentDocument.querySelector("video"); | 17 var video = iframe.contentDocument.querySelector("video"); |
16 video.addEventListener("canplaythrough", canPlayThrough); | 18 video.addEventListener("canplaythrough", canPlayThrough); |
17 video.load() | 19 video.load() |
18 } | 20 } |
19 | 21 |
20 function load() { | 22 function load() { |
21 var iframe = document.querySelector("iframe"); | 23 var iframe = document.querySelector("iframe"); |
22 iframe.onload = iframeLoad; | 24 iframe.onload = iframeLoad; |
23 iframe.src = findMediaFile("video", "content/counting"); | 25 iframe.src = findMediaFile("video", "content/counting"); |
24 } | 26 } |
25 </script> | 27 </script> |
26 </head> | 28 </head> |
27 | 29 |
28 <body onload="load()"> | 30 <body onload="load()"> |
29 <p>Test that video media documents scale to fit undersized containers.</
p> | 31 <p>Test that video media documents scale to fit undersized containers.</
p> |
30 <iframe style="width: 200px; height: 200px;"></iframe> | 32 <iframe style="width: 200px; height: 200px;"></iframe> |
31 </body> | 33 </body> |
32 </html> | 34 </html> |
OLD | NEW |