Bug 1499474 - Check if the element has textContent before falling back to TestUtils.waitForCondition. r=MattN
authorJared Wein <jwein@mozilla.com>
Tue, 16 Oct 2018 20:04:38 +0000
changeset 499978 4c98e1b28c388eed1ce835038f570cc0169ef389
parent 499977 af0263577e4d16da5c44df23ef5a44685c07a4d0
child 499979 de6fb9a3d7a5dcf98798c833994c68f2ac83526c
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1499474
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
browser/extensions/formautofill/test/browser/browser_editAddressDialog.js
--- a/browser/extensions/formautofill/test/browser/browser_editAddressDialog.js
+++ b/browser/extensions/formautofill/test/browser/browser_editAddressDialog.js
@@ -319,18 +319,21 @@ add_task(async function test_countryFiel
         delete labelEl.dataset.localization;
       }
 
       info(`Selecting '${countryOption.label}' (${countryOption.value})`);
       EventUtils.synthesizeKey(countryOption.label, {}, win);
 
       // 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,
            "Ensure data-localization was removed: " + countryOption.value);
       }
     }
 
     doc.querySelector("#cancel").click();