1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/tests/mochitest/jsat/test_alive.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,83 @@ 1.4 +<html> 1.5 + 1.6 +<head> 1.7 + <title>AccessFu test for enabling</title> 1.8 + 1.9 + <link rel="stylesheet" type="text/css" 1.10 + href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 1.11 + <script type="application/javascript" 1.12 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 1.13 + <script type="application/javascript" 1.14 + src="../common.js"></script> 1.15 + <script type="application/javascript" 1.16 + src="./jsatcommon.js"></script> 1.17 + <script type="application/javascript"> 1.18 + 1.19 + function prefStart() { 1.20 + // Start AccessFu via pref. 1.21 + SpecialPowers.setIntPref("accessibility.accessfu.activate", 1); 1.22 + AccessFuTest.once_log("EventManager.start", AccessFuTest.nextTest); 1.23 + } 1.24 + 1.25 + // Listen for 'EventManager.stop' and enable AccessFu again. 1.26 + function settingsStart() { 1.27 + ok(true, "EventManager was stopped."); 1.28 + isnot(AccessFu._enabled, true, "AccessFu was disabled."); 1.29 + AccessFuTest.once([{ 1.30 + "method": "speak", 1.31 + "data": "Screen reader started", 1.32 + "options": { 1.33 + "enqueue": false 1.34 + } 1.35 + }], AccessFuTest.nextTest); 1.36 + // XXX: Bug 978076 - test start with SettingsManager. 1.37 + //navigator.mozSettings.createLock().set( 1.38 + // {'accessibility.screenreader': false}); 1.39 + AccessFu._enable() 1.40 + } 1.41 + 1.42 + // Make sure EventManager is started again. 1.43 + function settingsStop() { 1.44 + ok(AccessFu._enabled, "AccessFu was enabled again."); 1.45 + AccessFuTest.once([{ 1.46 + "method": "speak", 1.47 + "data": "Screen reader stopped", 1.48 + "options": { 1.49 + "enqueue": false 1.50 + } 1.51 + }], AccessFuTest.finish); 1.52 + // XXX: Bug 978076 - test stop with SettingsManager. 1.53 + //navigator.mozSettings.createLock().set( 1.54 + // {'accessibility.screenreader': false}); 1.55 + AccessFu._disable(); 1.56 + } 1.57 + 1.58 + // Listen for initial 'EventManager.start' and disable AccessFu. 1.59 + function prefStop() { 1.60 + ok(AccessFu._enabled, "AccessFu was started via preference."); 1.61 + AccessFuTest.once_log("EventManager.stop", AccessFuTest.nextTest); 1.62 + SpecialPowers.setIntPref("accessibility.accessfu.activate", 0); 1.63 + } 1.64 + 1.65 + function doTest() { 1.66 + AccessFuTest.addFunc(prefStart); 1.67 + AccessFuTest.addFunc(prefStop); 1.68 + AccessFuTest.addFunc(settingsStart); 1.69 + AccessFuTest.addFunc(settingsStop); 1.70 + AccessFuTest.waitForExplicitFinish(); 1.71 + AccessFuTest.runTests(); // Will call SimpleTest.finish(); 1.72 + } 1.73 + 1.74 + SimpleTest.waitForExplicitFinish(); 1.75 + addA11yLoadEvent(doTest); 1.76 + </script> 1.77 + 1.78 +</head> 1.79 +<body> 1.80 + <a target="_blank" 1.81 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=811307" 1.82 + title="[AccessFu] Add mochitest for enabling"> 1.83 + Mozilla Bug 811307 1.84 + </a> 1.85 +</body> 1.86 +</html> 1.87 \ No newline at end of file