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=633602 |
michael@0 | 5 | --> |
michael@0 | 6 | <head> |
michael@0 | 7 | <title>Bug 633602 - file_doubleLockCallBack.html</title> |
michael@0 | 8 | <script type="text/javascript" |
michael@0 | 9 | src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 10 | <script type="text/javascript" |
michael@0 | 11 | src="/tests/SimpleTest/EventUtils.js"></script> |
michael@0 | 12 | <script type="application/javascript" src="pointerlock_utils.js"></script> |
michael@0 | 13 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
michael@0 | 14 | <style type="text/css"> |
michael@0 | 15 | #test-element { background-color: #94E01B; width:100px; height:100px; } |
michael@0 | 16 | </style> |
michael@0 | 17 | </head> |
michael@0 | 18 | <body> |
michael@0 | 19 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602"> |
michael@0 | 20 | Mozilla Bug 633602</a> |
michael@0 | 21 | <div id="div"></div> |
michael@0 | 22 | <pre id="test"> |
michael@0 | 23 | <script type="text/javascript"> |
michael@0 | 24 | /* |
michael@0 | 25 | * Test for Bug 633602 |
michael@0 | 26 | * If element requests pointerlock on itself while in pointerlock state |
michael@0 | 27 | * mozpointerlockchange event should be dispatched |
michael@0 | 28 | */ |
michael@0 | 29 | |
michael@0 | 30 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 31 | |
michael@0 | 32 | var div = document.getElementById("div") |
michael@0 | 33 | , numberOfLocks = 0; |
michael@0 | 34 | |
michael@0 | 35 | function runTests () { |
michael@0 | 36 | is(numberOfLocks, 2, "Requesting pointer lock on a locked element " + |
michael@0 | 37 | "should dispatch mozpointerlockchange event"); |
michael@0 | 38 | } |
michael@0 | 39 | |
michael@0 | 40 | document.addEventListener("mozpointerlockchange", function (e) { |
michael@0 | 41 | if (document.mozPointerLockElement === div) { |
michael@0 | 42 | if (numberOfLocks === 2) { |
michael@0 | 43 | document.mozCancelFullScreen(); |
michael@0 | 44 | } |
michael@0 | 45 | else { |
michael@0 | 46 | numberOfLocks++; |
michael@0 | 47 | div.mozRequestPointerLock(); |
michael@0 | 48 | } |
michael@0 | 49 | } |
michael@0 | 50 | }, false); |
michael@0 | 51 | |
michael@0 | 52 | document.addEventListener("mozfullscreenchange", function (e) { |
michael@0 | 53 | if (document.mozFullScreenElement === div) { |
michael@0 | 54 | div.mozRequestPointerLock(); |
michael@0 | 55 | } |
michael@0 | 56 | else { |
michael@0 | 57 | runTests(); |
michael@0 | 58 | SimpleTest.finish(); |
michael@0 | 59 | } |
michael@0 | 60 | }, false); |
michael@0 | 61 | |
michael@0 | 62 | function start() { |
michael@0 | 63 | console.log('started'); |
michael@0 | 64 | div.mozRequestFullScreen(); |
michael@0 | 65 | } |
michael@0 | 66 | </script> |
michael@0 | 67 | </pre> |
michael@0 | 68 | </body> |
michael@0 | 69 | </html> |