test(mediacontrol): Name handler registration test after what it asserts

The test claimed to guard against a main-looper binding, but the
assertion only checks that the injected handler instance is forwarded.
Rename it and document that the Looper identity is covered by the
AndroidModule provider and the runtime thread-name QA check instead.

Fixes review finding F1
This commit is contained in:
darken
2026-07-28 19:07:54 +02:00
committed by Matthias Urhahn
parent a95377cf7b
commit c9a5db1ac8
@@ -242,9 +242,14 @@ class MediaControlTest : BaseTest() {
}
@Test
fun `playback callback is registered on the injected background handler, not the main looper`() {
fun `playback callback is registered with the injected handler rather than null`() {
// Regression for the ANR cluster in onPlaybackConfigChanged: passing `null` here binds
// callback delivery to the main looper, and the callback body does a binder call.
// Scope of this assertion: it only proves the injected handler is forwarded, not which
// Looper that handler is bound to — a JVM unit test cannot inspect a Looper here (this
// module does not use Robolectric). The Looper identity is covered instead by
// `AndroidModule.audioCallbackHandler()`, which is the single place that constructs it,
// and by the runtime QA check asserting the registration logs thread `CAPod-MediaControl`.
verify { audioManager.registerAudioPlaybackCallback(any(), handler) }
}