OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <title>This tests that a standalone media document has viewport settings.</title
> |
3 <head> | 3 <script src="../resources/testharness.js"></script> |
4 <script src="../media/media-file.js"></script> | 4 <script src="../resources/testharnessreport.js"></script> |
5 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 5 <script src="media-file.js"></script> |
6 (Please avoid writing new tests using video-test.js) --> | 6 <iframe></iframe> |
7 <script src="../media/video-test.js"></script> | 7 <script> |
8 <script> | 8 async_test(function(t) { |
9 var metaElement; | 9 var iframe = document.querySelector("iframe"); |
10 var standaloneMediaDocument; | |
11 var skipOnFirstEmptyLoad = 0; | |
12 | 10 |
13 function frameLoaded() | 11 iframe.onload = t.step_func_done(function() { |
14 { | 12 var metaElement = iframe.contentDocument.querySelector("meta"); |
15 if (++skipOnFirstEmptyLoad == 1) | 13 assert_equals(metaElement.name, "viewport"); |
16 return; | 14 assert_equals(metaElement.content, "width=device-width"); |
| 15 }); |
17 | 16 |
18 standaloneMediaDocument = document.getElementById("videoframe").
contentDocument; | 17 iframe.src = findMediaFile("video", "content/test"); |
19 metaElement = standaloneMediaDocument.querySelector("meta"); | 18 }); |
20 | 19 </script> |
21 testExpected("metaElement.name", "viewport"); | |
22 testExpected("metaElement.content", "width=device-width"); | |
23 | |
24 endTest(); | |
25 } | |
26 </script> | |
27 </head> | |
28 <body> | |
29 <p> | |
30 This tests that a standalone media document has viewport settings. | |
31 </p> | |
32 <iframe id="videoframe" onload="frameLoaded()"></iframe> | |
33 <script> | |
34 document.getElementById("videoframe").src = findMediaFile("video", "
content/test"); | |
35 </script> | |
36 </body> | |
37 </html> | |
OLD | NEW |