content/media/test/test_bug726904.html

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

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

mercurial