diff -r 000000000000 -r 6474c204b198 browser/components/tabview/test/browser_tabview_bug644097.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/browser/components/tabview/test/browser_tabview_bug644097.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,40 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +function test() { + waitForExplicitFinish(); + + newWindowWithTabView(function (win) { + registerCleanupFunction(function () win.close()); + + let cw = win.TabView.getContentWindow(); + let groupItem = cw.GroupItems.groupItems[0]; + + // create some tabs with favIcons + for (let i = 0; i < 3; i++) + win.gBrowser.loadOneTab("http://mochi.test:8888/browser/browser/components/tabview/test/test_bug644097.html", {inBackground: true}); + + win.gBrowser.removeTab(win.gBrowser.tabs[0]); + + // shrink the group until it stacks + let size = 400; + while (!groupItem.isStacked() && --size) + groupItem.setSize(size, size, true); + + // determine the tabItem at the top of the stack + let tabItem; + groupItem.getChildren().forEach(function (item) { + if (groupItem.isTopOfStack(item)) + tabItem = item; + }); + + ok(tabItem, "we found the tabItem at the top of the stack"); + + let fav = tabItem.$fav; + is(fav.css("display"), "block", "the favIcon is visible"); + is(fav.css("left"), "0px", "the favIcon is at the left-most position"); + is(fav.css("top"), "0px", "the favIcon is at the top-most position"); + + finish(); + }); +}