Closed Bug 1073052 Opened 7 years ago Closed 7 years ago

ThreadUtils relies on activity to initialize UI thread/handler

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 35

People

(Reporter: bnicholson, Assigned: bnicholson)

Details

Attachments

(1 file)

Running the TestSuggestedSites test in Eclipse, I get a NPE here: http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/util/ThreadUtils.java?rev=986e8a9f6195#159.

Our tests use the Distribution class, which calls ThreadUtils.assertNotOnUiThread(). We call setUiThread in GeckoApp/GeckoView, which won't be created for JUnit tests. The UI thread and handler are already accessible from the main looper, so we can just get them directly instead of using a setter.
Comment on attachment 8495371 [details] [diff] [review]
Use main looper to initialize UI thread and handler

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

Seems sane to me.
Attachment #8495371 - Flags: review?(rnewman) → review+
https://hg.mozilla.org/mozilla-central/rev/4dc618879371
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 35
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.