Tue, 06 Jan 2015 21:39:09 +0100
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.
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=726904
5 -->
7 <head>
8 <title>Media test: default video size</title>
9 <script type="text/javascript" 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>
16 <pre id="test">
17 <script class="testbody" type="text/javascript">
19 SimpleTest.waitForExplicitFinish();
21 var v1 = document.createElement("video"),
22 v2 = document.createElement("video"),
23 poster = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAAAAACl1GkQAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAALJJREFUeNrtwQENAAAAwqD3T20ON6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHg0cq4AATRk8BYAAAAASUVORK5CYII",
24 resource = getPlayableVideo(gSmallTests);
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 }
37 if (resource) {
38 v1.poster = v2.poster = poster;
40 v1.src = v2.src = "http://mochi.test:8888/tests/content/media/test/" + resource.name;
42 v1.preload = "auto";
43 v2.preload = "none";
45 v1.muted = v2.muted = true;
47 document.body.appendChild(v1);
48 document.body.appendChild(v2);
49 } else {
50 todo(false, "No types supported");
51 }
53 </script>
54 </pre>
55 </body>
56 </html>