mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-14 18:26:11 -04:00
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:
@@ -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) }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user