1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/media/test/test_bug726904.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,56 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=726904 1.8 +--> 1.9 + 1.10 +<head> 1.11 + <title>Media test: default video size</title> 1.12 + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.13 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 1.14 + <script type="text/javascript" src="manifest.js"></script> 1.15 +</head> 1.16 +<body onload="bodyLoaded();"> 1.17 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=726904">Mozilla Bug 726904</a> 1.18 + 1.19 +<pre id="test"> 1.20 +<script class="testbody" type="text/javascript"> 1.21 + 1.22 +SimpleTest.waitForExplicitFinish(); 1.23 + 1.24 +var v1 = document.createElement("video"), 1.25 + v2 = document.createElement("video"), 1.26 + poster = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAAAAACl1GkQAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAALJJREFUeNrtwQENAAAAwqD3T20ON6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHg0cq4AATRk8BYAAAAASUVORK5CYII", 1.27 + resource = getPlayableVideo(gSmallTests); 1.28 + 1.29 +function bodyLoaded(){ 1.30 + // Note: For DASH, width and height would vary once the video started playing, so 1.31 + // the values would not correlate with those in manifest.js. Since this test has 1.32 + // no playing, this should not affect the result. 1.33 + is(v1.videoWidth, resource.width, "Intrinsic width should match video width"); 1.34 + is(v1.videoHeight, resource.height, "Intrinsic height should match video height"); 1.35 + is(v2.clientWidth, 400, "clientWidth should be 400"); 1.36 + is(v2.clientHeight, 400, "clientHeight should be 400"); 1.37 + SimpleTest.finish(); 1.38 +} 1.39 + 1.40 +if (resource) { 1.41 + v1.poster = v2.poster = poster; 1.42 + 1.43 + v1.src = v2.src = "http://mochi.test:8888/tests/content/media/test/" + resource.name; 1.44 + 1.45 + v1.preload = "auto"; 1.46 + v2.preload = "none"; 1.47 + 1.48 + v1.muted = v2.muted = true; 1.49 + 1.50 + document.body.appendChild(v1); 1.51 + document.body.appendChild(v2); 1.52 +} else { 1.53 + todo(false, "No types supported"); 1.54 +} 1.55 + 1.56 +</script> 1.57 +</pre> 1.58 +</body> 1.59 +</html>