Bug 1447941 - Replace promiseWaitForCondition with TestUtils.waitForCondition in browser_aboutHome_search_searchbar.js r=johannh

This commit is contained in:
Issei Horie 2018-05-01 09:30:33 +09:00
Родитель cae9cf0b13
Коммит 3abf069c75
2 изменённых файлов: 1 добавлений и 7 удалений

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

@ -17,7 +17,7 @@ add_task(async function() {
isnot(searchInput, doc.activeElement, "Search bar should not be the active element.");
EventUtils.synthesizeKey("k", { accelKey: true });
await promiseWaitForCondition(() => doc.activeElement === searchInput);
await TestUtils.waitForCondition(() => doc.activeElement === searchInput);
is(searchInput, doc.activeElement, "Search bar should be the active element.");
});

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

@ -23,12 +23,6 @@ function waitForCondition(condition, nextTest, errorMsg, retryTimes) {
var moveOn = function() { clearInterval(interval); nextTest(); };
}
function promiseWaitForCondition(aConditionFn) {
return new Promise(resolve => {
waitForCondition(aConditionFn, resolve, "Condition didn't pass.");
});
}
function whenTabLoaded(aTab, aCallback) {
promiseTabLoadEvent(aTab).then(aCallback);
}