Bug 1184316 - Remove Test:SynthesizeMouse content handler from DevTools. r=bgrins

--HG--
extra : rebase_source : 44eaf957c2899888cdb02d2117f40acc80406e18
This commit is contained in:
Jan Odvarko 2015-08-20 12:16:28 +02:00
Родитель 5ea52a4f9e
Коммит 12416f5935
3 изменённых файлов: 12 добавлений и 50 удалений

Просмотреть файл

@ -45,11 +45,10 @@ function assertNodeSelected(inspector, tagName) {
}
function* selectWithBrowserMenu(inspector) {
yield executeInContent("Test:SynthesizeMouse", {
center: true,
selector: "div",
options: {type: "contextmenu", button: 2}
});
yield BrowserTestUtils.synthesizeMouseAtCenter("div", {
type: "contextmenu",
button: 2
}, gBrowser.selectedBrowser);
// nsContextMenu also requires the popupNode to be set, but we can't set it to
// node under e10s as it's a CPOW, not a DOM node. But under e10s,
@ -71,11 +70,9 @@ function* selectWithBrowserMenu(inspector) {
function* selectWithElementPicker(inspector) {
yield inspector.toolbox.highlighterUtils.startPicker();
yield executeInContent("Test:SynthesizeMouse", {
center: true,
selector: "div",
options: {type: "mousemove"}
});
yield BrowserTestUtils.synthesizeMouseAtCenter("div", {
type: "mousemove",
}, gBrowser.selectedBrowser);
executeInContent("Test:SynthesizeKey", {
key: "VK_RETURN",
options: {}

Просмотреть файл

@ -52,11 +52,11 @@ add_task(function*() {
});
function* chooseWithInspectElementContextMenu(selector) {
yield executeInContent("Test:SynthesizeMouse", {
center: true,
selector: selector,
options: {type: "contextmenu", button: 2}
});
yield BrowserTestUtils.synthesizeMouseAtCenter(selector, {
type: "contextmenu",
button: 2
}, gBrowser.selectedBrowser);
executeInContent("Test:SynthesizeKey", {key: "Q", options: {}});
}

Просмотреть файл

@ -204,41 +204,6 @@ addMessageListener("devtools:test:setAttribute", function(msg) {
sendAsyncMessage("devtools:test:setAttribute");
});
/**
* Synthesize a mouse event on 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:
* - {Number} x
* - {Number} y
* - {Boolean} center If set to true, x/y will be ignored and
* synthesizeMouseAtCenter will be used instead
* - {Object} options Other event options
* - {String} selector An optional selector that will be used to find the node to
* synthesize the event on, if msg.objects doesn't contain the CPOW.
* The msg.objects part should be the element.
* @param {Object} data Event detail properties:
*/
addMessageListener("Test:SynthesizeMouse", function(msg) {
let {x, y, center, options, selector} = msg.data;
let {node} = msg.objects;
if (!node && selector) {
node = superQuerySelector(selector);
}
if (center) {
EventUtils.synthesizeMouseAtCenter(node, options, node.ownerDocument.defaultView);
} else {
EventUtils.synthesizeMouse(node, x, y, options, node.ownerDocument.defaultView);
}
// Most consumers won't need to listen to this message, unless they want to
// wait for the mouse event to be synthesized and don't have another event
// to listen to instead.
sendAsyncMessage("Test:SynthesizeMouse");
});
/**
* 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