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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 function runTests() {
     5   yield setLinks("0");
     6   yield addNewTabPageTab();
     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   };
    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");
    23   // Make sure the cell didn't actually get blocked
    24   checkGrid("0");
    25 }

mercurial