Bug 1280947 - Correct argument to event.sendEvent; r?automatedtester draft
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 25 Aug 2016 14:16:10 +0100
changeset 405527 ef00356abe0aebb8018d659af3360a53893e0e05
parent 405526 12b9f7ab391f72405d6fcd9e9d34af24448a1d6e
child 405528 e68045da69e96a53cbb6b21bfbec8a11881735b4
child 406084 5bff4f2b2a5de01ee6cdd320af2b6d0158c324ad
child 406085 4bc6eb82d6d93ca08f02d8a20f7173453035d164
push id27513
push userbmo:ato@mozilla.com
push dateThu, 25 Aug 2016 16:05:24 +0000
reviewersautomatedtester
bugs1280947
milestone51.0a1
Bug 1280947 - Correct argument to event.sendEvent; r?automatedtester Events were not registered when constructed with an object rather than a string literal. MozReview-Commit-ID: KhXcDPu70Vm
testing/marionette/event.js
--- a/testing/marionette/event.js
+++ b/testing/marionette/event.js
@@ -1301,34 +1301,34 @@ event.focus = function(el, opts = {}) {
   let win = doc.defaultView;
 
   let ev = new win.FocusEvent(el);
   ev.initEvent("focus", opts.canBubble, true);
   el.dispatchEvent(ev);
 };
 
 event.mouseover = function(el, modifiers = {}, opts = {}) {
-  return event.sendEvent({type: "mouseover"}, el, modifiers, opts);
+  return event.sendEvent("mouseover", el, modifiers, opts);
 };
 
 event.mousemove = function(el, modifiers = {}, opts = {}) {
-  return event.sendEvent({type: "mousemove"}, el, modifiers, opts);
+  return event.sendEvent("mousemove", el, modifiers, opts);
 };
 
 event.mousedown = function(el, modifiers = {}, opts = {}) {
-  return event.sendEvent({type: "mousedown"}, el, modifiers, opts);
+  return event.sendEvent("mousedown", el, modifiers, opts);
 };
 
 event.mouseup = function(el, modifiers = {}, opts = {}) {
-  return event.sendEvent({type: "mouseup"}, el, modifiers, opts);
+  return event.sendEvent("mouseup", el, modifiers, opts);
 };
 
 event.click = function(el, modifiers = {}, opts = {}) {
-  return event.sendEvent({type: "click"}, el, modifiers, opts);
+  return event.sendEvent("click", el, modifiers, opts);
 };
 
 event.change = function(el, modifiers = {}, opts = {}) {
-  return event.sendEvent({type: "change"}, el, modifiers, opts);
+  return event.sendEvent("change", el, modifiers, opts);
 };
 
 event.input = function(el, modifiers = {}, opts = {}) {
-  return event.sendEvent({type: "input"}, el, modifiers, opts);
+  return event.sendEvent("input", el, modifiers, opts);
 };