michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: function runTests() { michael@0: yield setLinks("0"); michael@0: yield addNewTabPageTab(); michael@0: michael@0: // Remember if the click handler was triggered michael@0: let {site} = getCell(0); michael@0: let origOnClick = site.onClick; michael@0: let clicked = false; michael@0: site.onClick = e => { michael@0: origOnClick.call(site, e); michael@0: clicked = true; michael@0: executeSoon(TestRunner.next); michael@0: }; michael@0: michael@0: // Send a middle-click and make sure it happened michael@0: let block = getContentDocument().querySelector(".newtab-control-block"); michael@0: yield EventUtils.synthesizeMouseAtCenter(block, {button: 1}, getContentWindow()); michael@0: ok(clicked, "middle click triggered click listener"); michael@0: michael@0: // Make sure the cell didn't actually get blocked michael@0: checkGrid("0"); michael@0: }