browser/base/content/test/newtab/browser_newtab_bug876313.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_bug876313.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,24 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +/*
     1.8 + * This test makes sure that the changes made by unpinning
     1.9 + * a site are actually written to NewTabUtils' storage.
    1.10 + */
    1.11 +function runTests() {
    1.12 +  // Second cell is pinned with page #99.
    1.13 +  yield setLinks("0,1,2,3,4,5,6,7,8");
    1.14 +  setPinnedLinks(",99");
    1.15 +
    1.16 +  yield addNewTabPageTab();
    1.17 +  checkGrid("0,99p,1,2,3,4,5,6,7");
    1.18 +
    1.19 +  // Unpin the second cell's site.
    1.20 +  yield unpinCell(1);
    1.21 +  checkGrid("0,1,2,3,4,5,6,7,8");
    1.22 +
    1.23 +  // Clear the pinned cache to force NewTabUtils to read the pref again.
    1.24 +  NewTabUtils.pinnedLinks.resetCache();
    1.25 +  NewTabUtils.allPages.update();
    1.26 +  checkGrid("0,1,2,3,4,5,6,7,8");
    1.27 +}

mercurial