From d95c5b459f9ec0165741d29da8979b667ae3c50d Mon Sep 17 00:00:00 2001 From: Jared Wein Date: Tue, 16 Oct 2018 20:04:38 +0000 Subject: [PATCH] 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 --- .../formautofill/test/browser/browser_editAddressDialog.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/browser/extensions/formautofill/test/browser/browser_editAddressDialog.js b/browser/extensions/formautofill/test/browser/browser_editAddressDialog.js index 02476431cfce..06126af30db0 100644 --- a/browser/extensions/formautofill/test/browser/browser_editAddressDialog.js +++ b/browser/extensions/formautofill/test/browser/browser_editAddressDialog.js @@ -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,