Closed Bug 917833 Opened 13 years ago Closed 13 years ago

When loading a page at startup, Robocop test methods aren't called until Gecko is initialized

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: bnicholson, Unassigned)

Details

Working on bug 874985, I ran into an issue where testSessionOOMRestore() was always called *after* Gecko was already initialized -- normally, tests wait for Gecko:Ready. This test is unusual in that it directly opens a URL at startup instead of about:home. My assumption is that there is some lock held by the SurfaceView, preventing any code in the test harness from running. I worked around this issue in bug 874985 by simply omitting the Gecko:Ready event expecter; however, this is fragile since changing the test to load about:home at startup instead of an external URL will cause things to break.
BaseTest.blockForGeckoReady() is supposed to handle being called after Gecko:Ready. It does this by checking the launch state in GeckoThread. So if you use that you should be fine. Are there other tests that register an expecter directly instead of calling blockForGeckoReady()? Because if they do then they potentially have a race and should be fixed.
For this particular test, we actually need to wait for Session:Restored since Gecko:Ready may be too early, so that's why I was using code that called the event expecter directly. Since there are no guarantees about when the test will run as you pointed out, we'll probably need to create some boolean specifically for this test that tracks whether the message has been received.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.