mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
Bug 851516: browser-chrome should wait for delayedStartup. r=joe
--HG-- extra : rebase_source : 242defb996e64271c100b7de1140dde76d3e3c39
This commit is contained in:
parent
c42cc7a82d
commit
7281829ef2
@ -1640,6 +1640,7 @@ var gBrowserInit = {
|
||||
}
|
||||
|
||||
Services.obs.notifyObservers(window, "browser-delayed-startup-finished", "");
|
||||
setTimeout(function () { BrowserChromeTest.markAsReady(); }, 0);
|
||||
TelemetryTimestamps.add("delayedStartupFinished");
|
||||
},
|
||||
|
||||
@ -7537,3 +7538,20 @@ function focusNextFrame(event) {
|
||||
focusAndSelectUrlBar();
|
||||
}
|
||||
|
||||
let BrowserChromeTest = {
|
||||
_cb: null,
|
||||
_ready: false,
|
||||
markAsReady: function () {
|
||||
this._ready = true;
|
||||
if (this._cb) {
|
||||
this._cb();
|
||||
this._cb = null;
|
||||
}
|
||||
},
|
||||
runWhenReady: function (cb) {
|
||||
if (this._ready)
|
||||
cb();
|
||||
else
|
||||
this._cb = cb;
|
||||
}
|
||||
};
|
||||
|
@ -92,6 +92,15 @@ Tester.prototype = {
|
||||
},
|
||||
|
||||
start: function Tester_start() {
|
||||
// Check whether this window is ready to run tests.
|
||||
if (window.BrowserChromeTest) {
|
||||
BrowserChromeTest.runWhenReady(this.actuallyStart.bind(this));
|
||||
return;
|
||||
}
|
||||
this.actuallyStart();
|
||||
},
|
||||
|
||||
actuallyStart: function Tester_actuallyStart() {
|
||||
//if testOnLoad was not called, then gConfig is not defined
|
||||
if (!gConfig)
|
||||
gConfig = readConfig();
|
||||
|
Loading…
Reference in New Issue
Block a user