mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 1229250 - Auto-extend the reftest timeout - r=kats
This commit is contained in:
parent
9e6a5653e4
commit
7d1d94d936
@ -119,6 +119,24 @@ function OnInitialLoad()
|
||||
LogWarning("Using browser remote="+ gBrowserIsRemote +"\n");
|
||||
}
|
||||
|
||||
function SetFailureTimeout(cb, timeout)
|
||||
{
|
||||
var targetTime = Date.now() + timeout;
|
||||
|
||||
var wrapper = function() {
|
||||
// Timeouts can fire prematurely in some cases (e.g. in chaos mode). If this
|
||||
// happens, set another timeout for the remaining time.
|
||||
let remainingMs = targetTime - Date.now();
|
||||
if (remainingMs > 0) {
|
||||
SetFailureTimeout(cb, remainingMs);
|
||||
} else {
|
||||
cb();
|
||||
}
|
||||
}
|
||||
|
||||
gFailureTimeout = setTimeout(wrapper, timeout);
|
||||
}
|
||||
|
||||
function StartTestURI(type, uri, timeout)
|
||||
{
|
||||
// Reset gExplicitPendingPaintCount in case there was a timeout or
|
||||
@ -136,7 +154,7 @@ function StartTestURI(type, uri, timeout)
|
||||
if (gFailureTimeout != null) {
|
||||
SendException("program error managing timeouts\n");
|
||||
}
|
||||
gFailureTimeout = setTimeout(LoadFailed, timeout);
|
||||
SetFailureTimeout(LoadFailed, timeout);
|
||||
|
||||
LoadURI(gCurrentURL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user