Closed
Bug 715444
Opened 12 years ago
Closed 12 years ago
Robotium tests sometimes miss DOMContentLoaded and hang forever
Categories
(Testing :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla12
People
(Reporter: kats, Assigned: kats)
References
Details
(Whiteboard: not-fennec-11)
Attachments
(1 file)
11.53 KB,
patch
|
jmaher
:
review+
|
Details | Diff | Splinter Review |
If the page loads fast enough, it is possible for the DOMContentLoaded to be fired between calling click() on the awesome screen and calling waitForGeckoEvent. In this scenario, the listener is registered after the event fires, and then robotium blocks forever waiting for the event. Attached patch fixes the problem.
Attachment #586000 -
Flags: review?(jmaher)
Comment 1•12 years ago
|
||
Comment on attachment 586000 [details] [diff] [review] Add the EventExpecter to prevent missing events Review of attachment 586000 [details] [diff] [review]: ----------------------------------------------------------------- ::: build/mobile/robocop/FennecNativeActions.java.in @@ +167,5 @@ > + } > + > + void notifyOfEvent() { > + try { > + unregisterGEL.invoke(null, mRegistrationParams); is notifyOfEvent() always called? I just want to make sure we are always unregisterGEL() when we have a registerGEL() call prior.
Attachment #586000 -
Flags: review?(jmaher) → review+
Assignee | ||
Comment 2•12 years ago
|
||
If we receive the event, then yes, notifyOfEvent should always be called. If we don't receive the event then this blocks forever, same as the old version.
Assignee | ||
Comment 3•12 years ago
|
||
Actually, to clarify: "this blocks forever" refers to the code that would call blockForEvent(). If there's a test that just polls using eventReceived(), and the event never arrives, then we won't unregister. If that's an issue I can stick unregistration code in the finalize() method as well.
Comment 4•12 years ago
|
||
inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/aae720a32088
Comment 5•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/aae720a32088
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla12
Assignee | ||
Updated•12 years ago
|
Whiteboard: not-fennec-11
You need to log in
before you can comment on or make changes to this bug.
Description
•