goog.testing.events
Functions
fireBlurEvent( target ) → boolean
boolean
Simulate a blur event on the given target.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
fireBrowserEvent( event ) → boolean
boolean
Simulates an event's capturing and bubbling phases.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
fireClickEvent( target, opt_button, opt_coords, opt_eventProperties ) → boolean
boolean
Simulates a click event on the given target. IE only supports click with the left mouse button.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
fireClickSequence( target, opt_button, opt_coords, opt_eventProperties ) → boolean
boolean
Simulates a mousedown, mouseup, and then click on the given event target, with the left mouse button.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
fireContextMenuEvent( target, opt_coords ) → boolean
boolean
Simulates a contextmenu event on the given target.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
fireContextMenuSequence( target, opt_coords ) → boolean
boolean
Simulates a mousedown, contextmenu, and the mouseup on the given event target, with the right mouse button.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
fireDoubleClickEvent( target, opt_coords, opt_eventProperties ) → boolean
boolean
Simulates a double-click event on the given target. Always double-clicks with the left mouse button since no browser supports double-clicking with any other buttons.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
fireDoubleClickSequence( target, opt_coords, opt_eventProperties ) → boolean
boolean
Simulates the sequence of events fired by the browser when the user double- clicks the given target.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
fireFocusEvent( target ) → boolean
boolean
Simulate a focus event on the given target.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
fireFocusInEvent( target ) → boolean
boolean
Simulate a focus-in event on the given target.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
fireKeySequence( target, keyOrKeyCode, opt_eventProperties ) → boolean
boolean
Simulates a complete keystroke (keydown, keypress, and keyup). Note that if preventDefault is called on the keydown, the keypress will not fire.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
fireMouseDownEvent( target, opt_button, opt_coords, opt_eventProperties ) → boolean
boolean
Simulates a mousedown event on the given target.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
fireMouseEnterEvent( target, relatedTarget, opt_coords ) → boolean
boolean
Simulates a mouseenter event on the given target.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
fireMouseLeaveEvent( target, relatedTarget, opt_coords ) → boolean
boolean
Simulates a mouseleave event on the given target.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
fireMouseMoveEvent( target, opt_coords ) → boolean
boolean
Simulates a mousemove event on the given target.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
fireMouseOutEvent( target, relatedTarget, opt_coords ) → boolean
boolean
Simulates a mouseout event on the given target.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
fireMouseOverEvent( target, relatedTarget, opt_coords ) → boolean
boolean
Simulates a mouseover event on the given target.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
fireMouseUpEvent( target, opt_button, opt_coords, opt_eventProperties ) → boolean
boolean
Simulates a mouseup event on the given target.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
fireNonAsciiKeySequence( target, keyOrKeyCode, keyPressKeyOrKeyCode, opt_eventProperties ) → boolean
boolean
Simulates a complete keystroke (keydown, keypress, and keyup) when typing a non-ASCII character. Same as fireKeySequence, the keypress will not fire if preventDefault is called on the keydown.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
firePopStateEvent( target, state ) → boolean
boolean
fireTouchEndEvent( target, opt_coords, opt_eventProperties ) → boolean
boolean
Simulates a touchend event on the given target.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
fireTouchMoveEvent( target, opt_coords, opt_eventProperties ) → boolean
boolean
Simulates a touchmove event on the given target.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
fireTouchSequence( target, opt_coords, opt_eventProperties ) → boolean
boolean
Simulates a simple touch sequence on the given target.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
fireTouchStartEvent( target, opt_coords, opt_eventProperties ) → boolean
boolean
Simulates a touchstart event on the given target.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
mixinListenable( obj ) → void
void
Mixins a listenable into the given object. This turns the object into a goog.events.Listenable. This is useful, for example, when you need to mock a implementation of listenable and still want it to work with goog.events.
Parameters |
|
---|