зеркало из https://github.com/mozilla/gecko-dev.git
Bug 874028 - Debugger and Net monitor tests should use browser's load event rather than tab's, r=past
This commit is contained in:
Родитель
d06a609568
Коммит
993a0df99e
|
@ -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);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче