mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1173775 - Tests for bug 1173775. r=vporof
This commit is contained in:
parent
deaa9d66e2
commit
eca2d5dd6d
@ -22,12 +22,28 @@ function* spawnTest() {
|
||||
let B = A.getChild();
|
||||
let D = B.getChild();
|
||||
|
||||
let receivedLinkEvent = treeRoot.once("link");
|
||||
let linkEvent = null;
|
||||
let handler = (_, e) => linkEvent = e;
|
||||
|
||||
treeRoot.on("link", handler);
|
||||
|
||||
// Fire the right click
|
||||
EventUtils.synthesizeMouseAtCenter(D.target.querySelector(".call-tree-url"), { button: 2, type: "mousedown" }, window);
|
||||
|
||||
// Wait 200ms
|
||||
yield idleWait(50);
|
||||
|
||||
// Ensure link was not called for right click
|
||||
ok(!linkEvent, "`link` event not fired for right click")
|
||||
|
||||
// Fire left click
|
||||
EventUtils.sendMouseEvent({ type: "mousedown" }, D.target.querySelector(".call-tree-url"));
|
||||
|
||||
let eventItem = yield receivedLinkEvent;
|
||||
is(eventItem, D, "The 'link' event target is correct.");
|
||||
// Wait until linkEvent is true, should occur quickly, if not synchronously
|
||||
yield waitUntil(() => linkEvent);
|
||||
is(linkEvent, D, "The 'link' event target is correct.");
|
||||
|
||||
treeRoot.off("link", handler);
|
||||
finish();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user