browser/base/content/test/newtab/browser_newtab_bug998387.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:1e27e497d25d
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
3
4 function runTests() {
5 yield setLinks("0");
6 yield addNewTabPageTab();
7
8 // Remember if the click handler was triggered
9 let {site} = getCell(0);
10 let origOnClick = site.onClick;
11 let clicked = false;
12 site.onClick = e => {
13 origOnClick.call(site, e);
14 clicked = true;
15 executeSoon(TestRunner.next);
16 };
17
18 // Send a middle-click and make sure it happened
19 let block = getContentDocument().querySelector(".newtab-control-block");
20 yield EventUtils.synthesizeMouseAtCenter(block, {button: 1}, getContentWindow());
21 ok(clicked, "middle click triggered click listener");
22
23 // Make sure the cell didn't actually get blocked
24 checkGrid("0");
25 }

mercurial