B2G/gecko/testing/peptest/peptest/extension/resource/mozmill/stdlib/EventUtils.js
/**
 * Check if the event was fired or not. The event handler aEventHandler
 * will be removed.
 */
Check if the event was fired or not. The event handler aEventHandler
will be removed.
Check if the event was fired or not . The event handler aEventHandler will be removed .
function _checkExpectedEvent(aExpectedTarget, aExpectedEvent, aEventHandler, aTestName)
{
  if (aEventHandler) {
    var expectEvent = (aExpectedEvent.charAt(0) != "!");
    var type = expectEvent ? aExpectedEvent : aExpectedEvent.substring(1);
    aExpectedTarget.removeEventListener(type, aEventHandler, false);
    var desc = type + " event";
    if (expectEvent)
      desc += " not";
    if (_gSeenEvent != expectEvent)
      throw new Error(aTestName + ": " + desc + " fired.");
  }
  _gSeenEvent = false;
}
function _checkExpectedEvent ( aExpectedTarget , aExpectedEvent , aEventHandler , aTestName ) { if ( aEventHandler ) { var expectEvent = ( aExpectedEvent . charAt ( 0 ) != "!" ) ; var type = expectEvent ? aExpectedEvent : aExpectedEvent . substring ( 1 ) ; aExpectedTarget . removeEventListener ( type , aEventHandler , false ) ; var desc = type + " event" ; if ( expectEvent ) desc += " not" ; if ( _gSeenEvent != expectEvent ) throw new Error ( aTestName + ": " + desc + " fired." ) ; } _gSeenEvent = false ; }
Check if the event was fired or not.
Check if the event was fired or not .