B2G/gecko/accessible/tests/mochitest/text.js
/**
 * Test getTextBeforeOffset for BOUNDARY_CHAR over different elements.
 *
 * @param aIDs          [in] the accessible identifier or array of accessible
 *                        identifiers
 * @param aOffset       [in] the offset to get a character before it
 * @param aChar         [in] the expected character
 * @param aStartOffset  [in] expected start offset of the character
 * @param aEndOffset    [in] expected end offset of the character
 */
Test getTextBeforeOffset for BOUNDARY_CHAR over different elements.
Test getTextBeforeOffset for BOUNDARY_CHAR over different elements .
function testCharBeforeOffset(aIDs, aOffset, aChar, aStartOffset, aEndOffset)
{
  var IDs = (aIDs instanceof Array) ? aIDs : [ aIDs ];
  for (var i = 0; i < IDs.length; i++) {
    var acc = getAccessible(IDs[i], nsIAccessibleText);
    testTextHelper(IDs[i], aOffset, BOUNDARY_CHAR,
                   aChar, aStartOffset, aEndOffset,
                   kOk, kOk, kOk,
                   acc.getTextBeforeOffset, "getTextBeforeOffset ");
  }
}
function testCharBeforeOffset ( aIDs , aOffset , aChar , aStartOffset , aEndOffset ) { var IDs = ( aIDs instanceof Array ) ? aIDs : [ aIDs ] ; for ( var i = 0 ; i < IDs . length ; i ++ ) { var acc = getAccessible ( IDs [ i ] , nsIAccessibleText ) ; testTextHelper ( IDs [ i ] , aOffset , BOUNDARY_CHAR , aChar , aStartOffset , aEndOffset , kOk , kOk , kOk , acc . getTextBeforeOffset , "getTextBeforeOffset " ) ; } }
Test getTextBeforeOffset for BOUNDARY_CHAR over different elements.
Test getTextBeforeOffset for BOUNDARY_CHAR over different elements .