Closed Bug 1143937 Opened 9 years ago Closed 9 years ago

Make BrowserTestUtils.waitForEvent not use flaky timeouts and cover more use cases

Categories

(Testing :: General, defect)

defect
Not set
normal
Points:
1

Tracking

(firefox39 fixed)

RESOLVED FIXED
mozilla39
Iteration:
39.2 - 23 Mar
Tracking Status
firefox39 --- fixed

People

(Reporter: Paolo, Assigned: Paolo)

References

Details

Attachments

(1 file, 1 obsolete file)

Similar change to bug 1142108, also removing the custom timeout since the test harness should take care of this for us.
Summary: Make TestUtils.waitForEvent not use flaky timeouts and cover more use cases → Make BrowserTestUtils.waitForEvent not use flaky timeouts and cover more use cases
Attached patch The patch (obsolete) — Splinter Review
Assignee: nobody → paolo.mozmail
Status: NEW → ASSIGNED
Attachment #8578342 - Flags: review?(smacleod)
Iteration: --- → 39.2 - 23 Mar
Points: --- → 1
Flags: firefox-backlog+
Comment on attachment 8578342 [details] [diff] [review]
The patch

Review of attachment 8578342 [details] [diff] [review]:
-----------------------------------------------------------------

Overall looks good, just the one problem with checkFn.

::: testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm
@@ +115,5 @@
> +            if (checkFn && !checkFn(event)) {
> +              return;
> +            }
> +          } finally {
> +            subject.removeEventListener(eventName, listener);

This will run even when the "return;" is hit, so if "checkFn" gives false we'll remove the listener and never hit the event.
Attachment #8578342 - Flags: review?(smacleod) → review-
Attached patch Updated patchSplinter Review
It seems I made the same mistake in TestUtils.topicObserved.
Attachment #8578342 - Attachment is obsolete: true
Attachment #8579597 - Flags: review?(smacleod)
Comment on attachment 8579597 [details] [diff] [review]
Updated patch

Review of attachment 8579597 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM
Attachment #8579597 - Flags: review?(smacleod) → review+
https://hg.mozilla.org/mozilla-central/rev/9d01ed5c9fc5
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: