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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/base/content/test/newtab/browser_newtab_bug734043.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,27 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +function runTests() {
     1.8 +  yield setLinks("0,1,2,3,4,5,6,7,8");
     1.9 +  setPinnedLinks("");
    1.10 +
    1.11 +  yield addNewTabPageTab();
    1.12 +  checkGrid("0,1,2,3,4,5,6,7,8");
    1.13 +
    1.14 +  let receivedError = false;
    1.15 +  let block = getContentDocument().querySelector(".newtab-control-block");
    1.16 +
    1.17 +  function onError() {
    1.18 +    receivedError = true;
    1.19 +  }
    1.20 +
    1.21 +  let cw = getContentWindow();
    1.22 +  cw.addEventListener("error", onError);
    1.23 +
    1.24 +  for (let i = 0; i < 3; i++)
    1.25 +    EventUtils.synthesizeMouseAtCenter(block, {}, cw);
    1.26 +
    1.27 +  yield whenPagesUpdated();
    1.28 +  ok(!receivedError, "we got here without any errors");
    1.29 +  cw.removeEventListener("error", onError);
    1.30 +}

mercurial