browser/base/content/test/newtab/browser_newtab_bug721442.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_bug721442.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,23 @@
     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 +    {url: "http://example.com/#7", title: ""},
    1.11 +    {url: "http://example.com/#8", title: "title"},
    1.12 +    {url: "http://example.com/#9", title: "http://example.com/#9"}
    1.13 +  ]);
    1.14 +
    1.15 +  yield addNewTabPageTab();
    1.16 +  checkGrid("7p,8p,9p,0,1,2,3,4,5");
    1.17 +
    1.18 +  checkTooltip(0, "http://example.com/#7", "1st tooltip is correct");
    1.19 +  checkTooltip(1, "title\nhttp://example.com/#8", "2nd tooltip is correct");
    1.20 +  checkTooltip(2, "http://example.com/#9", "3rd tooltip is correct");
    1.21 +}
    1.22 +
    1.23 +function checkTooltip(aIndex, aExpected, aMessage) {
    1.24 +  let link = getCell(aIndex).node.querySelector(".newtab-link");
    1.25 +  is(link.getAttribute("title"), aExpected, aMessage);
    1.26 +}

mercurial