Bug 1245153 - Use EventUtils.js from mochikit; r=pbrosset

testing/marionette/EventUtils.js has been converted to a JS module in
testing/marionette/event.js and its API has changed.  It was originally
a copy of testing/mochitest/tests/SimpleTest/EventUtils.js, and it should
be fine to use the original instead.

MozReview-Commit-ID: Exi9d5rEeOz
This commit is contained in:
Andreas Tolfsen
2016-02-05 14:14:15 +00:00
parent a2da0aaca1
commit 6ecd79e592
3 changed files with 23 additions and 23 deletions

View File

@@ -3,14 +3,11 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
const {require, loader} = Cu.import("resource://devtools/shared/Loader.jsm", {});
const promise = require("promise");
loader.lazyImporter(this, "Task", "resource://gre/modules/Task.jsm", "Task");
const subScriptLoader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader);
var EventUtils = {};
subScriptLoader.loadSubScript("chrome://marionette/content/EventUtils.js", EventUtils);
loader.lazyGetter(this, "nsIProfilerModule", () => {
return Cc["@mozilla.org/tools/profiler;1"].getService(Ci.nsIProfiler);
});
@@ -180,20 +177,6 @@ addMessageListener("devtools:test:setAttribute", function(msg) {
sendAsyncMessage("devtools:test:setAttribute");
});
/**
* Synthesize a key event for an element. This handler doesn't send a message
* back. Consumers should listen to specific events on the inspector/highlighter
* to know when the event got synthesized.
* @param {Object} msg The msg.data part expects the following properties:
* - {String} key
* - {Object} options
*/
addMessageListener("Test:SynthesizeKey", function(msg) {
let {key, options} = msg.data;
EventUtils.synthesizeKey(key, options, content);
});
/**
* Like document.querySelector but can go into iframes too.
* ".container iframe || .sub-container div" will first try to find the node