2011-02-27 17:36:36 -08:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
2010-08-10 09:11:06 -07:00
|
|
|
|
2011-03-08 00:10:07 -08:00
|
|
|
let timerId;
|
2011-06-23 13:56:32 -07:00
|
|
|
let newWin;
|
2010-10-08 14:03:52 -07:00
|
|
|
|
|
|
|
// ----------
|
2010-08-10 09:11:06 -07:00
|
|
|
function test() {
|
|
|
|
waitForExplicitFinish();
|
2011-01-16 01:54:17 -08:00
|
|
|
|
2011-01-20 00:36:05 -08:00
|
|
|
// launch tab view for the first time
|
2011-06-23 13:56:32 -07:00
|
|
|
newWindowWithTabView(function() {}, function(win) {
|
|
|
|
newWin = win;
|
|
|
|
|
|
|
|
let onSelect = function(event) {
|
|
|
|
if (deck != event.target)
|
|
|
|
return;
|
|
|
|
|
|
|
|
let iframe = win.document.getElementById("tab-view");
|
|
|
|
if (deck.selectedPanel != iframe)
|
|
|
|
return;
|
|
|
|
|
|
|
|
deck.removeEventListener("select", onSelect, true);
|
|
|
|
|
|
|
|
whenTabViewIsShown(function() {
|
|
|
|
executeSoon(function() {
|
|
|
|
testMethodToHideAndShowTabView(function() {
|
|
|
|
newWin.document.getElementById("menu_tabview").doCommand();
|
|
|
|
}, function() {
|
|
|
|
testMethodToHideAndShowTabView(function() {
|
|
|
|
EventUtils.synthesizeKey("E", { accelKey: true, shiftKey: true }, newWin);
|
|
|
|
}, finish);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}, win);
|
|
|
|
};
|
|
|
|
|
|
|
|
let deck = win.document.getElementById("tab-view-deck");
|
|
|
|
deck.addEventListener("select", onSelect, true);
|
|
|
|
});
|
2011-03-08 00:10:07 -08:00
|
|
|
|
|
|
|
registerCleanupFunction(function () {
|
2011-06-23 13:56:32 -07:00
|
|
|
newWin.close();
|
2011-03-08 00:10:07 -08:00
|
|
|
});
|
2010-08-10 09:11:06 -07:00
|
|
|
}
|
2010-10-08 14:03:52 -07:00
|
|
|
|
2011-06-23 13:56:32 -07:00
|
|
|
function testMethodToHideAndShowTabView(executeFunc, callback) {
|
|
|
|
whenTabViewIsHidden(function() {
|
|
|
|
ok(!newWin.TabView.isVisible(), "Tab View is not visible after executing the function");
|
|
|
|
whenTabViewIsShown(function() {
|
|
|
|
ok(newWin.TabView.isVisible(), "Tab View is visible after executing the function again");
|
|
|
|
callback();
|
|
|
|
}, newWin);
|
|
|
|
executeFunc();
|
|
|
|
}, newWin);
|
|
|
|
executeFunc();
|
2011-01-16 01:54:17 -08:00
|
|
|
}
|