ThreadUtils relies on activity to initialize UI thread/handler

RESOLVED FIXED in Firefox 35

Status

()

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: bnicholson, Assigned: bnicholson)

Tracking

Trunk
Firefox 35
All
Android
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
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.
(Assignee)

Comment 1

4 years ago
Created attachment 8495371 [details] [diff] [review]
Use main looper to initialize UI thread and handler
Attachment #8495371 - Flags: review?(rnewman)
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
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 35
You need to log in before you can comment on or make changes to this bug.