mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 874028 - Debugger and Net monitor tests should use browser's load event rather than tab's, r=past
This commit is contained in:
parent
f3952f8e0a
commit
488e1354a5
@ -70,19 +70,20 @@ function addTab(aURL, aOnload, aWindow) {
|
||||
targetBrowser.selectedTab = targetBrowser.addTab(aURL);
|
||||
|
||||
let tab = targetBrowser.selectedTab;
|
||||
let win = tab.linkedBrowser.contentWindow;
|
||||
let browser = tab.linkedBrowser;
|
||||
let win = browser.contentWindow;
|
||||
let expectedReadyState = aURL == "about:blank" ? ["interactive", "complete"] : ["complete"];
|
||||
|
||||
if (aOnload) {
|
||||
let handler = function() {
|
||||
if (tab.linkedBrowser.currentURI.spec != aURL ||
|
||||
if (browser.currentURI.spec != aURL ||
|
||||
expectedReadyState.indexOf((win.document || {}).readyState) == -1) {
|
||||
return;
|
||||
}
|
||||
tab.removeEventListener("load", handler, false);
|
||||
browser.removeEventListener("load", handler, true);
|
||||
executeSoon(aOnload);
|
||||
}
|
||||
tab.addEventListener("load", handler, false);
|
||||
browser.addEventListener("load", handler, true);
|
||||
}
|
||||
|
||||
return tab;
|
||||
|
@ -52,9 +52,10 @@ function addTab(aUrl, aWindow) {
|
||||
|
||||
targetWindow.focus();
|
||||
let tab = targetBrowser.selectedTab = targetBrowser.addTab(aUrl);
|
||||
let browser = tab.linkedBrowser;
|
||||
|
||||
tab.addEventListener("load", function onLoad() {
|
||||
tab.removeEventListener("load", onLoad, true);
|
||||
browser.addEventListener("load", function onLoad() {
|
||||
browser.removeEventListener("load", onLoad, true);
|
||||
deferred.resolve(tab);
|
||||
}, true);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user