B2G/gecko/accessible/tests/mochitest/pivot.js
/**
 * Move the pivot to the position under the point.
 *
 * @param aDocAcc        [in] document that manages the virtual cursor
 * @param aX             [in] screen x coordinate
 * @param aY             [in] screen y coordinate
 * @param aIgnoreNoMatch [in] don't unset position if no object was found at
 *                       point.
 * @param aRule          [in] traversal rule object
 * @param aIdOrNameOrAcc [in] id, accessible or accessible name to expect
 *                       virtual cursor to land on after performing move method.
 *                       false if no move is expected.
 */
Move the pivot to the position under the point.
@param aDocAcc        [in] document that manages the virtual cursor
@param aX             [in] screen x coordinate
@param aY             [in] screen y coordinate
@param aIgnoreNoMatch [in] don't unset position if no object was found at
point.
@param aRule          [in] traversal rule object
@param aIdOrNameOrAcc [in] id, accessible or accessible name to expect
virtual cursor to land on after performing move method.
false if no move is expected.
Move the pivot to the position under the point . @param aDocAcc [ in ] document that manages the virtual cursor @param aX [ in ] screen x coordinate @param aY [ in ] screen y coordinate @param aIgnoreNoMatch [ in ] don ' t unset position if no object was found at point . @param aRule [ in ] traversal rule object @param aIdOrNameOrAcc [ in ] id accessible or accessible name to expect virtual cursor to land on after performing move method . false if no move is expected .
function moveVCCoordInvoker(aDocAcc, aX, aY, aIgnoreNoMatch,
                            aRule, aIdOrNameOrAcc)
{
  var expectMove = (aIdOrNameOrAcc != false);
  this.invoke = function virtualCursorChangedInvoker_invoke()
  {
    VCChangedChecker.
      storePreviousPosAndOffset(aDocAcc.virtualCursor);
    var moved = aDocAcc.virtualCursor.moveToPoint(aRule, aX, aY,
                                                  aIgnoreNoMatch);
    SimpleTest.ok((expectMove && moved) || (!expectMove && !moved),
                  "moved pivot");
  };
  this.getID = function setVCPosInvoker_getID()
  {
    return "Do " + (expectMove ? "" : "no-op ") + "moveToPoint " + aIdOrNameOrAcc;
  };
  if (expectMove) {
    this.eventSeq = [
      new VCChangedChecker(aDocAcc, aIdOrNameOrAcc, null, 'moveToPoint')
    ];
  } else {
    this.eventSeq = [];
    this.unexpectedEventSeq = [
      new invokerChecker(EVENT_VIRTUALCURSOR_CHANGED, aDocAcc)
    ];
  }
}
function moveVCCoordInvoker ( aDocAcc , aX , aY , aIgnoreNoMatch , aRule , aIdOrNameOrAcc ) { var expectMove = ( aIdOrNameOrAcc != false ) ; this . invoke = function virtualCursorChangedInvoker_invoke ( ) { VCChangedChecker . storePreviousPosAndOffset ( aDocAcc . virtualCursor ) ; var moved = aDocAcc . virtualCursor . moveToPoint ( aRule , aX , aY , aIgnoreNoMatch ) ; SimpleTest . ok ( ( expectMove && moved ) || ( ! expectMove && ! moved ) , "moved pivot" ) ; } ; this . getID = function setVCPosInvoker_getID ( ) { return "Do " + ( expectMove ? "" : "no-op " ) + "moveToPoint " + aIdOrNameOrAcc ; } ; if ( expectMove ) { this . eventSeq = [ new VCChangedChecker ( aDocAcc , aIdOrNameOrAcc , null , 'moveToPoint' ) ] ; } else { this . eventSeq = [ ] ; this . unexpectedEventSeq = [ new invokerChecker ( EVENT_VIRTUALCURSOR_CHANGED , aDocAcc ) ] ; } }
Move the pivot to the position under the point.
Move the pivot to the position under the point .