diff -r 000000000000 -r 6474c204b198 browser/components/tabview/test/browser_tabview_bug669694.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/browser/components/tabview/test/browser_tabview_bug669694.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,48 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +function test() { + waitForExplicitFinish(); + + function onLoad(win) { + registerCleanupFunction(function () win.close()); + + let tab = win.gBrowser.addTab(); + win.gBrowser.pinTab(tab); + } + + function onShow(win) { + let tabs = win.gBrowser.tabs; + + // zoom into normal tab + zoomIn(tabs[1], function () { + is(win.gBrowser.selectedTab, tabs[1], "normal tab is selected"); + + // select app tab + win.gBrowser.selectedTab = tabs[0]; + + toggleTabView(win, function () { + is(win.gBrowser.selectedTab, tabs[0], "app tab is selected"); + finish(); + }); + }); + } + + newWindowWithTabView(onShow, onLoad); +} + +// ---------- +function zoomIn(tab, callback) { + whenTabViewIsHidden(function () { + executeSoon(callback); + }, tab.ownerDocument.defaultView); + + tab._tabViewTabItem.zoomIn(); +} + +// ---------- +function toggleTabView(win, callback) { + showTabView(function () { + hideTabView(callback, win); + }, win); +}