mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
25b9721a5e
Update test to check middle click not blocking by potentially triggering the block() codepath in onClick.
26 lines
770 B
JavaScript
26 lines
770 B
JavaScript
/* Any copyright is dedicated to the Public Domain.
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
function runTests() {
|
|
yield setLinks("0");
|
|
yield addNewTabPageTab();
|
|
|
|
// Remember if the click handler was triggered
|
|
let {site} = getCell(0);
|
|
let origOnClick = site.onClick;
|
|
let clicked = false;
|
|
site.onClick = e => {
|
|
origOnClick.call(site, e);
|
|
clicked = true;
|
|
executeSoon(TestRunner.next);
|
|
};
|
|
|
|
// Send a middle-click and make sure it happened
|
|
let block = getContentDocument().querySelector(".newtab-control-block");
|
|
yield EventUtils.synthesizeMouseAtCenter(block, {button: 1}, getContentWindow());
|
|
ok(clicked, "middle click triggered click listener");
|
|
|
|
// Make sure the cell didn't actually get blocked
|
|
checkGrid("0");
|
|
}
|