Bug 1169019 - Removed screenreader announcement from gecko. r=yzen
authorJustin Obara <obara.justin@gmail.com>
Sun, 08 Nov 2015 21:22:25 -0800
changeset 305831 74b392c19fc5e1346aa256142a7f57e4428710f4
parent 305830 797d3b54d0db543988f97f42e1a819e35179d738
child 305832 519871bf80fc3dda927a113960302c0dde954e15
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyzen
bugs1169019
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1169019 - Removed screenreader announcement from gecko. r=yzen
accessible/jsat/AccessFu.jsm
accessible/tests/mochitest/jsat/test_alive.html
--- a/accessible/jsat/AccessFu.jsm
+++ b/accessible/jsat/AccessFu.jsm
@@ -83,18 +83,16 @@ this.AccessFu = { // jshint ignore:line
       return;
     }
     this._enabled = true;
 
     Cu.import('resource://gre/modules/accessibility/Utils.jsm');
     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);
     }
 
     // Add stylesheet
     let stylesheetURL = 'chrome://global/content/accessibility/AccessFu.css';
     let stylesheet = Utils.win.document.createProcessingInstruction(
@@ -141,39 +139,31 @@ this.AccessFu = { // jshint ignore:line
     Utils.win.addEventListener('TabClose', this);
     Utils.win.addEventListener('TabSelect', this);
 
     if (this.readyCallback) {
       this.readyCallback();
       delete this.readyCallback;
     }
 
-    if (Utils.MozBuildApp !== 'mobile/android') {
-      this.announce('screenReaderStarted');
-    }
+    Logger.info('AccessFu:Enabled');
   },
 
   /**
    * Disable AccessFu and return to default interaction mode.
    */
   _disable: function _disable() {
     if (!this._enabled) {
       return;
     }
 
     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);
     }
 
     this.Input.stop();
     Output.stop();
     PointerAdapter.stop();
@@ -195,16 +185,18 @@ this.AccessFu = { // jshint ignore:line
 
     delete this._quicknavModesPref;
     delete this._notifyOutputPref;
 
     if (this.doneCallback) {
       this.doneCallback();
       delete this.doneCallback;
     }
+
+    Logger.info('AccessFu:Disabled');
   },
 
   _enableOrDisable: function _enableOrDisable() {
     try {
       if (!this._activatePref) {
         return;
       }
       let activatePref = this._activatePref.value;
--- a/accessible/tests/mochitest/jsat/test_alive.html
+++ b/accessible/tests/mochitest/jsat/test_alive.html
@@ -9,52 +9,56 @@
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="./jsatcommon.js"></script>
   <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);
     }
 
     function doTest() {
       AccessFuTest.addFunc(prefStart);
       AccessFuTest.addFunc(prefStop);
       AccessFuTest.addFunc(settingsStart);
       AccessFuTest.addFunc(settingsStop);
@@ -69,9 +73,9 @@
 </head>
 <body>
   <a target="_blank"
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=811307"
      title="[AccessFu] Add mochitest for enabling">
     Mozilla Bug 811307
   </a>
 </body>
-</html>
\ No newline at end of file
+</html>