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
parent a5fabb8cb9
commit d95c5b459f

View File

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