mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 879098 - fix test failures caused by bug 878452, r=mconley
This commit is contained in:
parent
e9f671165b
commit
98c16dd89f
@ -47,9 +47,11 @@ function removeCustomToolbars() {
|
||||
}
|
||||
|
||||
function resetCustomization() {
|
||||
CustomizableUI.reset();
|
||||
if (document.documentElement.hasAttribute("customizing")) {
|
||||
window.gCustomizeMode.reset();
|
||||
window.gCustomizeMode.exit();
|
||||
} else {
|
||||
CustomizableUI.reset();
|
||||
}
|
||||
}
|
||||
|
||||
@ -87,15 +89,36 @@ function simulateItemDrag(toDrag, target) {
|
||||
}
|
||||
|
||||
function endCustomizing() {
|
||||
let deferred = Promise.defer();
|
||||
function onCustomizationEnds(ev) {
|
||||
let deferredEndCustomizing = Promise.defer();
|
||||
function onCustomizationEnds() {
|
||||
window.gNavToolbox.removeEventListener("aftercustomization", onCustomizationEnds);
|
||||
deferred.resolve(ev);
|
||||
deferredEndCustomizing.resolve();
|
||||
}
|
||||
window.gNavToolbox.addEventListener("aftercustomization", onCustomizationEnds);
|
||||
window.gCustomizeMode.exit();
|
||||
return deferred.promise;
|
||||
|
||||
let deferredLoadNewTab = Promise.defer();
|
||||
|
||||
//XXXgijs so some tests depend on this tab being about:blank. Make it so.
|
||||
let newTabBrowser = window.gBrowser.selectedBrowser;
|
||||
newTabBrowser.stop();
|
||||
|
||||
// If we stop early enough, this might actually be about:blank.
|
||||
if (newTabBrowser.contentDocument.location.href == "about:blank") {
|
||||
return deferredEndCustomizing.promise;
|
||||
}
|
||||
|
||||
// Otherwise, make it be about:blank, and wait for that to be done.
|
||||
function onNewTabLoaded(e) {
|
||||
newTabBrowser.removeEventListener("load", onNewTabLoaded, true);
|
||||
deferredLoadNewTab.resolve();
|
||||
}
|
||||
newTabBrowser.addEventListener("load", onNewTabLoaded, true);
|
||||
newTabBrowser.contentDocument.location.replace("about:blank");
|
||||
|
||||
return Promise.all(deferredEndCustomizing.promise, deferredLoadNewTab.promise);
|
||||
}
|
||||
|
||||
function startCustomizing() {
|
||||
let deferred = Promise.defer();
|
||||
function onCustomizing() {
|
||||
|
Loading…
Reference in New Issue
Block a user