Bug 527003 - renaming all XPCOM uses of deprecated accessible retrieval to accessibility service. r=surkov
authorYura Zenevich <yzenevich@mozilla.com>
Mon, 08 Aug 2016 11:47:48 -0400
changeset 350132 79d61727522abfb72cf4c5613708a493bf0470c6
parent 350131 d7750d91b9179fab6fe27f912552101d2515c5b9
child 350133 cc88b920a38772b61dc7d2dc3f37e969399c294f
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs527003
milestone51.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 527003 - renaming all XPCOM uses of deprecated accessible retrieval to accessibility service. r=surkov MozReview-Commit-ID: DDJmHOMfXLo
accessible/jsat/AccessFu.jsm
accessible/jsat/ContentControl.jsm
accessible/jsat/EventManager.jsm
accessible/jsat/OutputGenerator.jsm
accessible/jsat/Traversal.jsm
accessible/jsat/Utils.jsm
accessible/jsat/content-script.js
accessible/tests/crashtests/448064.xhtml
accessible/tests/crashtests/471493.xul
accessible/tests/mochitest/common.js
accessible/tests/mochitest/events/docload_wnd.html
accessible/tests/mochitest/events/test_docload.html
accessible/tests/mochitest/pivot.js
accessible/tests/mochitest/states/z_frames_update.html
testing/marionette/accessibility.js
testing/talos/talos/tests/a11y/a11y.js
--- a/accessible/jsat/AccessFu.jsm
+++ b/accessible/jsat/AccessFu.jsm
@@ -242,17 +242,17 @@ this.AccessFu = { // jshint ignore:line
       case 'AccessFu:DoScroll':
         this.Input.doScroll(aMessage.json);
         break;
     }
   },
 
   _output: function _output(aPresentationData, aBrowser) {
     if (!Utils.isAliveAndVisible(
-      Utils.AccRetrieval.getAccessibleFor(aBrowser))) {
+      Utils.AccService.getAccessibleFor(aBrowser))) {
       return;
     }
     for (let presenter of aPresentationData) {
       if (!presenter) {
         continue;
       }
 
       try {
--- a/accessible/jsat/ContentControl.jsm
+++ b/accessible/jsat/ContentControl.jsm
@@ -217,17 +217,17 @@ this.ContentControl.prototype = {
         if (control && control.actionCount > 0) {
           control.doAction(0);
         }
 
         // XXX Some mobile widget sets do not expose actions properly
         // (via ARIA roles, etc.), so we need to generate a click.
         // Could possibly be made simpler in the future. Maybe core
         // engine could expose nsCoreUtiles::DispatchMouseEvent()?
-        let docAcc = Utils.AccRetrieval.getAccessibleFor(this.document);
+        let docAcc = Utils.AccService.getAccessibleFor(this.document);
         let docX = {}, docY = {}, docW = {}, docH = {};
         docAcc.getBounds(docX, docY, docW, docH);
 
         let objX = {}, objY = {}, objW = {}, objH = {};
         aAccessible.getBounds(objX, objY, objW, objH);
 
         let x = Math.round((objX.value - docX.value) + objW.value / 2);
         let y = Math.round((objY.value - docY.value) + objH.value / 2);
@@ -244,17 +244,17 @@ this.ContentControl.prototype = {
 
       if (!Utils.isActivatableOnFingerUp(aAccessible)) {
         // Keys will typically have a sound of their own.
         this._contentScope.get().sendAsyncMessage('AccessFu:Present',
           Presentation.actionInvoked(aAccessible, 'click'));
       }
     };
 
-    let focusedAcc = Utils.AccRetrieval.getAccessibleFor(
+    let focusedAcc = Utils.AccService.getAccessibleFor(
       this.document.activeElement);
     if (focusedAcc && this.vc.position === focusedAcc
         && focusedAcc.role === Roles.ENTRY) {
       let accText = focusedAcc.QueryInterface(Ci.nsIAccessibleText);
       let oldOffset = accText.caretOffset;
       let newOffset = aMessage.json.offset;
       let text = accText.getText(0, accText.characterCount);
 
@@ -473,17 +473,17 @@ this.ContentControl.prototype = {
 
       if (aOptions.noOpIfOnScreen &&
         Utils.isAliveAndVisible(vc.position, true)) {
         forcePresentFunc();
         return;
       }
 
       if (aOptions.moveToFocused) {
-        acc = Utils.AccRetrieval.getAccessibleFor(
+        acc = Utils.AccService.getAccessibleFor(
           this.document.activeElement) || acc;
       }
 
       let moved = false;
       let moveMethod = aOptions.moveMethod || 'moveNext'; // default is moveNext
       let moveFirstOrLast = moveMethod in ['moveFirst', 'moveLast'];
       if (!moveFirstOrLast || acc) {
         // We either need next/previous or there is an anchor we need to use.
--- a/accessible/jsat/EventManager.jsm
+++ b/accessible/jsat/EventManager.jsm
@@ -554,25 +554,25 @@ this.EventManager.prototype = {
     if ((aStateFlags & loadingState) == loadingState) {
       tabstate = 'loading';
     } else if ((aStateFlags & loadedState) == loadedState &&
                !aWebProgress.isLoadingDocument) {
       tabstate = 'loaded';
     }
 
     if (tabstate) {
-      let docAcc = Utils.AccRetrieval.getAccessibleFor(aWebProgress.DOMWindow.document);
+      let docAcc = Utils.AccService.getAccessibleFor(aWebProgress.DOMWindow.document);
       this.present(Presentation.tabStateChanged(docAcc, tabstate));
     }
   },
 
   onProgressChange: function onProgressChange() {},
 
   onLocationChange: function onLocationChange(aWebProgress, aRequest, aLocation, aFlags) {
-    let docAcc = Utils.AccRetrieval.getAccessibleFor(aWebProgress.DOMWindow.document);
+    let docAcc = Utils.AccService.getAccessibleFor(aWebProgress.DOMWindow.document);
     this.present(Presentation.tabStateChanged(docAcc, 'newdoc'));
   },
 
   onStatusChange: function onStatusChange() {},
 
   onSecurityChange: function onSecurityChange() {},
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
--- a/accessible/jsat/OutputGenerator.jsm
+++ b/accessible/jsat/OutputGenerator.jsm
@@ -47,17 +47,17 @@ var OutputGenerator = {
    */
   genForContext: function genForContext(aContext) {
     let output = [];
     let self = this;
     let addOutput = function addOutput(aAccessible) {
       output.push.apply(output, self.genForObject(aAccessible, aContext));
     };
     let ignoreSubtree = function ignoreSubtree(aAccessible) {
-      let roleString = Utils.AccRetrieval.getStringRole(aAccessible.role);
+      let roleString = Utils.AccService.getStringRole(aAccessible.role);
       let nameRule = self.roleRuleMap[roleString] || 0;
       // Ignore subtree if the name is explicit and the role's name rule is the
       // NAME_FROM_SUBTREE_RULE.
       return (((nameRule & INCLUDE_VALUE) && aAccessible.value) ||
               ((nameRule & NAME_FROM_SUBTREE_RULE) &&
                (Utils.getAttributes(aAccessible)['explicit-name'] === 'true' &&
                !(nameRule & IGNORE_EXPLICIT_NAME))));
     };
@@ -103,17 +103,17 @@ var OutputGenerator = {
    *    context information for a given accessible and its relationship with
    *    another accessible.
    * @return {Array} A 2 element array of speech data. The first element
    *    describes the object and its state. The second element is the object's
    *    name. Whether the object's description or it's role is included is
    *    determined by {@link roleRuleMap}.
    */
   genForObject: function genForObject(aAccessible, aContext) {
-    let roleString = Utils.AccRetrieval.getStringRole(aAccessible.role);
+    let roleString = Utils.AccService.getStringRole(aAccessible.role);
     let func = this.objectOutputFunctions[
       OutputGenerator._getOutputName(roleString)] ||
       this.objectOutputFunctions.defaultFunc;
 
     let flags = this.roleRuleMap[roleString] || 0;
 
     if (aAccessible.childCount === 0) {
       flags |= INCLUDE_NAME;
--- a/accessible/jsat/Traversal.jsm
+++ b/accessible/jsat/Traversal.jsm
@@ -377,17 +377,17 @@ this.TraversalHelper = {
     delete this.helperPivotCache;
     this.helperPivotCache = new WeakMap();
     return this.helperPivotCache;
   },
 
   getHelperPivot: function TraversalHelper_getHelperPivot(aRoot) {
     let pivot = this.helperPivotCache.get(aRoot.DOMNode);
     if (!pivot) {
-      pivot = Utils.AccRetrieval.createAccessiblePivot(aRoot);
+      pivot = Utils.AccService.createAccessiblePivot(aRoot);
       this.helperPivotCache.set(aRoot.DOMNode, pivot);
     }
 
     return pivot;
   },
 
   move: function TraversalHelper_move(aVirtualCursor, aMethod, aRule) {
     let rule = TraversalRules[aRule];
--- a/accessible/jsat/Utils.jsm
+++ b/accessible/jsat/Utils.jsm
@@ -64,23 +64,23 @@ this.Utils = { // jshint ignore:line
     let win = this.win;
     if (!win) {
       return null;
     }
     return win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(
       Ci.nsIDOMWindowUtils);
   },
 
-  get AccRetrieval() {
-    if (!this._AccRetrieval) {
-      this._AccRetrieval = Cc['@mozilla.org/accessibleRetrieval;1'].
-        getService(Ci.nsIAccessibleRetrieval);
+  get AccService() {
+    if (!this._AccService) {
+      this._AccService = Cc['@mozilla.org/accessibilityService;1'].
+        getService(Ci.nsIAccessibilityService);
     }
 
-    return this._AccRetrieval;
+    return this._AccService;
   },
 
   set MozBuildApp(value) {
     this._buildApp = value;
   },
 
   get MozBuildApp() {
     if (!this._buildApp) {
@@ -290,17 +290,17 @@ this.Utils = { // jshint ignore:line
       }
     }
 
     return attributes;
   },
 
   getVirtualCursor: function getVirtualCursor(aDocument) {
     let doc = (aDocument instanceof Ci.nsIAccessible) ? aDocument :
-      this.AccRetrieval.getAccessibleFor(aDocument);
+      this.AccService.getAccessibleFor(aDocument);
 
     return doc.QueryInterface(Ci.nsIAccessibleDocument).virtualCursor;
   },
 
   getContentResolution: function _getContentResolution(aAccessible) {
     let res = { value: 1 };
     aAccessible.document.window.QueryInterface(
       Ci.nsIInterfaceRequestor).getInterface(
@@ -534,17 +534,17 @@ function State(aBase, aExtended) {
   this.extended = aExtended;
 }
 
 State.prototype = {
   contains: function State_contains(other) {
     return !!(this.base & other.base || this.extended & other.extended);
   },
   toString: function State_toString() {
-    let stateStrings = Utils.AccRetrieval.
+    let stateStrings = Utils.AccService.
       getStringStates(this.base, this.extended);
     let statesArray = new Array(stateStrings.length);
     for (let i = 0; i < statesArray.length; i++) {
       statesArray[i] = stateStrings.item(i);
     }
     return '[' + statesArray.join(', ') + ']';
   }
 };
@@ -635,30 +635,30 @@ this.Logger = { // jshint ignore:line
   },
 
   accessibleToString: function accessibleToString(aAccessible) {
     if (!aAccessible) {
       return '[ null ]';
     }
 
     try {
-      return'[ ' + Utils.AccRetrieval.getStringRole(aAccessible.role) +
+      return'[ ' + Utils.AccService.getStringRole(aAccessible.role) +
         ' | ' + aAccessible.name + ' ]';
     } catch (x) {
       return '[ defunct ]';
     }
   },
 
   eventToString: function eventToString(aEvent) {
-    let str = Utils.AccRetrieval.getStringEventType(aEvent.eventType);
+    let str = Utils.AccService.getStringEventType(aEvent.eventType);
     if (aEvent.eventType == Events.STATE_CHANGE) {
       let event = aEvent.QueryInterface(Ci.nsIAccessibleStateChangeEvent);
       let stateStrings = event.isExtraState ?
-        Utils.AccRetrieval.getStringStates(0, event.state) :
-        Utils.AccRetrieval.getStringStates(event.state, 0);
+        Utils.AccService.getStringStates(0, event.state) :
+        Utils.AccService.getStringStates(event.state, 0);
       str += ' (' + stateStrings.item(0) + ')';
     }
 
     if (aEvent.eventType == Events.VIRTUALCURSOR_CHANGED) {
       let event = aEvent.QueryInterface(
         Ci.nsIAccessibleVirtualCursorChangeEvent);
       let pivot = aEvent.accessible.QueryInterface(
         Ci.nsIAccessibleDocument).virtualCursor;
@@ -882,17 +882,17 @@ PivotContext.prototype = {
   get interactionHints() {
     let hints = [];
     this.newAncestry.concat(this.accessible).reverse().forEach(aAccessible => {
       let hint = Utils.getAttributes(aAccessible)['moz-hint'];
       if (hint) {
         hints.push(hint);
       } else if (aAccessible.actionCount > 0) {
         hints.push({
-          string: Utils.AccRetrieval.getStringRole(
+          string: Utils.AccService.getStringRole(
             aAccessible.role).replace(/\s/g, '') + '-hint'
         });
       }
     });
     return hints;
   },
 
   /*
--- a/accessible/jsat/content-script.js
+++ b/accessible/jsat/content-script.js
@@ -116,17 +116,17 @@ addMessageListener(
 
     if (!eventManager) {
       eventManager = new EventManager(this, contentControl);
     }
     eventManager.inTest = m.json.inTest;
     eventManager.start();
 
     function contentStarted() {
-      let accDoc = Utils.AccRetrieval.getAccessibleFor(content.document);
+      let accDoc = Utils.AccService.getAccessibleFor(content.document);
       if (accDoc && !Utils.getState(accDoc).contains(States.BUSY)) {
         sendAsyncMessage('AccessFu:ContentStarted');
       } else {
         content.setTimeout(contentStarted, 0);
       }
     }
 
     if (m.json.inTest) {
--- a/accessible/tests/crashtests/448064.xhtml
+++ b/accessible/tests/crashtests/448064.xhtml
@@ -44,18 +44,18 @@ netscape.security.PrivilegeManager.enabl
 		}
 	} catch (e) {
 		dump("Error visiting child nodes: " + e + '\n');
 	}
 }
 
 function A(o) { 
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-  var acc = Components.classes['@mozilla.org/accessibleRetrieval;1']
-                         .getService(Components.interfaces.nsIAccessibleRetrieval);
+  var acc = Components.classes['@mozilla.org/accessibilityService;1']
+                         .getService(Components.interfaces.nsIAccessibilityService);
   return acc.getAccessibleFor(o);
 }
 
 function beginAccessible() {
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   dumpAccessibleTree(A(document),0);
 }
 setTimeout(beginAccessible, 100);
--- a/accessible/tests/crashtests/471493.xul
+++ b/accessible/tests/crashtests/471493.xul
@@ -4,25 +4,25 @@
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         title="bug 471493 'crash [@ nsPropertyTable::GetPropertyInternal]'"
         onload="doTest();">
 
   <script type="application/javascript">
   <![CDATA[
     function doTest()
     {
-      var accRetrieval = SpecialPowers.Cc["@mozilla.org/accessibleRetrieval;1"].
-        getService(SpecialPowers.Ci.nsIAccessibleRetrieval);
+      var accService = SpecialPowers.Cc["@mozilla.org/accessibilityService;1"].
+        getService(SpecialPowers.Ci.nsIAccessibilityService);
 
       var treecol = document.getElementById("col");
       var x = treecol.boxObject.screenX;
       var y = treecol.boxObject.screenY;
 
       var tree = document.getElementById("tree");
-      var treeAcc = accRetrieval.getAccessibleFor(tree);
+      var treeAcc = accService.getAccessibleFor(tree);
       treeAcc.getChildAtPoint(x + 1, y + 1);
     }
   ]]>
   </script>
 
   <tree id="tree" flex="1">
     <treecols>
       <treecol id="col" flex="1" primary="true" label="column"/>
--- a/accessible/tests/mochitest/common.js
+++ b/accessible/tests/mochitest/common.js
@@ -1,12 +1,12 @@
 ////////////////////////////////////////////////////////////////////////////////
 // Interfaces
 
-const nsIAccessibleRetrieval = Components.interfaces.nsIAccessibleRetrieval;
+const nsIAccessibilityService = Components.interfaces.nsIAccessibilityService;
 
 const nsIAccessibleEvent = Components.interfaces.nsIAccessibleEvent;
 const nsIAccessibleStateChangeEvent =
   Components.interfaces.nsIAccessibleStateChangeEvent;
 const nsIAccessibleCaretMoveEvent =
   Components.interfaces.nsIAccessibleCaretMoveEvent;
 const nsIAccessibleTextChangeEvent =
   Components.interfaces.nsIAccessibleTextChangeEvent;
@@ -89,35 +89,35 @@ const kSquareBulletText = String.fromCha
 const MAX_TRIM_LENGTH = 100;
 
 /**
  * Services to determine if e10s is enabled.
  */
 Components.utils.import('resource://gre/modules/Services.jsm');
 
 /**
- * nsIAccessibleRetrieval service.
+ * nsIAccessibilityService service.
  */
-var gAccRetrieval = Components.classes["@mozilla.org/accessibleRetrieval;1"].
-  getService(nsIAccessibleRetrieval);
+var gAccService = Components.classes["@mozilla.org/accessibilityService;1"].
+  getService(nsIAccessibilityService);
 
 /**
  * Enable/disable logging.
  */
 function enableLogging(aModules)
 {
-  gAccRetrieval.setLogging(aModules);
+  gAccService.setLogging(aModules);
 }
 function disableLogging()
 {
-  gAccRetrieval.setLogging("");
+  gAccService.setLogging("");
 }
 function isLogged(aModule)
 {
-  return gAccRetrieval.isLogged(aModule);
+  return gAccService.isLogged(aModule);
 }
 
 /**
  * Dumps the accessible tree into console.
  */
 function dumpTree(aId, aMsg)
 {
   function dumpTreeIntl(acc, indent)
@@ -267,17 +267,17 @@ function getAccessible(aAccOrElmOrID, aI
   }
 
   if (aElmObj && (typeof aElmObj == "object"))
     aElmObj.value = elm;
 
   var acc = (aAccOrElmOrID instanceof nsIAccessible) ? aAccOrElmOrID : null;
   if (!acc) {
     try {
-      acc = gAccRetrieval.getAccessibleFor(elm);
+      acc = gAccService.getAccessibleFor(elm);
     } catch (e) {
     }
 
     if (!acc) {
       if (!(aDoNotFailIf & DONOTFAIL_IF_NO_ACC))
         ok(false, "Can't get accessible for " + prettyName(aAccOrElmOrID));
 
       return null;
@@ -358,17 +358,17 @@ function getTabDocAccessible(aAccOrElmOr
   return containerDocAcc.QueryInterface(nsIAccessible);
 }
 
 /**
  * Return application accessible.
  */
 function getApplicationAccessible()
 {
-  return gAccRetrieval.getApplicationAccessible().
+  return gAccService.getApplicationAccessible().
     QueryInterface(nsIAccessibleApplication);
 }
 
 /**
  * A version of accessible tree testing, doesn't fail if tree is not complete.
  */
 function testElm(aID, aTreeObj)
 {
@@ -579,17 +579,17 @@ function testAccessibleTree(aAccOrElmOrI
 }
 
 /**
  * Return true if accessible for the given node is in cache.
  */
 function isAccessibleInCache(aNodeOrId)
 {
   var node = getNode(aNodeOrId);
-  return gAccRetrieval.getAccessibleFromCache(node) ? true : false;
+  return gAccService.getAccessibleFromCache(node) ? true : false;
 }
 
 /**
  * Test accessible tree for defunct accessible.
  *
  * @param  aAcc       [in] the defunct accessible
  * @param  aNodeOrId  [in] the DOM node identifier for the defunct accessible
  */
@@ -666,50 +666,50 @@ function testDefunctAccessible(aAcc, aNo
   ok(success, "parent" + msg);
 }
 
 /**
  * Convert role to human readable string.
  */
 function roleToString(aRole)
 {
-  return gAccRetrieval.getStringRole(aRole);
+  return gAccService.getStringRole(aRole);
 }
 
 /**
  * Convert states to human readable string.
  */
 function statesToString(aStates, aExtraStates)
 {
-  var list = gAccRetrieval.getStringStates(aStates, aExtraStates);
+  var list = gAccService.getStringStates(aStates, aExtraStates);
 
   var str = "";
   for (var index = 0; index < list.length - 1; index++)
     str += list.item(index) + ", ";
 
   if (list.length != 0)
     str += list.item(index)
 
   return str;
 }
 
 /**
  * Convert event type to human readable string.
  */
 function eventTypeToString(aEventType)
 {
-  return gAccRetrieval.getStringEventType(aEventType);
+  return gAccService.getStringEventType(aEventType);
 }
 
 /**
  * Convert relation type to human readable string.
  */
 function relationTypeToString(aRelationType)
 {
-  return gAccRetrieval.getStringRelationType(aRelationType);
+  return gAccService.getStringRelationType(aRelationType);
 }
 
 function getLoadContext() {
   const Ci = Components.interfaces;
   return window.QueryInterface(Ci.nsIInterfaceRequestor)
                .getInterface(Ci.nsIWebNavigation)
                .QueryInterface(Ci.nsILoadContext);
 }
--- a/accessible/tests/mochitest/events/docload_wnd.html
+++ b/accessible/tests/mochitest/events/docload_wnd.html
@@ -1,38 +1,38 @@
 <html>
 <head>
   <title>Accessible events testing for document</title>
   <script>
     const STATE_BUSY = Components.interfaces.nsIAccessibleStates.STATE_BUSY;
 
-    var gRetrieval = null;
+    var gService = null;
     function waitForDocLoad()
     {
-      if (!gRetrieval) {
-        gRetrieval = Components.classes["@mozilla.org/accessibleRetrieval;1"].
-         getService(Components.interfaces.nsIAccessibleRetrieval);
+      if (!gService) {
+        gService = Components.classes["@mozilla.org/accessibilityService;1"].
+         getService(Components.interfaces.nsIAccessibilityService);
       }
 
-      var accDoc = gRetrieval.getAccessibleFor(document);
+      var accDoc = gService.getAccessibleFor(document);
 
       var state = {};
       accDoc.getState(state, {});
       if (state.value & STATE_BUSY) {
         window.setTimeout(waitForDocLoad, 0);
         return;
       }
 
       hideIFrame();
     }
 
     function hideIFrame()
     {
       var iframe = document.getElementById("iframe");
-      gRetrieval.getAccessibleFor(iframe.contentDocument);
+      gService.getAccessibleFor(iframe.contentDocument);
       iframe.style.display = 'none';
     }
   </script>
 </head>
 
 <body onload="waitForDocLoad();">
   <iframe id="iframe"></iframe>
 </body>
--- a/accessible/tests/mochitest/events/test_docload.html
+++ b/accessible/tests/mochitest/events/test_docload.html
@@ -18,25 +18,25 @@
 
   <script type="application/javascript">
     // Front end stuff sometimes likes to stuff things in the hidden window(s)
     // in which case there's accessibles for that content.
     Components.utils.import("resource://gre/modules/Services.jsm");
 
     // Force the creation of an accessible for the hidden window's document.
     var doc = Services.appShell.hiddenDOMWindow.document;
-    gAccRetrieval.getAccessibleFor(doc);
+    gAccService.getAccessibleFor(doc);
 
     // The private hidden window will be lazily created that's why we need to do
     // it here *before* loading '../events.js' or else we'll have a duplicate
     // reorder event.
     var privateDoc = Services.appShell.hiddenPrivateDOMWindow.document;
 
     // Force the creation of an accessible for the private hidden window's doc.
-    gAccRetrieval.getAccessibleFor(privateDoc);
+    gAccService.getAccessibleFor(privateDoc);
   </script>
 
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     ////////////////////////////////////////////////////////////////////////////
     // Invokers
--- a/accessible/tests/mochitest/pivot.js
+++ b/accessible/tests/mochitest/pivot.js
@@ -514,17 +514,17 @@ function removeVCRootChecker(aPivot)
  * Create a pivot, remove its root, and perform an operation where the root is
  * needed.
  *
  * @param aRootNode [in] DOM node of which accessible will be the root of the
  *                       pivot. Should have more than one child.
  */
 function removeVCRootInvoker(aRootNode)
 {
-  this.pivot = gAccRetrieval.createAccessiblePivot(getAccessible(aRootNode));
+  this.pivot = gAccService.createAccessiblePivot(getAccessible(aRootNode));
   this.invoke = function removeVCRootInvoker_invoke()
   {
     this.pivot.position = this.pivot.root.firstChild;
     aRootNode.parentNode.removeChild(aRootNode);
   };
 
   this.getID = function removeVCRootInvoker_getID()
   {
--- a/accessible/tests/mochitest/states/z_frames_update.html
+++ b/accessible/tests/mochitest/states/z_frames_update.html
@@ -1,16 +1,16 @@
 <html>
 <head>
 <script>
 function replaceBody()
 {
-  var accRetrieval = Components.classes["@mozilla.org/accessibleRetrieval;1"].
-    getService(Components.interfaces.nsIAccessibleRetrieval);
-  accRetrieval.getAccessibleFor(document);
+  var accService = Components.classes["@mozilla.org/accessibilityService;1"].
+    getService(Components.interfaces.nsIAccessibilityService);
+  accService.getAccessibleFor(document);
 
   var newBody = document.createElement("body");
   newBody.setAttribute("contentEditable", "true");
   newBody.textContent = "New Hello";
   document.documentElement.replaceChild(newBody, document.body);
   getComputedStyle(newBody, "").color;
 }
 </script>
--- a/testing/marionette/accessibility.js
+++ b/testing/marionette/accessibility.js
@@ -11,18 +11,18 @@ Cu.import("resource://gre/modules/Log.js
 
 Cu.import("chrome://marionette/content/error.js");
 
 XPCOMUtils.defineLazyModuleGetter(
     this, "setInterval", "resource://gre/modules/Timer.jsm");
 XPCOMUtils.defineLazyModuleGetter(
     this, "clearInterval", "resource://gre/modules/Timer.jsm");
 
-XPCOMUtils.defineLazyGetter(this, "retrieval",
-    () => Cc["@mozilla.org/accessibleRetrieval;1"].getService(Ci.nsIAccessibleRetrieval));
+XPCOMUtils.defineLazyGetter(this, "service",
+    () => Cc["@mozilla.org/accessibilityService;1"].getService(Ci.nsIAccessibilityService));
 
 this.EXPORTED_SYMBOLS = ["accessibility"];
 
 const logger = Log.repository.getLogger("Marionette");
 
 /**
  * Number of attempts to get an accessible object for an element.
  * We attempt more than once because accessible tree can be out of sync
@@ -112,17 +112,17 @@ accessibility.Checks = class {
    *     Flag indicating that the element must have an accessible object.
    *     Defaults to not require this.
    *
    * @return {nsIAccessible}
    *     Accessibility object for the given element.
    */
   getAccessible(element, mustHaveAccessible = false) {
     return new Promise((resolve, reject) => {
-      let acc = retrieval.getAccessibleFor(element);
+      let acc = service.getAccessibleFor(element);
 
       // if accessible object is found, return it;
       // if it is not required, also resolve
       if (acc || !mustHaveAccessible) {
         resolve(acc);
 
       // if we must have an accessible but are strict,
       // reject now and avoid polling for an accessible object
@@ -130,17 +130,17 @@ accessibility.Checks = class {
         reject();
 
       // if we require an accessible object, we need to poll for it
       // because accessible tree might be
       // out of sync with DOM tree for a short time
       } else {
         let attempts = GET_ACCESSIBLE_ATTEMPTS;
         let intervalId = setInterval(() => {
-          let acc = retrieval.getAccessibleFor(element);
+          let acc = service.getAccessibleFor(element);
           if (acc || --attempts <= 0) {
             clearInterval(intervalId);
             if (acc) {
               resolve(acc);
             } else {
               reject();
             }
           }
@@ -158,17 +158,17 @@ accessibility.Checks = class {
    *     Accessible object.
    *
    * @return {boolean}
    *     True if an actionable role is found on the accessible, false
    *     otherwise.
    */
   isActionableRole(accessible) {
     return accessibility.ActionableRoles.has(
-        retrieval.getStringRole(accessible.role));
+        service.getStringRole(accessible.role));
   }
 
   /**
    * Test if an accessible has at least one action that it supports.
    *
    * @param {nsIAccessible} accessible
    *     Accessible object.
    *
--- a/testing/talos/talos/tests/a11y/a11y.js
+++ b/testing/talos/talos/tests/a11y/a11y.js
@@ -1,28 +1,28 @@
-gAccRetrieval = 0;
+gAccService = 0;
 
 // Make sure not to touch Components before potentially invoking enablePrivilege,
 // because otherwise it won't be there.
 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 nsIAccessible = Components.interfaces.nsIAccessible;
 nsIDOMNode = Components.interfaces.nsIDOMNode;
 
 function initAccessibility()
 {
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-  if (!gAccRetrieval) {
-    var retrieval = Components.classes["@mozilla.org/accessibleRetrieval;1"];
-    if (retrieval) { // fails if build lacks accessibility module
-      gAccRetrieval =
-      Components.classes["@mozilla.org/accessibleRetrieval;1"]
-                .getService(Components.interfaces.nsIAccessibleRetrieval);
+  if (!gAccService) {
+    var service = Components.classes["@mozilla.org/accessibilityService;1"];
+    if (service) { // fails if build lacks accessibility module
+      gAccService =
+      Components.classes["@mozilla.org/accessibilityService;1"]
+                .getService(Components.interfaces.nsIAccessibilityService);
     }
   }
-  return gAccRetrieval;
+  return gAccService;
 }
 
 function getAccessible(aAccOrElmOrID, aInterfaces)
 {
   if (!aAccOrElmOrID) {
     return null;
   }
 
@@ -36,17 +36,17 @@ function getAccessible(aAccOrElmOrID, aI
 
   } else {
     elm = document.getElementById(aAccOrElmOrID);
   }
 
   var acc = (aAccOrElmOrID instanceof nsIAccessible) ? aAccOrElmOrID : null;
   if (!acc) {
     try {
-      acc = gAccRetrieval.getAccessibleFor(elm);
+      acc = gAccService.getAccessibleFor(elm);
     } catch (e) {
     }
   }
 
   if (!aInterfaces) {
     return acc;
   }