Closed Bug 2008555 Opened 20 days ago Closed 13 days ago

Refactor ShareResourceFeatureTest to remove MainCoroutineRule and runTestOnMain

Categories

(Firefox for Android :: Tooling, task)

All
Android
task

Tracking

()

RESOLVED FIXED
Tracking Status
firefox149 --- fixed

People

(Reporter: mcarare, Assigned: mcarare)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxdroid][group6] )

Attachments

(1 file)

.

  • Modify ShareResourceFeature constructor to accept a mainDispatcher (defaults to Dispatchers.Main) for store observation.
  • Update ShareResourceFeatureTest.kt to use StandardTestDispatcher and runTest instead of MainCoroutineRule and runTestOnMain.
  • Improve test synchronization by adding testDispatcher.scheduler.advanceUntilIdle() calls where asynchronous actions occur.
  • Fix a missing mock in startSharing() test by stubbing shareInternetResource.
  • Explicitly pass dispatchers during ShareResourceFeature instantiation in tests to ensure deterministic execution.
Pushed by mcarare@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/68a801f12c88 https://hg.mozilla.org/integration/autoland/rev/2cc5a37ab8e2 Update `ShareResourceFeature` to allow custom dispatchers for store observation and improve unit test reliability r=android-reviewers,avirvara
Status: ASSIGNED → RESOLVED
Closed: 13 days ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: