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: let newTabs = [] michael@0: // add enough tabs so the close buttons are hidden and then check the closebuttons attribute michael@0: do { michael@0: let newTab = gBrowser.addTab("about:blank", {skipAnimation: true}); michael@0: newTabs.push(newTab); michael@0: } while (gBrowser.visibleTabs[0].getBoundingClientRect().width > gBrowser.tabContainer.mTabClipWidth) michael@0: michael@0: // a setTimeout() in addTab is used to trigger adjustTabstrip() so we need a delay here as well. michael@0: executeSoon(function() { michael@0: is(gBrowser.tabContainer.getAttribute("closebuttons"), "activetab", "Only show button on selected tab."); michael@0: michael@0: // move a tab to another group and check the closebuttons attribute michael@0: TabView._initFrame(function() { michael@0: TabView.moveTabTo(newTabs[newTabs.length - 1], null); michael@0: ok(gBrowser.visibleTabs[0].getBoundingClientRect().width > gBrowser.tabContainer.mTabClipWidth, michael@0: "Tab width is bigger than tab clip width"); michael@0: is(gBrowser.tabContainer.getAttribute("closebuttons"), "", "Show button on all tabs.") michael@0: michael@0: // clean up and finish michael@0: newTabs.forEach(function(tab) { michael@0: gBrowser.removeTab(tab); michael@0: }); michael@0: finish(); michael@0: }); michael@0: }); michael@0: }