--- a/testing/marionette/event.js
+++ b/testing/marionette/event.js
@@ -227,40 +227,51 @@ event.synthesizeMouse = function (
*
* If the type of the event is specified, a mouse event of that type is
* fired. Otherwise, a mousedown followed by a mouse up is performed.
*
* @param {number} left
* CSS pixels from the left document margin.
* @param {number} top
* CSS pixels from the top document margin.
- * @param {Object.<string, ?>} event
+ * @param {Object.<string, ?>} opts
* Object which may contain the properties "shiftKey", "ctrlKey",
* "altKey", "metaKey", "accessKey", "clickCount", "button", and
* "type".
* @param {Window=} window
* Window object. Defaults to the current window.
*/
event.synthesizeMouseAtPoint = function (
left, top, opts, window = undefined) {
let domutils = getDOMWindowUtils(window);
let button = opts.button || 0;
let clickCount = opts.clickCount || 1;
let modifiers = event.parseModifiers_(opts);
+ let pressure = ("pressure" in opts) ? opts.pressure : 0;
+ let inputSource = ("inputSource" in opts) ? opts.inputSource :
+ Ci.nsIDOMMouseEvent.MOZ_SOURCE_MOUSE;
+ let isDOMEventSynthesized =
+ ("isSynthesized" in opts) ? opts.isSynthesized : true;
+ let isWidgetEventSynthesized =
+ ("isWidgetEventSynthesized" in opts) ? opts.isWidgetEventSynthesized : false;
+ let buttons = ("buttons" in opts) ? opts.buttons : domutils.MOUSE_BUTTONS_NOT_SPECIFIED;
- if (("type" in event) && opts.type) {
+ if (("type" in opts) && opts.type) {
domutils.sendMouseEvent(
- opts.type, left, top, button, clickCount, modifiers);
+ opts.type, left, top, button, clickCount, modifiers, false, pressure, inputSource,
+ isDOMEventSynthesized, isWidgetEventSynthesized, buttons);
} else {
domutils.sendMouseEvent(
- "mousedown", left, top, button, clickCount, modifiers);
+ "mousedown", left, top, button, clickCount, modifiers, false, pressure, inputSource,
+ isDOMEventSynthesized, isWidgetEventSynthesized, buttons);
domutils.sendMouseEvent(
- "mouseup", left, top, button, clickCount, modifiers);
+ "mouseup", left, top, button, clickCount, modifiers, false, pressure, inputSource,
+ isDOMEventSynthesized, isWidgetEventSynthesized, buttons);
}
};
/**
* Call event.synthesizeMouse with coordinates at the centre of the
* target.
*/
event.synthesizeMouseAtCenter = function (element, event, window) {