From bb3170ecf715555b7fb13dc4a886cfa34fc08ea0 Mon Sep 17 00:00:00 2001 From: Bryce Seager van Dyk Date: Wed, 31 Mar 2021 17:40:51 +0000 Subject: [PATCH] Bug 1702271 - Document waitForCondition msg arg. r=florian DONTBUILD This also makes a couple of other fixes to existing comments to bring them in line with the actual behaviour and names used. Differential Revision: https://phabricator.services.mozilla.com/D110428 --- testing/modules/TestUtils.jsm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/testing/modules/TestUtils.jsm b/testing/modules/TestUtils.jsm index 4b308ed8d95f..5050abb458de 100644 --- a/testing/modules/TestUtils.jsm +++ b/testing/modules/TestUtils.jsm @@ -149,12 +149,17 @@ var TestUtils = { * * @param condition * A condition function that must return true or false. If the - * condition ever throws, this is also treated as a false. The - * function can be an async function. + * condition ever throws, this function fails and rejects the + * returned promise. The function can be an async function. + * @param msg + * A message used to describe the condition being waited for. + * This message will be used to reject the promise should the + * wait fail. It is also used to add a profiler marker in the + * success case. * @param interval * The time interval to poll the condition function. Defaults * to 100ms. - * @param attempts + * @param maxTries * The number of times to poll before giving up and rejecting * if the condition has not yet returned true. Defaults to 50 * (~5 seconds for 100ms intervals)