mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 921e9f7f8924 (bug 849723) for mochitest-other failures on a CLOSED TREE.
This commit is contained in:
parent
64c588e2f9
commit
492c34576a
@ -29,7 +29,13 @@ var mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
// We need to wait for the hidden window to load, but can't access
|
||||
// an event target for a regular event listener.
|
||||
var hidden = mainWindow.Services.appShell.hiddenPrivateDOMWindow;
|
||||
mainWindow.PrivateBrowsingUtils.whenHiddenPrivateWindowReady(function(hidden) {
|
||||
var tmp = setTimeout(function poll() {
|
||||
if (hidden.location.href != "resource://gre-resources/hiddenWindow.html" ||
|
||||
!hidden.document.body) {
|
||||
setTimeout(poll, 100);
|
||||
return;
|
||||
}
|
||||
|
||||
var iframe = hidden.document.createElement('iframe');
|
||||
iframe.src = 'generic.html';
|
||||
hidden.document.body.appendChild(iframe);
|
||||
@ -40,7 +46,7 @@ mainWindow.PrivateBrowsingUtils.whenHiddenPrivateWindowReady(function(hidden) {
|
||||
win.close();
|
||||
win = null;
|
||||
}, false);
|
||||
});
|
||||
}, 100);
|
||||
|
||||
function observer(aSubject, aTopic, aData) {
|
||||
is(aTopic, "last-pb-context-exited", "Unexpected observer topic");
|
||||
|
@ -42,26 +42,6 @@ this.PrivateBrowsingUtils = {
|
||||
},
|
||||
get isInTemporaryAutoStartMode() {
|
||||
return gTemporaryAutoStartMode;
|
||||
},
|
||||
|
||||
whenHiddenPrivateWindowReady: function pbu_whenHiddenPrivateWindowReady(cb) {
|
||||
Components.utils.import("resource://gre/modules/Timer.jsm", Timer);
|
||||
|
||||
let win = Services.appShell.hiddenPrivateDOMWindow;
|
||||
function isNotLoaded() {
|
||||
return ["complete", "interactive"].indexOf(win.document.readyState) == -1;
|
||||
}
|
||||
if (isNotLoaded()) {
|
||||
setTimeout(function poll() {
|
||||
if (isNotLoaded()) {
|
||||
setTimeout(poll, 100);
|
||||
return;
|
||||
}
|
||||
cb(Services.appShell.hiddenPrivateDOMWindow);
|
||||
}, 4);
|
||||
} else {
|
||||
cb(Services.appShell.hiddenPrivateDOMWindow);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user