mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-13 03:24:26 +00:00
Bug 942229 - Intermittent browser_cmd_screenshot.js, r=jwalker
--HG-- extra : rebase_source : f44fec6e46526a1381ac956bc362f82e11c1123c
This commit is contained in:
parent
bb8f3692fd
commit
ce023acc30
@ -170,9 +170,7 @@ function addWindow(windowOptions, callback) {
|
||||
|
||||
let win = OpenBrowserWindow(windowOptions);
|
||||
|
||||
let onLoad = function() {
|
||||
win.removeEventListener("load", onLoad, false);
|
||||
|
||||
whenDelayedStartupFinished(win, function() {
|
||||
// Would like to get rid of this executeSoon, but without it the url
|
||||
// (TEST_URI) provided in addTabWithToolbarRunTests hasn't loaded
|
||||
executeSoon(function() {
|
||||
@ -187,9 +185,7 @@ function addWindow(windowOptions, callback) {
|
||||
deferred.reject(ex);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
win.addEventListener("load", onLoad, false);
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
@ -10,6 +10,15 @@ let testDir = gTestPath.substr(0, gTestPath.lastIndexOf("/"));
|
||||
Services.scriptloader.loadSubScript(testDir + "/helpers.js", this);
|
||||
Services.scriptloader.loadSubScript(testDir + "/mockCommands.js", this);
|
||||
|
||||
function whenDelayedStartupFinished(aWindow, aCallback) {
|
||||
Services.obs.addObserver(function observer(aSubject, aTopic) {
|
||||
if (aWindow == aSubject) {
|
||||
Services.obs.removeObserver(observer, aTopic);
|
||||
executeSoon(aCallback);
|
||||
}
|
||||
}, "browser-delayed-startup-finished", false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Force GC on shutdown, because it seems that GCLI can outrun the garbage
|
||||
* collector in some situations, which causes test failures in later tests
|
||||
|
Loading…
x
Reference in New Issue
Block a user