OLD | NEW |
1 <html> | 1 <!DOCTYPE html> |
2 <head> | 2 <title>Test that video media documents have a black background.</title> |
3 <script src="media-file.js"></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"></script> | 6 <iframe></iframe> |
7 <script> | 7 <script> |
8 function iframeLoad() { | 8 async_test(function(t) { |
9 var iframe = document.querySelector("iframe"); | 9 var iframe = document.querySelector("iframe"); |
10 var iframeBody = iframe.contentDocument.querySelector("body"); | 10 iframe.onload = t.step_func_done(function() { |
| 11 var iframeDocument = iframe.contentDocument; |
| 12 var iframeBody = iframeDocument.querySelector("body"); |
11 | 13 |
12 // Required to be global for testExpected() to work properly. | 14 var iframeBodyStyle = iframeDocument.defaultView.getComputedStyle(iframe
Body); |
13 iframeBodyStyle = iframe.contentDocument.defaultView.getComputed
Style(iframeBody, null); | 15 assert_equals(iframeBodyStyle.backgroundColor, "rgb(0, 0, 0)"); |
14 testExpected("iframeBodyStyle.backgroundColor", "rgb(0, 0, 0)"); | 16 }); |
15 endTest(); | |
16 } | |
17 | 17 |
18 function load() { | 18 iframe.src = findMediaFile("video", "content/counting"); |
19 var iframe = document.querySelector("iframe"); | 19 }); |
20 iframe.onload = iframeLoad; | 20 </script> |
21 iframe.src = findMediaFile("video", "content/counting"); | |
22 } | |
23 </script> | |
24 </head> | |
25 | |
26 <body onload="load()"> | |
27 <p>Test that video media documents have a black background.</p> | |
28 <iframe style="width: 200px; height: 200px;"></iframe> | |
29 </body> | |
30 </html> | |
OLD | NEW |