2011-02-27 17:36:36 -08:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
2010-09-14 03:12:03 -07:00
|
|
|
|
|
|
|
function test() {
|
2011-06-17 05:07:59 -07:00
|
|
|
let newTab;
|
2010-09-14 03:12:03 -07:00
|
|
|
|
2011-06-17 05:07:59 -07:00
|
|
|
let onLoad = function (win) {
|
|
|
|
registerCleanupFunction(function () win.close());
|
2010-09-14 03:12:03 -07:00
|
|
|
|
|
|
|
newTab = win.gBrowser.addTab();
|
|
|
|
|
2011-06-17 05:07:59 -07:00
|
|
|
let popup = win.document.getElementById("context_tabViewMenuPopup");
|
|
|
|
win.TabView.updateContextMenu(newTab, popup);
|
|
|
|
};
|
2010-09-14 03:12:03 -07:00
|
|
|
|
2011-06-17 05:07:59 -07:00
|
|
|
let onShow = function (win) {
|
|
|
|
let cw = win.TabView.getContentWindow();
|
|
|
|
is(cw.GroupItems.groupItems.length, 1, "Has only one group");
|
2010-09-14 03:12:03 -07:00
|
|
|
|
2011-06-17 05:07:59 -07:00
|
|
|
let groupItem = cw.GroupItems.groupItems[0];
|
|
|
|
let tabItems = groupItem.getChildren();
|
2010-09-14 03:12:03 -07:00
|
|
|
|
2011-06-17 05:07:59 -07:00
|
|
|
let tab = tabItems[tabItems.length - 1].tab;
|
|
|
|
is(tab, newTab, "The new tab exists in the group");
|
2010-09-14 03:12:03 -07:00
|
|
|
|
|
|
|
finish();
|
2011-06-17 05:07:59 -07:00
|
|
|
};
|
2010-09-14 03:12:03 -07:00
|
|
|
|
2011-06-17 05:07:59 -07:00
|
|
|
waitForExplicitFinish();
|
|
|
|
newWindowWithTabView(onShow, onLoad);
|
2010-09-14 03:12:03 -07:00
|
|
|
}
|