mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 832491 - enable --timeout support in browser-chrome mochitests; r=jmaher
This commit is contained in:
parent
4f82e5a42a
commit
d42d9f8a62
@ -1,5 +1,5 @@
|
||||
// Test timeout (seconds)
|
||||
const TIMEOUT_SECONDS = 30;
|
||||
var gTimeoutSeconds = 30;
|
||||
var gConfig;
|
||||
|
||||
if (Cc === undefined) {
|
||||
@ -29,6 +29,9 @@ function testOnLoad() {
|
||||
|
||||
prefs.setBoolPref("testing.browserTestHarness.running", true);
|
||||
|
||||
if (prefs.prefHasUserValue("testing.browserTestHarness.timeout"))
|
||||
gTimeoutSeconds = prefs.getIntPref("testing.browserTestHarness.timeout");
|
||||
|
||||
var sstring = Cc["@mozilla.org/supports-string;1"].
|
||||
createInstance(Ci.nsISupportsString);
|
||||
sstring.data = location.search;
|
||||
@ -407,14 +410,14 @@ Tester.prototype = {
|
||||
"Longer timeout required, waiting longer... Remaining timeouts: " +
|
||||
self.currentTest.scope.__timeoutFactor);
|
||||
self.currentTest.scope.__waitTimer =
|
||||
setTimeout(arguments.callee, TIMEOUT_SECONDS * 1000);
|
||||
setTimeout(arguments.callee, gTimeoutSeconds * 1000);
|
||||
return;
|
||||
}
|
||||
self.currentTest.addResult(new testResult(false, "Test timed out", "", false));
|
||||
self.currentTest.timedOut = true;
|
||||
self.currentTest.scope.__waitTimer = null;
|
||||
self.nextTest();
|
||||
}, TIMEOUT_SECONDS * 1000);
|
||||
}, gTimeoutSeconds * 1000);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -584,6 +584,8 @@ class Mochitest(object):
|
||||
|
||||
def buildProfile(self, options):
|
||||
""" create the profile and add optional chrome bits and files if requested """
|
||||
if options.browserChrome and options.timeout:
|
||||
options.extraPrefs.append("testing.browserTestHarness.timeout=%d" % options.timeout)
|
||||
self.automation.initializeProfile(options.profilePath,
|
||||
options.extraPrefs,
|
||||
useServerLocations=True)
|
||||
|
Loading…
Reference in New Issue
Block a user