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: let cw = win.TabView.getContentWindow(); michael@0: michael@0: // turn off zoom animations michael@0: cw.gPrefBranch.setBoolPref("animate_zoom", false); michael@0: michael@0: registerCleanupFunction(function () { michael@0: cw.gPrefBranch.clearUserPref("animate_zoom"); michael@0: win.close(); michael@0: }); michael@0: michael@0: let group = cw.GroupItems.groupItems[0]; michael@0: group.setSize(100, 100, true); michael@0: michael@0: while (!group.isStacked()) michael@0: win.gBrowser.addTab(); michael@0: michael@0: waitForFocus(function () { michael@0: whenGroupIsExpanded(group, function () { michael@0: ok(win.TabView.isVisible(), "tabview is visible"); michael@0: finish(); michael@0: }); michael@0: michael@0: let expander = group.$expander[0]; michael@0: EventUtils.synthesizeMouseAtCenter(expander, {}, cw); michael@0: }, cw); michael@0: }); michael@0: } michael@0: michael@0: // ---------- michael@0: function whenGroupIsExpanded(group, callback) { michael@0: group.addSubscriber("expanded", function onExpanded() { michael@0: group.removeSubscriber("expanded", onExpanded); michael@0: executeSoon(callback); michael@0: }); michael@0: }