зеркало из https://github.com/mozilla/gecko-dev.git
merge backout
This commit is contained in:
Коммит
75d9cb1501
|
@ -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
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
}
|
Загрузка…
Ссылка в новой задаче