Bug 1499474 - Check if the element has textContent before falling back to TestUtils.waitForCondition. r=MattN

This patch reduced the time to run from 2 minutes to 15 seconds.

Differential Revision: https://phabricator.services.mozilla.com/D8895

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jared Wein 2018-10-16 20:04:38 +00:00
Родитель a5fabb8cb9
Коммит d95c5b459f
1 изменённых файлов: 5 добавлений и 2 удалений

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

@ -324,8 +324,11 @@ add_task(async function test_countryFieldLabels() {
// Check that the labels were filled // Check that the labels were filled
for (let labelEl of mutatableLabels) { for (let labelEl of mutatableLabels) {
await TestUtils.waitForCondition(() => labelEl.textContent, if (!labelEl.textContent) {
"Wait for label to be populated by the mutation observer"); await TestUtils.waitForCondition(() => labelEl.textContent,
"Wait for label to be populated by the mutation observer",
10);
}
isnot(labelEl.textContent, "", isnot(labelEl.textContent, "",
"Ensure textContent is non-empty for: " + countryOption.value); "Ensure textContent is non-empty for: " + countryOption.value);
is(labelEl.dataset.localization, undefined, is(labelEl.dataset.localization, undefined,