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 // Required to be global for assert_equals() to work properly. |
fs
2016/06/14 15:41:37
Nit: Don't think this requirement is still needed.
Srirama
2016/06/14 16:04:13
Done. Not required to be global.
| |
13 iframeBodyStyle = iframe.contentDocument.defaultView.getComputed Style(iframeBody, null); | 15 iframeBodyStyle = iframeDocument.defaultView.getComputedStyle(iframeBody ); |
14 testExpected("iframeBodyStyle.backgroundColor", "rgb(0, 0, 0)"); | 16 assert_equals(iframeBodyStyle.backgroundColor, "rgb(0, 0, 0)"); |
15 endTest(); | 17 }); |
16 } | |
17 | 18 |
18 function load() { | 19 iframe.src = findMediaFile("video", "content/counting"); |
19 var iframe = document.querySelector("iframe"); | 20 }); |
20 iframe.onload = iframeLoad; | 21 </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 |