Add Android alert effect playback
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
package se.ajpanton.notificationsmaster.alerts
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import java.util.concurrent.CountDownLatch
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
class AndroidAlertEffectPlayerTest {
|
||||
@Test
|
||||
fun vibrationCompletesWithoutLeakingPlayback() {
|
||||
val completion = CountDownLatch(1)
|
||||
val player = AndroidAlertEffectPlayer(InstrumentationRegistry.getInstrumentation().targetContext)
|
||||
|
||||
player.play(
|
||||
QueuedAlert("test", AlertSnapshot(null, listOf(0, 10), false, false)),
|
||||
completion::countDown,
|
||||
)
|
||||
|
||||
assertTrue(completion.await(2, TimeUnit.SECONDS))
|
||||
player.stop()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user