B2G/gecko/accessible/tests/mochitest/events.js
/**
 * Deal with action sequence. Used when you need to execute couple of actions
 * each after other one.
 */
Deal with action sequence. Used when you need to execute couple of actions
each after other one.
Deal with action sequence . Used when you need to execute couple of actions each after other one .
function sequence()
{
  this.append = function sequence_append(aProcessor, aEventType, aTarget,
                                         aItemID)
  {
    var item = new sequenceItem(aProcessor, aEventType, aTarget, aItemID);
    this.items.push(item);
  }
  this.processNext = function sequence_processNext()
  {
    this.idx++;
    if (this.idx >= this.items.length) {
      ok(false, "End of sequence: nothing to process!");
      SimpleTest.finish();
      return;
    }
    this.items[this.idx].startProcess();
  }
  this.items = new Array();
  this.idx = -1;
}
function sequence ( ) { this . append = function sequence_append ( aProcessor , aEventType , aTarget , aItemID ) { var item = new sequenceItem ( aProcessor , aEventType , aTarget , aItemID ) ; this . items . push ( item ) ; } this . processNext = function sequence_processNext ( ) { this . idx ++ ; if ( this . idx >= this . items . length ) { ok ( false , "End of sequence: nothing to process!" ) ; SimpleTest . finish ( ) ; return ; } this . items [ this . idx ] . startProcess ( ) ; } this . items = new Array ( ) ; this . idx = - 1 ; }
Deal with action sequence.
Deal with action sequence .
/**
   * Append new sequence item.
   *
   * @param  aProcessor  [in] object implementing interface
   *                      {
   *                        // execute item action
   *                        process: function() {},
   *                        // callback, is called when item was processed
   *                        onProcessed: function() {}
   *                      };
   * @param  aEventType  [in] event type of expected event on item action
   * @param  aTarget     [in] event target of expected event on item action
   * @param  aItemID     [in] identifier of item
   */ /**
   * Process next sequence item.
   */