Bug 1507067 - [marionette] Add logging of received DOM events to ContentEventObserverService. r=ato a=test-only
authorHenrik Skupin <mail@hskupin.info>
Thu, 10 Jan 2019 14:26:02 +0000
changeset 506627 888054b8eec1afea3ca6fce6dbb6a0377c11c260
parent 506626 5c04d6fccc266d49b8cd394f7c3961a68306245b
child 506628 482eb149ad4a01dd0d192c9136d3dcd3197f4446
push id10489
push userapavel@mozilla.com
push dateFri, 11 Jan 2019 11:14:05 +0000
treeherdermozilla-beta@189f49635cfd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato, test-only
bugs1507067
milestone65.0
Bug 1507067 - [marionette] Add logging of received DOM events to ContentEventObserverService. r=ato a=test-only Differential Revision: https://phabricator.services.mozilla.com/D16095
testing/marionette/dom.js
--- a/testing/marionette/dom.js
+++ b/testing/marionette/dom.js
@@ -1,14 +1,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
+ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+
+const {Log} = ChromeUtils.import("chrome://marionette/content/log.js", {});
+
+XPCOMUtils.defineLazyGetter(this, "logger", Log.get);
+
 this.EXPORTED_SYMBOLS = [
   "ContentEventObserverService",
   "WebElementEventTarget",
 ];
 
 /**
  * The ``EventTarget`` for web elements can be used to observe DOM
  * events in the content document.
@@ -188,12 +194,13 @@ class ContentEventObserverService {
 
   * [Symbol.iterator]() {
     for (let ev of this.events) {
       yield ev;
     }
   }
 
   handleEvent({type, target}) {
+    logger.trace(`Received DOM event ${type}`);
     this.sendAsyncMessage("Marionette:DOM:OnEvent", {type}, {target});
   }
 }
 this.ContentEventObserverService = ContentEventObserverService;