Bug 1169019 - Removed screenreader announcement from gecko. r=yzen

This commit is contained in:
Justin Obara 2015-11-08 21:22:25 -08:00 committed by Yura Zenevich
parent 92871de712
commit 0c6a085e6c
2 changed files with 19 additions and 23 deletions

View File

@ -88,8 +88,6 @@ this.AccessFu = { // jshint ignore:line
Cu.import('resource://gre/modules/accessibility/PointerAdapter.jsm');
Cu.import('resource://gre/modules/accessibility/Presentation.jsm');
Logger.info('Enabled');
for (let mm of Utils.AllMessageManagers) {
this._addMessageListeners(mm);
this._loadFrameScript(mm);
@ -146,9 +144,7 @@ this.AccessFu = { // jshint ignore:line
delete this.readyCallback;
}
if (Utils.MozBuildApp !== 'mobile/android') {
this.announce('screenReaderStarted');
}
Logger.info('AccessFu:Enabled');
},
/**
@ -161,14 +157,8 @@ this.AccessFu = { // jshint ignore:line
this._enabled = false;
Logger.info('Disabled');
Utils.win.document.removeChild(this.stylesheet.get());
if (Utils.MozBuildApp !== 'mobile/android') {
this.announce('screenReaderStopped');
}
for (let mm of Utils.AllMessageManagers) {
mm.sendAsyncMessage('AccessFu:Stop');
this._removeMessageListeners(mm);
@ -200,6 +190,8 @@ this.AccessFu = { // jshint ignore:line
this.doneCallback();
delete this.doneCallback;
}
Logger.info('AccessFu:Disabled');
},
_enableOrDisable: function _enableOrDisable() {

View File

@ -14,42 +14,46 @@
<script type="application/javascript">
function prefStart() {
AccessFuTest.once_log("AccessFu:Enabled", () =>
ok(AccessFu._enabled, "AccessFu was enabled again."));
AccessFuTest.once_log("EventManager.start", AccessFuTest.nextTest);
// Start AccessFu via pref.
SpecialPowers.setIntPref("accessibility.accessfu.activate", 1);
AccessFuTest.once_log("EventManager.start", AccessFuTest.nextTest);
}
// Listen for 'EventManager.stop' and enable AccessFu again.
function settingsStart() {
ok(true, "EventManager was stopped.");
isnot(AccessFu._enabled, true, "AccessFu was disabled.");
AccessFuTest.once({
"eventType": "announcement",
"data": [{string: "screenReaderStarted"}]
}, AccessFuTest.nextTest);
// XXX: Bug 978076 - test start with SettingsManager.
//navigator.mozSettings.createLock().set(
// {'accessibility.screenreader': false});
AccessFu._enable()
AccessFuTest.once_log("EventManager.start", () => {
ok(AccessFu._enabled, "AccessFu was enabled again.");
AccessFuTest.nextTest();
});
AccessFu._enable();
}
// Make sure EventManager is started again.
function settingsStop() {
ok(AccessFu._enabled, "AccessFu was enabled again.");
AccessFuTest.once({
"eventType": "announcement",
"data": [{string: "screenReaderStopped"}]
}, AccessFuTest.finish);
// XXX: Bug 978076 - test stop with SettingsManager.
//navigator.mozSettings.createLock().set(
// {'accessibility.screenreader': false});
AccessFuTest.once_log("EventManager.stop", () => {
isnot(AccessFu._enabled, "AccessFu was disabled.");
AccessFuTest.finish();
});
AccessFu._disable();
}
// Listen for initial 'EventManager.start' and disable AccessFu.
function prefStop() {
ok(AccessFu._enabled, "AccessFu was started via preference.");
AccessFuTest.once_log("AccessFu:Disabled", () =>
isnot(AccessFu._enabled, true, "AccessFu was disabled."));
AccessFuTest.once_log("EventManager.stop", AccessFuTest.nextTest);
SpecialPowers.setIntPref("accessibility.accessfu.activate", 0);
}
@ -74,4 +78,4 @@
Mozilla Bug 811307
</a>
</body>
</html>
</html>