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 | <html> |
michael@0 | 2 | |
michael@0 | 3 | <head> |
michael@0 | 4 | <title>AccessFu test for enabling</title> |
michael@0 | 5 | |
michael@0 | 6 | <link rel="stylesheet" type="text/css" |
michael@0 | 7 | href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
michael@0 | 8 | <script type="application/javascript" |
michael@0 | 9 | src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 10 | <script type="application/javascript" |
michael@0 | 11 | src="../common.js"></script> |
michael@0 | 12 | <script type="application/javascript" |
michael@0 | 13 | src="./jsatcommon.js"></script> |
michael@0 | 14 | <script type="application/javascript"> |
michael@0 | 15 | |
michael@0 | 16 | function prefStart() { |
michael@0 | 17 | // Start AccessFu via pref. |
michael@0 | 18 | SpecialPowers.setIntPref("accessibility.accessfu.activate", 1); |
michael@0 | 19 | AccessFuTest.once_log("EventManager.start", AccessFuTest.nextTest); |
michael@0 | 20 | } |
michael@0 | 21 | |
michael@0 | 22 | // Listen for 'EventManager.stop' and enable AccessFu again. |
michael@0 | 23 | function settingsStart() { |
michael@0 | 24 | ok(true, "EventManager was stopped."); |
michael@0 | 25 | isnot(AccessFu._enabled, true, "AccessFu was disabled."); |
michael@0 | 26 | AccessFuTest.once([{ |
michael@0 | 27 | "method": "speak", |
michael@0 | 28 | "data": "Screen reader started", |
michael@0 | 29 | "options": { |
michael@0 | 30 | "enqueue": false |
michael@0 | 31 | } |
michael@0 | 32 | }], AccessFuTest.nextTest); |
michael@0 | 33 | // XXX: Bug 978076 - test start with SettingsManager. |
michael@0 | 34 | //navigator.mozSettings.createLock().set( |
michael@0 | 35 | // {'accessibility.screenreader': false}); |
michael@0 | 36 | AccessFu._enable() |
michael@0 | 37 | } |
michael@0 | 38 | |
michael@0 | 39 | // Make sure EventManager is started again. |
michael@0 | 40 | function settingsStop() { |
michael@0 | 41 | ok(AccessFu._enabled, "AccessFu was enabled again."); |
michael@0 | 42 | AccessFuTest.once([{ |
michael@0 | 43 | "method": "speak", |
michael@0 | 44 | "data": "Screen reader stopped", |
michael@0 | 45 | "options": { |
michael@0 | 46 | "enqueue": false |
michael@0 | 47 | } |
michael@0 | 48 | }], AccessFuTest.finish); |
michael@0 | 49 | // XXX: Bug 978076 - test stop with SettingsManager. |
michael@0 | 50 | //navigator.mozSettings.createLock().set( |
michael@0 | 51 | // {'accessibility.screenreader': false}); |
michael@0 | 52 | AccessFu._disable(); |
michael@0 | 53 | } |
michael@0 | 54 | |
michael@0 | 55 | // Listen for initial 'EventManager.start' and disable AccessFu. |
michael@0 | 56 | function prefStop() { |
michael@0 | 57 | ok(AccessFu._enabled, "AccessFu was started via preference."); |
michael@0 | 58 | AccessFuTest.once_log("EventManager.stop", AccessFuTest.nextTest); |
michael@0 | 59 | SpecialPowers.setIntPref("accessibility.accessfu.activate", 0); |
michael@0 | 60 | } |
michael@0 | 61 | |
michael@0 | 62 | function doTest() { |
michael@0 | 63 | AccessFuTest.addFunc(prefStart); |
michael@0 | 64 | AccessFuTest.addFunc(prefStop); |
michael@0 | 65 | AccessFuTest.addFunc(settingsStart); |
michael@0 | 66 | AccessFuTest.addFunc(settingsStop); |
michael@0 | 67 | AccessFuTest.waitForExplicitFinish(); |
michael@0 | 68 | AccessFuTest.runTests(); // Will call SimpleTest.finish(); |
michael@0 | 69 | } |
michael@0 | 70 | |
michael@0 | 71 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 72 | addA11yLoadEvent(doTest); |
michael@0 | 73 | </script> |
michael@0 | 74 | |
michael@0 | 75 | </head> |
michael@0 | 76 | <body> |
michael@0 | 77 | <a target="_blank" |
michael@0 | 78 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=811307" |
michael@0 | 79 | title="[AccessFu] Add mochitest for enabling"> |
michael@0 | 80 | Mozilla Bug 811307 |
michael@0 | 81 | </a> |
michael@0 | 82 | </body> |
michael@0 | 83 | </html> |