michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: newWindowWithTabView(function (win) { michael@0: registerCleanupFunction(function () win.close()); michael@0: michael@0: let cw = win.TabView.getContentWindow(); michael@0: let groupItem = cw.GroupItems.groupItems[0]; michael@0: michael@0: // create some tabs with favIcons michael@0: for (let i = 0; i < 3; i++) michael@0: win.gBrowser.loadOneTab("http://mochi.test:8888/browser/browser/components/tabview/test/test_bug644097.html", {inBackground: true}); michael@0: michael@0: win.gBrowser.removeTab(win.gBrowser.tabs[0]); michael@0: michael@0: // shrink the group until it stacks michael@0: let size = 400; michael@0: while (!groupItem.isStacked() && --size) michael@0: groupItem.setSize(size, size, true); michael@0: michael@0: // determine the tabItem at the top of the stack michael@0: let tabItem; michael@0: groupItem.getChildren().forEach(function (item) { michael@0: if (groupItem.isTopOfStack(item)) michael@0: tabItem = item; michael@0: }); michael@0: michael@0: ok(tabItem, "we found the tabItem at the top of the stack"); michael@0: michael@0: let fav = tabItem.$fav; michael@0: is(fav.css("display"), "block", "the favIcon is visible"); michael@0: is(fav.css("left"), "0px", "the favIcon is at the left-most position"); michael@0: is(fav.css("top"), "0px", "the favIcon is at the top-most position"); michael@0: michael@0: finish(); michael@0: }); michael@0: }