pageload-video.html (1455B)
1 <!DOCTYPE HTML> 2 <meta charset="utf-8"> 3 <title>Media documents: video</title> 4 <link rel="author" title="Michael Ventnor" href="mailto:mventnor@mozilla.com"> 5 <link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"> 6 <link rel="help" href="https://html.spec.whatwg.org/multipage/#read-media"> 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 <script src="/common/media.js"></script> 10 <div id="log"></div> 11 <script> 12 async_test(function() { 13 var testframe = document.createElement('iframe'); 14 var url = getVideoURI("/media/A4"); 15 var contentType = getMediaContentType(url); 16 testframe.onload = this.step_func_done(function() { 17 assert_equals(testframe.contentDocument.contentType, contentType); 18 assert_equals(testframe.contentDocument.compatMode, "CSS1Compat", "Media documents should be in standards mode"); 19 var testframeChildren = testframe.contentDocument.body.childNodes; 20 assert_equals(testframeChildren.length, 1, "Body of image document has 1 child"); 21 assert_equals(testframeChildren[0].nodeName, "VIDEO", "Only child of body must be an <video> element"); 22 assert_equals(testframeChildren[0].namespaceURI, "http://www.w3.org/1999/xhtml", 23 "Only child of body must be an HTML element"); 24 }); 25 testframe.src = url; 26 document.body.appendChild(testframe); 27 }, "The document for a standalone media file should have one child in the body."); 28 </script>