test_bug726904.html (2019B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=726904 5 --> 6 7 <head> 8 <title>Media test: default video size</title> 9 <script src="/tests/SimpleTest/SimpleTest.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 11 <script type="text/javascript" src="manifest.js"></script> 12 </head> 13 <body onload="bodyLoaded();"> 14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=726904">Mozilla Bug 726904</a> 15 16 <pre id="test"> 17 <script class="testbody" type="text/javascript"> 18 19 SimpleTest.waitForExplicitFinish(); 20 21 var v1 = document.createElement("video"), 22 v2 = document.createElement("video"), 23 poster = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAAAAACl1GkQAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAALJJREFUeNrtwQENAAAAwqD3T20ON6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHg0cq4AATRk8BYAAAAASUVORK5CYII", 24 resource = getPlayableVideo(gSmallTests); 25 26 function bodyLoaded(){ 27 // Note: For DASH, width and height would vary once the video started playing, so 28 // the values would not correlate with those in manifest.js. Since this test has 29 // no playing, this should not affect the result. 30 is(v1.videoWidth, resource.width, "Intrinsic width should match video width"); 31 is(v1.videoHeight, resource.height, "Intrinsic height should match video height"); 32 is(v2.clientWidth, 400, "clientWidth should be 400"); 33 is(v2.clientHeight, 400, "clientHeight should be 400"); 34 SimpleTest.finish(); 35 } 36 37 if (resource) { 38 v1.poster = v2.poster = poster; 39 40 v1.src = v2.src = "http://mochi.test:8888/tests/dom/media/test/" + resource.name; 41 42 v1.preload = "auto"; 43 v2.preload = "none"; 44 45 v1.muted = v2.muted = true; 46 47 document.body.appendChild(v1); 48 document.body.appendChild(v2); 49 } else { 50 todo(false, "No types supported"); 51 } 52 53 </script> 54 </pre> 55 </body> 56 </html>