goog.testing.events
Namespacegoog.testing.events.Event
Classgoog.events.BrowserEvent expects an Event so we provide one for JSCompiler. This clones a lot of the functionality of goog.events.Event. This used to use a mixin, but the mixin results in confusing the two types when compiled. … more
goog.testing.events.EventMatcher
ClassA matcher that verifies that an argument is a {@code goog.events.Event} of a particular type. … more
goog.testing.events.EventObserver
ClassEvent observer. Implements a handleEvent interface so it may be used as a listener in listening functions and methods. … more
goog.testing.events.OnlineHandler
ClassMock implementation of goog.events.OnlineHandler. … more
.fireBrowserEvent(event)
Simulates an event's capturing and bubbling phases.
event
{Event
}
boolean
}
.fireClickEvent(target, opt_button, opt_coords, opt_eventProperties)
Simulates a click event on the given target. IE only supports click with the left mouse button.
target
{EventTarget
}
opt_button
{goog.events.BrowserEvent.MouseButton
=}
opt_coords
{goog.math.Coordinate
=}
opt_eventProperties
{Object
=}
boolean
}
.fireClickSequence(target, opt_button, opt_coords, opt_eventProperties)
Simulates a mousedown, mouseup, and then click on the given event target, with the left mouse button.
target
{EventTarget
}
opt_button
{goog.events.BrowserEvent.MouseButton
=}
opt_coords
{goog.math.Coordinate
=}
opt_eventProperties
{Object
=}
boolean
}
.fireContextMenuEvent(target, opt_coords)
Simulates a contextmenu event on the given target.
target
{EventTarget
}
opt_coords
{goog.math.Coordinate
=}
boolean
}
.fireContextMenuSequence(target, opt_coords)
Simulates a mousedown, contextmenu, and the mouseup on the given event target, with the right mouse button.
target
{EventTarget
}
opt_coords
{goog.math.Coordinate
=}
boolean
}
.fireDoubleClickEvent(target, opt_coords, opt_eventProperties)
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.
target
{EventTarget
}
opt_coords
{goog.math.Coordinate
=}
opt_eventProperties
{Object
=}
boolean
}
.fireDoubleClickSequence(target, opt_coords, opt_eventProperties)
Simulates the sequence of events fired by the browser when the user double- clicks the given target.
target
{EventTarget
}
opt_coords
{goog.math.Coordinate
=}
opt_eventProperties
{Object
=}
boolean
}
.fireFocusEvent(target)
Simulate a focus event on the given target.
target
{EventTarget
}
boolean
}
.fireKeySequence(target, keyCode, opt_eventProperties)
Simulates a complete keystroke (keydown, keypress, and keyup). Note that if preventDefault is called on the keydown, the keypress will not fire.
target
{EventTarget
}
keyCode
{number
}
opt_eventProperties
{Object
=}
boolean
}
.fireMouseDownEvent(target, opt_button, opt_coords, opt_eventProperties)
Simulates a mousedown event on the given target.
target
{EventTarget
}
opt_button
{goog.events.BrowserEvent.MouseButton
=}
opt_coords
{goog.math.Coordinate
=}
opt_eventProperties
{Object
=}
boolean
}
.fireMouseMoveEvent(target, opt_coords)
Simulates a mousemove event on the given target.
target
{EventTarget
}
opt_coords
{goog.math.Coordinate
=}
boolean
}
.fireMouseOutEvent(target, relatedTarget, opt_coords)
Simulates a mouseout event on the given target.
target
{EventTarget
}
relatedTarget
{EventTarget
}
opt_coords
{goog.math.Coordinate
=}
boolean
}
.fireMouseOverEvent(target, relatedTarget, opt_coords)
Simulates a mouseover event on the given target.
target
{EventTarget
}
relatedTarget
{EventTarget
}
opt_coords
{goog.math.Coordinate
=}
boolean
}
.fireMouseUpEvent(target, opt_button, opt_coords, opt_eventProperties)
Simulates a mouseup event on the given target.
target
{EventTarget
}
opt_button
{goog.events.BrowserEvent.MouseButton
=}
opt_coords
{goog.math.Coordinate
=}
opt_eventProperties
{Object
=}
boolean
}
.fireNonAsciiKeySequence(target, keyCode, keyPressKeyCode, opt_eventProperties)
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.
target
{EventTarget
}
keyCode
{number
}
keyPressKeyCode
{number
}
opt_eventProperties
{Object
=}
boolean
}
.firePopStateEvent(target, state)
Simulates a popstate event on the given target.
target
{EventTarget
}
state
{Object
}
boolean
}