Bug 1320994 - Increase retries for screensharing preview window. r=florian

MozReview-Commit-ID: IPnLWPT8SNP

--HG--
extra : rebase_source : 21b082ae29fed7332ecafcd500d6cb8e25e42217
This commit is contained in:
Andreas Pehrson 2017-05-03 22:58:40 +02:00
Родитель 7b778ab6a6
Коммит da339f960b
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -55,7 +55,7 @@ var gTests = [
menulist.getItemAtIndex(2).doCommand();
ok(!document.getElementById("webRTC-all-windows-shared").hidden,
"the 'all windows will be shared' warning should now be visible");
yield promiseWaitForCondition(() => !document.getElementById("webRTC-preview").hidden);
yield promiseWaitForCondition(() => !document.getElementById("webRTC-preview").hidden, 100);
ok(!document.getElementById("webRTC-preview").hidden,
"the preview area is visible");
ok(!document.getElementById("webRTC-previewWarning").hidden,

Просмотреть файл

@ -30,9 +30,9 @@ function waitForCondition(condition, nextTest, errorMsg, retryTimes) {
var moveOn = function() { clearInterval(interval); nextTest(); };
}
function promiseWaitForCondition(aConditionFn) {
function promiseWaitForCondition(aConditionFn, retryTimes) {
let deferred = Promise.defer();
waitForCondition(aConditionFn, deferred.resolve, "Condition didn't pass.");
waitForCondition(aConditionFn, deferred.resolve, "Condition didn't pass.", retryTimes);
return deferred.promise;
}