From 96790453eac1a421381972a61ccd62b69ad35b30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Wed, 18 Sep 2024 08:17:07 +0200 Subject: [PATCH] Fix `IsPlayingAllTypeOfContentTest` compilation --- .../player/IsPlayingAllTypeOfContentTest.kt | 35 +++++++------------ 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/pillarbox-player/src/test/java/ch/srgssr/pillarbox/player/IsPlayingAllTypeOfContentTest.kt b/pillarbox-player/src/test/java/ch/srgssr/pillarbox/player/IsPlayingAllTypeOfContentTest.kt index 5a788f67f..5656efc1b 100644 --- a/pillarbox-player/src/test/java/ch/srgssr/pillarbox/player/IsPlayingAllTypeOfContentTest.kt +++ b/pillarbox-player/src/test/java/ch/srgssr/pillarbox/player/IsPlayingAllTypeOfContentTest.kt @@ -15,6 +15,7 @@ import org.junit.runner.RunWith import org.robolectric.ParameterizedRobolectricTestRunner import org.robolectric.ParameterizedRobolectricTestRunner.Parameters import org.robolectric.Shadows.shadowOf +import kotlin.coroutines.EmptyCoroutineContext import kotlin.test.AfterTest import kotlin.test.BeforeTest import kotlin.test.Test @@ -35,6 +36,7 @@ class IsPlayingAllTypeOfContentTest( type = Default, ) { clock(FakeClock(true)) + coroutineContext(EmptyCoroutineContext) } } @@ -47,7 +49,7 @@ class IsPlayingAllTypeOfContentTest( @Test fun `is playing`() { - player.addMediaItem(MediaItem.fromUri(urlToTest)) + player.setMediaItem(MediaItem.fromUri(urlToTest)) player.prepare() player.play() @@ -60,32 +62,21 @@ class IsPlayingAllTypeOfContentTest( } companion object { - // From urn:swi:video:48940210 - private const val VOD_MP4 = - "https://cdn.prod.swi-services.ch/video-projects/141b30ce-3850-424b-9063-a20d5619d342/localised-videos/ENG/renditions/ENG.mp4" - private const val VOD_HLS = "https://rts-vod-amd.akamaized.net/ww/14970442/da2b38fb-ca9f-3c76-80c6-e6fa7f3c2699/master.m3u8" - private const val AOD_MP3 = "https://srfaudio-a.akamaihd.net/delivery/world/af671f12-6f17-415a-9dd8-b8aee24cce8b.mp3" - private const val VOD_DASH_H264 = "https://storage.googleapis.com/wvmedia/clear/h264/tears/tears.mpd" - private const val VOD_DASH_H265 = "https://storage.googleapis.com/wvmedia/clear/hevc/tears/tears.mpd" - private const val LIVE_HLS = "https://rtsc3video.akamaized.net/hls/live/2042837/c3video/3/playlist.m3u8?dw=0" - private const val LIVE_DVR_HLS = "https://rtsc3video.akamaized.net/hls/live/2042837/c3video/3/playlist.m3u8" - private const val AUDIO_LIVE_MP3 = "https://stream.srg-ssr.ch/m/la-1ere/mp3_128" - private const val AUDIO_LIVE_DVR_HLS = "https://lsaplus.swisstxt.ch/audio/couleur3_96.stream/playlist.m3u8" - @JvmStatic @Suppress("unused") @Parameters(name = "{index}: {0}") fun parameters(): Iterable { return listOf( - VOD_MP4, - VOD_HLS, - AOD_MP3, - VOD_DASH_H264, - VOD_DASH_H265, - LIVE_HLS, - LIVE_DVR_HLS, - AUDIO_LIVE_MP3, - AUDIO_LIVE_DVR_HLS, + // From urn:swi:video:48940210 + "https://cdn.prod.swi-services.ch/video-projects/141b30ce-3850-424b-9063-a20d5619d342/localised-videos/ENG/renditions/ENG.mp4", + "https://rts-vod-amd.akamaized.net/ww/14970442/da2b38fb-ca9f-3c76-80c6-e6fa7f3c2699/master.m3u8", + "https://srfaudio-a.akamaihd.net/delivery/world/af671f12-6f17-415a-9dd8-b8aee24cce8b.mp3", + "https://storage.googleapis.com/wvmedia/clear/h264/tears/tears.mpd", + "https://storage.googleapis.com/wvmedia/clear/hevc/tears/tears.mpd", + "https://rtsc3video.akamaized.net/hls/live/2042837/c3video/3/playlist.m3u8?dw=0", + "https://rtsc3video.akamaized.net/hls/live/2042837/c3video/3/playlist.m3u8", + "https://stream.srg-ssr.ch/m/la-1ere/mp3_128", + "https://lsaplus.swisstxt.ch/audio/couleur3_96.stream/playlist.m3u8", ) } }