Open Bug 564276 Opened 10 years ago Updated 6 years ago

Rename waitForFocus to something better


(Testing :: Mochitest, defect)

Not set


(Not tracked)


(Reporter: ehsan, Unassigned)




(1 file)

waitForFocus is really a misnomer, because the function actually sets focus in addition to waiting for it.  One possible better name suggested by dbaron was focusAndWait.

Once bug 554873 is fixed, waitForFocus also waits for pages to be loaded all the time as well, so maybe focusAndWaitForLoad would be an even better name.
How about EnsureFocus?
Attachment #8389117 - Flags: review?(jmaher)
Comment on attachment 8389117 [details] [diff] [review]

Review of attachment 8389117 [details] [diff] [review]:

this is a great start for the simpletest file, but we have a lot of files that reference it:

Make sure you can run some tests locally after making these changes, then I can push them to our try server to see how it works on all the tests.
Attachment #8389117 - Flags: review?(jmaher) → review-
I will make further changes in the next iteration.
Please confirm that ensureFocus() will be correct name for the function
I like ensureFocus, :ehsan, any issues with it?
Flags: needinfo?(ehsan)
What was wrong with focusAndWaitForLoad suggested in comment 0?  That name seems to reflect exactly what this function does.  ensureFocus doesn't have that property.
Flags: needinfo?(ehsan)
I understand waitForFocus isn't the most representative name for the function, either focusAndWaitForLoad or ensureFocus.  As Ehsan filed this bug, and looking at the feature, his suggestion of focusAndWaitForLoad seems the right way to go.
You need to log in before you can comment on or make changes to this bug.