Bug 706736 - unclosed tab recreated in wrong tab group r=tim
This commit is contained in:
@@ -1147,7 +1147,7 @@ GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
|
|||||||
|
|
||||||
let closed = options.dontClose ? false : this.closeIfEmpty();
|
let closed = options.dontClose ? false : this.closeIfEmpty();
|
||||||
if (closed ||
|
if (closed ||
|
||||||
(this._children.length == 0 && !gBrowser.selectedTab.pinned &&
|
(this._children.length == 0 && !gBrowser._numPinnedTabs &&
|
||||||
!item.isDragging)) {
|
!item.isDragging)) {
|
||||||
this._makeLastActiveGroupItemActive();
|
this._makeLastActiveGroupItemActive();
|
||||||
} else if (!options.dontArrange) {
|
} else if (!options.dontArrange) {
|
||||||
|
|||||||
@@ -166,6 +166,7 @@ _BROWSER_FILES = \
|
|||||||
browser_tabview_bug697390.js \
|
browser_tabview_bug697390.js \
|
||||||
browser_tabview_bug705621.js \
|
browser_tabview_bug705621.js \
|
||||||
browser_tabview_bug706430.js \
|
browser_tabview_bug706430.js \
|
||||||
|
browser_tabview_bug706736.js \
|
||||||
browser_tabview_click_group.js \
|
browser_tabview_click_group.js \
|
||||||
browser_tabview_dragdrop.js \
|
browser_tabview_dragdrop.js \
|
||||||
browser_tabview_exit_button.js \
|
browser_tabview_exit_button.js \
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ function test() {
|
|||||||
is(groupItemOne.getChildren().length, 1, "Group one has 1 tab item");
|
is(groupItemOne.getChildren().length, 1, "Group one has 1 tab item");
|
||||||
|
|
||||||
let groupItemTwo = createGroupItemWithBlankTabs(win, 300, 300, 40, 1);
|
let groupItemTwo = createGroupItemWithBlankTabs(win, 300, 300, 40, 1);
|
||||||
is(groupItemTwo.getChildren().length, 1, "Group two has 2 tab items");
|
is(groupItemTwo.getChildren().length, 1, "Group two has 1 tab item");
|
||||||
|
|
||||||
whenTabViewIsHidden(function() {
|
whenTabViewIsHidden(function() {
|
||||||
executeSoon(function() {
|
executeSoon(function() {
|
||||||
|
|||||||
40
browser/components/tabview/test/browser_tabview_bug706736.js
Normal file
40
browser/components/tabview/test/browser_tabview_bug706736.js
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
|
||||||
|
function test() {
|
||||||
|
waitForExplicitFinish();
|
||||||
|
|
||||||
|
newWindowWithTabView(function(win) {
|
||||||
|
registerCleanupFunction(function() {
|
||||||
|
win.close();
|
||||||
|
});
|
||||||
|
|
||||||
|
let cw = win.TabView.getContentWindow();
|
||||||
|
|
||||||
|
let groupItemOne = cw.GroupItems.groupItems[0];
|
||||||
|
is(groupItemOne.getChildren().length, 1, "Group one has 1 tab item");
|
||||||
|
|
||||||
|
let groupItemTwo = createGroupItemWithBlankTabs(win, 300, 300, 40, 1);
|
||||||
|
is(groupItemTwo.getChildren().length, 1, "Group two has 1 tab items");
|
||||||
|
|
||||||
|
whenTabViewIsHidden(function() {
|
||||||
|
win.gBrowser.removeTab(win.gBrowser.selectedTab);
|
||||||
|
executeSoon(function() {
|
||||||
|
win.undoCloseTab();
|
||||||
|
|
||||||
|
groupItemTwo.addSubscriber("childAdded", function onChildAdded(data) {
|
||||||
|
groupItemTwo.removeSubscriber("childAdded", onChildAdded);
|
||||||
|
|
||||||
|
is(groupItemOne.getChildren().length, 1, "Group one still has 1 tab item");
|
||||||
|
is(groupItemTwo.getChildren().length, 1, "Group two still has 1 tab item");
|
||||||
|
});
|
||||||
|
|
||||||
|
finish();
|
||||||
|
});
|
||||||
|
}, win);
|
||||||
|
groupItemTwo.getChild(0).zoomIn();
|
||||||
|
}, function(win) {
|
||||||
|
let newTab = win.gBrowser.addTab();
|
||||||
|
win.gBrowser.pinTab(newTab);
|
||||||
|
});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user