B2G/gecko/accessible/tests/mochitest/common.js
/**
 * Test accessible tree for defunct accessible.
 *
 * @param  aAcc       [in] the defunct accessible
 * @param  aNodeOrId  [in] the DOM node identifier for the defunct accessible
 */
Test accessible tree for defunct accessible.
@param  aAcc       [in] the defunct accessible
@param  aNodeOrId  [in] the DOM node identifier for the defunct accessible
Test accessible tree for defunct accessible . @param aAcc [ in ] the defunct accessible @param aNodeOrId [ in ] the DOM node identifier for the defunct accessible
function testDefunctAccessible(aAcc, aNodeOrId)
{
  if (aNodeOrId)
    ok(!isAccessible(aNodeOrId),
       "Accessible for " + aNodeOrId + " wasn't properly shut down!");
  var msg = " doesn't fail for shut down accessible " + prettyName(aNodeOrId) + "!";
  var success = false;
  try {
    aAcc.firstChild;
  } catch (e) {
    success = (e.result == Components.results.NS_ERROR_FAILURE)
  }
  ok(success, "firstChild" + msg);
  success = false;
  try {
    aAcc.lastChild;
  } catch (e) {
    success = (e.result == Components.results.NS_ERROR_FAILURE)
  }
  ok(success, "lastChild" + msg);
  success = false;
  try {
    aAcc.childCount;
  } catch (e) {
    success = (e.result == Components.results.NS_ERROR_FAILURE)
  }
  ok(success, "childCount" + msg);
  success = false;
  try {
    aAcc.children;
  } catch (e) {
    success = (e.result == Components.results.NS_ERROR_FAILURE)
  }
  ok(success, "children" + msg);
  success = false;
  try {
    aAcc.nextSibling;
  } catch (e) {
    success = (e.result == Components.results.NS_ERROR_FAILURE);
  }
  ok(success, "nextSibling" + msg);
  success = false;
  try {
    aAcc.previousSibling;
  } catch (e) {
    success = (e.result == Components.results.NS_ERROR_FAILURE);
  }
  ok(success, "previousSibling" + msg);
  success = false;
  try {
    aAcc.parent;
  } catch (e) {
    success = (e.result == Components.results.NS_ERROR_FAILURE);
  }
  ok(success, "parent" + msg);
}
function testDefunctAccessible ( aAcc , aNodeOrId ) { if ( aNodeOrId ) ok ( ! isAccessible ( aNodeOrId ) , "Accessible for " + aNodeOrId + " wasn't properly shut down!" ) ; var msg = " doesn't fail for shut down accessible " + prettyName ( aNodeOrId ) + "!" ; var success = false ; try { aAcc . firstChild ; } catch ( e ) { success = ( e . result == Components . results . NS_ERROR_FAILURE ) } ok ( success , "firstChild" + msg ) ; success = false ; try { aAcc . lastChild ; } catch ( e ) { success = ( e . result == Components . results . NS_ERROR_FAILURE ) } ok ( success , "lastChild" + msg ) ; success = false ; try { aAcc . childCount ; } catch ( e ) { success = ( e . result == Components . results . NS_ERROR_FAILURE ) } ok ( success , "childCount" + msg ) ; success = false ; try { aAcc . children ; } catch ( e ) { success = ( e . result == Components . results . NS_ERROR_FAILURE ) } ok ( success , "children" + msg ) ; success = false ; try { aAcc . nextSibling ; } catch ( e ) { success = ( e . result == Components . results . NS_ERROR_FAILURE ) ; } ok ( success , "nextSibling" + msg ) ; success = false ; try { aAcc . previousSibling ; } catch ( e ) { success = ( e . result == Components . results . NS_ERROR_FAILURE ) ; } ok ( success , "previousSibling" + msg ) ; success = false ; try { aAcc . parent ; } catch ( e ) { success = ( e . result == Components . results . NS_ERROR_FAILURE ) ; } ok ( success , "parent" + msg ) ; }
Test accessible tree for defunct accessible.
Test accessible tree for defunct accessible .
// firstChild // lastChild // childCount // children // nextSibling // previousSibling // parent