B2G/gecko/accessible/tests/mochitest/pivot.js
/**
 * Add invokers to a queue to test a rule and an expected sequence of element ids
 * or accessible names for that rule in the given document.
 *
 * @param aQueue    [in] event queue in which to push invoker sequence.
 * @param aDocAcc   [in] the managing document of the virtual cursor we are testing
 * @param aRule     [in] the traversal rule to use in the invokers
 * @param aSequence [in] a sequence of accessible names or elemnt ids to expect with
 *                  the given rule in the given document
 */
Add invokers to a queue to test a rule and an expected sequence of element ids
or accessible names for that rule in the given document.

@param aQueue    [in] event queue in which to push invoker sequence.
@param aDocAcc   [in] the managing document of the virtual cursor we are testing
@param aRule     [in] the traversal rule to use in the invokers
@param aSequence [in] a sequence of accessible names or elemnt ids to expect with
the given rule in the given document
Add invokers to a queue to test a rule and an expected sequence of element ids or accessible names for that rule in the given document . @param aQueue [ in ] event queue in which to push invoker sequence . @param aDocAcc [ in ] the managing document of the virtual cursor we are testing @param aRule [ in ] the traversal rule to use in the invokers @param aSequence [ in ] a sequence of accessible names or elemnt ids to expect with the given rule in the given document
function queueTraversalSequence(aQueue, aDocAcc, aRule, aSequence)
{
  aDocAcc.virtualCursor.position = null;
  for (var i = 0; i < aSequence.length; i++) {
    var invoker =
      new setVCPosInvoker(aDocAcc, "moveNext", aRule, aSequence[i]);
    aQueue.push(invoker);
  }
  aQueue.push(new setVCPosInvoker(aDocAcc, "moveNext", aRule, false));
  for (var i = aSequence.length-2; i >= 0; i--) {
    var invoker =
      new setVCPosInvoker(aDocAcc, "movePrevious", aRule, aSequence[i]);
    aQueue.push(invoker);
  }
  aQueue.push(new setVCPosInvoker(aDocAcc, "movePrevious", aRule, false));
  aQueue.push(new setVCPosInvoker(aDocAcc, "moveLast", aRule,
                                  aSequence[aSequence.length - 1]));
  aQueue.push(new setVCPosInvoker(aDocAcc, "moveNext", aRule, false));
  aQueue.push(new setVCPosInvoker(aDocAcc, "moveFirst", aRule, aSequence[0]));
  aQueue.push(new setVCPosInvoker(aDocAcc, "movePrevious", aRule, false));
}
function queueTraversalSequence ( aQueue , aDocAcc , aRule , aSequence ) { aDocAcc . virtualCursor . position = null ; for ( var i = 0 ; i < aSequence . length ; i ++ ) { var invoker = new setVCPosInvoker ( aDocAcc , "moveNext" , aRule , aSequence [ i ] ) ; aQueue . push ( invoker ) ; } aQueue . push ( new setVCPosInvoker ( aDocAcc , "moveNext" , aRule , false ) ) ; for ( var i = aSequence . length - 2 ; i >= 0 ; i -- ) { var invoker = new setVCPosInvoker ( aDocAcc , "movePrevious" , aRule , aSequence [ i ] ) ; aQueue . push ( invoker ) ; } aQueue . push ( new setVCPosInvoker ( aDocAcc , "movePrevious" , aRule , false ) ) ; aQueue . push ( new setVCPosInvoker ( aDocAcc , "moveLast" , aRule , aSequence [ aSequence . length - 1 ] ) ) ; aQueue . push ( new setVCPosInvoker ( aDocAcc , "moveNext" , aRule , false ) ) ; aQueue . push ( new setVCPosInvoker ( aDocAcc , "moveFirst" , aRule , aSequence [ 0 ] ) ) ; aQueue . push ( new setVCPosInvoker ( aDocAcc , "movePrevious" , aRule , false ) ) ; }
Add invokers to a queue to test a rule and an expected sequence of element ids
 or accessible names for that rule in the given document.
Add invokers to a queue to test a rule and an expected sequence of element ids or accessible names for that rule in the given document .
// No further more matches for given rule, expect no virtual cursor changes. // No previous more matches for given rule, expect no virtual cursor changes. // No further more matches for given rule, expect no virtual cursor changes. // No previous more matches for given rule, expect no virtual cursor changes.