Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
StaehliJ committed Oct 10, 2024
1 parent 7ca6b1d commit 8d030b0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,12 @@ import kotlin.test.assertTrue

@RunWith(AndroidJUnit4::class)
class PillarboxPreloadManagerTest {
private var createdPlayersCount = 0
private lateinit var preloadManager: PillarboxPreloadManager

@BeforeTest
fun setUp() {
val context = ApplicationProvider.getApplicationContext<Context>()

createdPlayersCount = 0
preloadManager = PillarboxPreloadManager(
context = context,
playerFactory = { playbackLooper ->
createdPlayersCount++

PillarboxExoPlayer(
context = context,
playbackLooper = playbackLooper,
)
},
)
preloadManager = PillarboxPreloadManager(context = context)
}

@AfterTest
Expand All @@ -51,9 +38,6 @@ class PillarboxPreloadManagerTest {
assertEquals(C.INDEX_UNSET, preloadManager.currentPlayingIndex)
assertEquals(0, preloadManager.sourceCount)
assertNull(preloadManager.getMediaSource(VOD1))
assertNotNull(preloadManager.getPlayer(0))
assertNull(preloadManager.getCurrentlyPlayingPlayer())
assertEquals(1, createdPlayersCount)
}

@Test
Expand All @@ -72,8 +56,6 @@ class PillarboxPreloadManagerTest {
assertNotNull(preloadManager.getMediaSource(VOD3))
assertNotNull(preloadManager.getMediaSource(VOD4))
assertNull(preloadManager.getMediaSource(VOD5))
assertEquals(preloadManager.getPlayer(2), preloadManager.getCurrentlyPlayingPlayer())
assertEquals(1, createdPlayersCount)

assertTrue(preloadManager.remove(VOD2))
assertTrue(preloadManager.remove(VOD3))
Expand All @@ -86,8 +68,6 @@ class PillarboxPreloadManagerTest {
assertNull(preloadManager.getMediaSource(VOD3))
assertNotNull(preloadManager.getMediaSource(VOD4))
assertNull(preloadManager.getMediaSource(VOD5))
assertEquals(preloadManager.getPlayer(2), preloadManager.getCurrentlyPlayingPlayer())
assertEquals(1, createdPlayersCount)

preloadManager.reset()
preloadManager.invalidate()
Expand All @@ -99,8 +79,6 @@ class PillarboxPreloadManagerTest {
assertNull(preloadManager.getMediaSource(VOD3))
assertNull(preloadManager.getMediaSource(VOD4))
assertNull(preloadManager.getMediaSource(VOD5))
assertEquals(preloadManager.getPlayer(2), preloadManager.getCurrentlyPlayingPlayer())
assertEquals(1, createdPlayersCount)
}

private companion object {
Expand Down

This file was deleted.

0 comments on commit 8d030b0

Please sign in to comment.