Bug 1246455 - mozscreenshots: Add a delay between applying configurations. r=kitcambridge

Avoid conflicts when configurations try to apply at the same time. e.g WindowSize and TabsInTitlebar.
Also bump requestLongerTimeout for the longer duration or this will timeout on OS X.

--HG--
extra : commitid : 7SPq0GLT8AZ
extra : rebase_source : efb7ebcb847f04b3c74f9b2138390013b2eb1cb8
This commit is contained in:
Matthew Noorenberghe 2016-02-06 18:35:02 -08:00
parent 5c02d89382
commit cb578f6cac
2 changed files with 11 additions and 3 deletions

View File

@ -8,7 +8,7 @@ const {AddonWatcher} = Cu.import("resource://gre/modules/AddonWatcher.jsm", {});
const env = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment);
function setup() {
requestLongerTimeout(10);
requestLongerTimeout(20);
info("Checking for mozscreenshots extension");
return new Promise((resolve) => {

View File

@ -13,8 +13,10 @@ const env = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironmen
Cu.import("resource://gre/modules/FileUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://gre/modules/Timer.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/osfile.jsm");
Cu.import("chrome://mozscreenshots/content/Screenshot.jsm");
// Create a new instance of the ConsoleAPI so we can control the maxLogLevel with a pref.
@ -146,9 +148,15 @@ this.TestRunner = {
function changeConfig(config) {
log.debug("calling " + config.name);
let promise = config.applyConfig();
let promise = Promise.resolve(config.applyConfig());
log.debug("called " + config.name);
return promise;
// Add a default timeout of 500ms to avoid conflicts when configurations
// try to apply at the same time. e.g WindowSize and TabsInTitlebar
return promise.then(() => {
return new Promise((resolve) => {
setTimeout(resolve, 500);
});
});
}
try {