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,1,2,3,4,5,6,7,8"); michael@0: setPinnedLinks([ michael@0: {url: "http://example.com/#7", title: ""}, michael@0: {url: "http://example.com/#8", title: "title"}, michael@0: {url: "http://example.com/#9", title: "http://example.com/#9"} michael@0: ]); michael@0: michael@0: yield addNewTabPageTab(); michael@0: checkGrid("7p,8p,9p,0,1,2,3,4,5"); michael@0: michael@0: checkTooltip(0, "http://example.com/#7", "1st tooltip is correct"); michael@0: checkTooltip(1, "title\nhttp://example.com/#8", "2nd tooltip is correct"); michael@0: checkTooltip(2, "http://example.com/#9", "3rd tooltip is correct"); michael@0: } michael@0: michael@0: function checkTooltip(aIndex, aExpected, aMessage) { michael@0: let link = getCell(aIndex).node.querySelector(".newtab-link"); michael@0: is(link.getAttribute("title"), aExpected, aMessage); michael@0: }