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.
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <!-- |
michael@0 | 4 | https://bugzilla.mozilla.org/show_bug.cgi?id=604067 |
michael@0 | 5 | --> |
michael@0 | 6 | <head> |
michael@0 | 7 | <title>Test for Bug 604067</title> |
michael@0 | 8 | <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 9 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
michael@0 | 10 | <script type="text/javascript" src="manifest.js"></script> |
michael@0 | 11 | </head> |
michael@0 | 12 | <body> |
michael@0 | 13 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=604067">Mozilla Bug 604067</a> |
michael@0 | 14 | |
michael@0 | 15 | <p id="display"></p> |
michael@0 | 16 | <div id="content" style="display: none"> |
michael@0 | 17 | |
michael@0 | 18 | </div> |
michael@0 | 19 | <pre id="test"> |
michael@0 | 20 | <script type="application/javascript"> |
michael@0 | 21 | |
michael@0 | 22 | /** Test for Bug 604067 **/ |
michael@0 | 23 | |
michael@0 | 24 | function check() { |
michael@0 | 25 | var v = document.body.getElementsByTagName("iframe")[0] |
michael@0 | 26 | .contentDocument.body.getElementsByTagName("video")[0]; |
michael@0 | 27 | |
michael@0 | 28 | // Debug info for Bug 608634 |
michael@0 | 29 | ok(true, "iframe src=" + document.body.getElementsByTagName("iframe")[0].src); |
michael@0 | 30 | is(v.readyState, 0, "Ready state"); |
michael@0 | 31 | |
michael@0 | 32 | is(v.networkState, 0, "Network state"); |
michael@0 | 33 | isnot(v.error, null, "Error object"); |
michael@0 | 34 | if (v.error) |
michael@0 | 35 | is(v.error.code, MediaError.MEDIA_ERR_DECODE, "Error code"); |
michael@0 | 36 | |
michael@0 | 37 | SimpleTest.finish(); |
michael@0 | 38 | } |
michael@0 | 39 | |
michael@0 | 40 | // Find an error test that we'd think we should be able to play (if it |
michael@0 | 41 | // wasn't already known to fail). |
michael@0 | 42 | var t = getPlayableVideo(gErrorTests); |
michael@0 | 43 | if (!t) { |
michael@0 | 44 | todo(false, "No types supported"); |
michael@0 | 45 | } else { |
michael@0 | 46 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 47 | |
michael@0 | 48 | var f = document.createElement("iframe"); |
michael@0 | 49 | f.src = t.name; |
michael@0 | 50 | f.addEventListener("load", function() { SimpleTest.executeSoon(check); }, false); |
michael@0 | 51 | document.body.appendChild(f); |
michael@0 | 52 | } |
michael@0 | 53 | |
michael@0 | 54 | </script> |
michael@0 | 55 | </pre> |
michael@0 | 56 | </body> |
michael@0 | 57 | </html> |