diff --git a/browser/base/content/tabview/tabitems.js b/browser/base/content/tabview/tabitems.js index 439c4d85dc24..ed53f449444e 100644 --- a/browser/base/content/tabview/tabitems.js +++ b/browser/base/content/tabview/tabitems.js @@ -1143,15 +1143,9 @@ let TabItems = { _checkHeartbeat: function TabItems__checkHeartbeat() { this._heartbeat = null; - if (this.isPaintingPaused()) + if (this.isPaintingPaused() || !UI.isIdle) return; - // restart the heartbeat to update all waiting tabs once the UI becomes idle - if (!UI.isIdle()) { - this.startHeartbeat(); - return; - } - let accumTime = 0; let items = this._tabsWaitingForUpdate.getItems(); // Do as many updates as we can fit into a "perceived" amount diff --git a/browser/base/content/test/tabview/Makefile.in b/browser/base/content/test/tabview/Makefile.in index 1318f50646d7..8b447d14f761 100644 --- a/browser/base/content/test/tabview/Makefile.in +++ b/browser/base/content/test/tabview/Makefile.in @@ -130,7 +130,6 @@ _BROWSER_FILES = \ browser_tabview_bug641802.js \ browser_tabview_bug644097.js \ browser_tabview_bug645653.js \ - browser_tabview_bug648882.js \ browser_tabview_bug649006.js \ browser_tabview_dragdrop.js \ browser_tabview_exit_button.js \ diff --git a/browser/base/content/test/tabview/browser_tabview_bug648882.js b/browser/base/content/test/tabview/browser_tabview_bug648882.js deleted file mode 100644 index 887abf932245..000000000000 --- a/browser/base/content/test/tabview/browser_tabview_bug648882.js +++ /dev/null @@ -1,84 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ */ - -function test() { - waitForExplicitFinish(); - - testHeartbeatAfterBusyUI(function () { - testTabUpdatesWithBusyUI(finish); - }); -} - -function testHeartbeatAfterBusyUI(callback) { - newWindowWithTabView(function (win) { - registerCleanupFunction(function () win.close()); - - let cw = win.TabView.getContentWindow(); - let tab = win.gBrowser.tabs[0]; - let tabItem = tab._tabViewTabItem; - - cw.TabItems.pausePainting(); - - tabItem.addSubscriber(tabItem, "updated", function () { - tabItem.removeSubscriber(tabItem, "updated"); - callback(); - }); - - cw.TabItems.update(tab); - - cw.UI.isIdle = function () { - cw.UI.isIdle = function () true; - return false; - } - - cw.TabItems.resumePainting(); - }); -} - -function testTabUpdatesWithBusyUI(callback) { - newWindowWithTabView(function (win) { - registerCleanupFunction(function () win.close()); - - let cw = win.TabView.getContentWindow(); - let tab = win.gBrowser.tabs[0]; - let tabItem = tab._tabViewTabItem; - let groupItem = cw.GroupItems.groupItems[0]; - let container = groupItem.container; - let resizer = groupItem.$resizer[0]; - - let intervalID; - let isIdle = false; - let numLoops = 10; - let interval = cw.UI._maxInteractiveWait / 2; - - let simulateBusyUI = function () { - let target = 5 < numLoops-- ? container : resizer; - - EventUtils.synthesizeMouse(target, 5, 5, {type: "mousedown"}, cw); - EventUtils.synthesizeMouse(target, 40, 20, {type: "mousemove"}, cw); - EventUtils.synthesizeMouse(target, 20, 20, {type: "mouseup"}, cw); - - win.setTimeout(function () { - if (numLoops) - simulateBusyUI(); - else - isIdle = true; - }, interval); - }; - - SimpleTest.waitForFocus(function () { - cw.TabItems.pausePainting(); - cw.TabItems.update(tab); - - tabItem.addSubscriber(tabItem, "updated", function () { - tabItem.removeSubscriber(tabItem, "updated"); - ok(isIdle, "tabItem is updated only when UI is idle"); - callback(); - }); - - simulateBusyUI(); - win.setTimeout(simulateBusyUI, interval); - cw.TabItems.resumePainting(); - }, cw); - }); -}