mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
34 lines
955 B
JavaScript
34 lines
955 B
JavaScript
/* 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 tab = win.gBrowser.tabs[0];
|
|
let tabItem = tab._tabViewTabItem;
|
|
let isIdle = false;
|
|
|
|
// We replace UI.isIdle() here to not rely on setTimeout(). While this
|
|
// function returns false (busy) we expect no tabItem updates to happen.
|
|
let busyCount = 5;
|
|
cw.UI.isIdle = function () {
|
|
return isIdle = (0 > --busyCount);
|
|
};
|
|
|
|
cw.TabItems.pausePainting();
|
|
|
|
tabItem.addSubscriber(tabItem, "updated", function () {
|
|
tabItem.removeSubscriber(tabItem, "updated");
|
|
ok(isIdle, "tabItem is updated only when UI is idle");
|
|
finish();
|
|
});
|
|
|
|
cw.TabItems.update(tab);
|
|
cw.TabItems.resumePainting();
|
|
});
|
|
}
|