Bug 654941 - First tab in group has black thumbnail after 'Undo close group' is used; f=raymond, r=ehsan
authorTim Taubert <tim.taubert@gmx.de>
Wed, 11 May 2011 16:13:58 +0200
changeset 69435 32fc5f49b989
parent 69434 05379695923c
child 69436 2dd8b7415752
push id19973
push usermlamouri@mozilla.com
push date2011-05-13 08:59 +0000
treeherdermozilla-central@7fd948de62a6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs654941
milestone6.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 654941 - First tab in group has black thumbnail after 'Undo close group' is used; f=raymond, r=ehsan
browser/base/content/tabview/groupitems.js
browser/base/content/test/tabview/Makefile.in
browser/base/content/test/tabview/browser_tabview_bug624692.js
browser/base/content/test/tabview/browser_tabview_bug654941.js
--- a/browser/base/content/tabview/groupitems.js
+++ b/browser/base/content/tabview/groupitems.js
@@ -734,32 +734,32 @@ GroupItem.prototype = Utils.extend(new I
 
     this._cancelFadeAwayUndoButtonTimer();
     this.hidden = false;
     this.$undoContainer.remove();
     this.$undoContainer = null;
     this.droppable(true);
     this.setTrenches(this.bounds);
 
-    UI.setActive(this);
-
     iQ(this.container).show().animate({
       "-moz-transform": "scale(1)",
       "opacity": 1
     }, {
       duration: 170,
       complete: function() {
         self._children.forEach(function(child) {
           iQ(child.container).show();
         });
+
+        UI.setActive(self);
+        self._sendToSubscribers("groupShown", { groupItemId: self.id });
       }
     });
 
     GroupItems.updateGroupCloseButtons();
-    self._sendToSubscribers("groupShown", { groupItemId: self.id });
   },
 
   // ----------
   // Function: closeHidden
   // Removes the group item, its children and its container.
   closeHidden: function GroupItem_closeHidden() {
     let self = this;
 
--- a/browser/base/content/test/tabview/Makefile.in
+++ b/browser/base/content/test/tabview/Makefile.in
@@ -95,19 +95,20 @@ include $(topsrcdir)/config/rules.mk
                  browser_tabview_bug616967.js \
                  browser_tabview_bug618816.js \
                  browser_tabview_bug618828.js \
                  browser_tabview_bug619937.js \
                  browser_tabview_bug622835.js \
                  browser_tabview_bug622872.js \
                  browser_tabview_bug623768.js \
                  browser_tabview_bug624265.js \
-                 browser_tabview_bug624931.js \
+                 browser_tabview_bug624692.js \
                  browser_tabview_bug624727.js \
                  browser_tabview_bug624847.js \
+                 browser_tabview_bug624931.js \
                  browser_tabview_bug624953.js \
                  browser_tabview_bug625269.js \
                  browser_tabview_bug625424.js \
                  browser_tabview_bug625666.js \
                  browser_tabview_bug626368.js \
                  browser_tabview_bug626525.js \
                  browser_tabview_bug626791.js \
                  browser_tabview_bug627288.js \
@@ -130,16 +131,17 @@ include $(topsrcdir)/config/rules.mk
                  browser_tabview_bug641802.js \
                  browser_tabview_bug642793.js \
                  browser_tabview_bug644097.js \
                  browser_tabview_bug645653.js \
                  browser_tabview_bug648882.js \
                  browser_tabview_bug649006.js \
                  browser_tabview_bug649307.js \
                  browser_tabview_bug651311.js \
+                 browser_tabview_bug654941.js \
                  browser_tabview_dragdrop.js \
                  browser_tabview_exit_button.js \
                  browser_tabview_expander.js \
                  browser_tabview_firstrun_pref.js \
                  browser_tabview_group.js \
                  browser_tabview_launch.js \
                  browser_tabview_multiwindow_search.js \
                  browser_tabview_orphaned_tabs.js \
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/tabview/browser_tabview_bug624692.js
@@ -0,0 +1,25 @@
+/* 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 groupItem = cw.GroupItems.groupItems[0];
+    let tabItem = groupItem.getChild(0);
+
+    hideGroupItem(groupItem, function () {
+      unhideGroupItem(groupItem, function () {
+        let bounds = tabItem.getBounds();
+        groupItem.arrange({immediately: true});
+        ok(bounds.equals(tabItem.getBounds()),
+           "tabItem bounds were correct after unhiding the groupItem");
+
+        finish();
+      });
+    });
+  });
+}
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/tabview/browser_tabview_bug654941.js
@@ -0,0 +1,33 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+function test() {
+  waitForExplicitFinish();
+
+  let compareCanvasSize = function (prefix, width, height, tabItem) {
+    let canvas = tabItem.$canvas[0];
+    is(canvas.width, width, prefix + ": canvas widths are equal (" + width + "px)");
+    is(canvas.height, height, prefix + ": canvas heights are equal (" + height + "px)");
+  };
+
+  newWindowWithTabView(function (win) {
+    registerCleanupFunction(function () win.close());
+
+    let cw = win.TabView.getContentWindow();
+    let groupItem = cw.GroupItems.groupItems[0];
+    let tabItem = groupItem.getChild(0);
+
+    afterAllTabItemsUpdated(function () {
+      let {width, height} = tabItem.$canvas[0];
+
+      hideGroupItem(groupItem, function () {
+        compareCanvasSize("hidden", width, height, tabItem);
+
+        unhideGroupItem(groupItem, function () {
+          compareCanvasSize("unhidden", width, height, tabItem);
+          finish();
+        });
+      });
+    }, win);
+  });
+}