Skip to content

Commit

Permalink
fix(player): remove non applicable tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultBee committed Jun 6, 2024
1 parent 9082a21 commit 5ccfec3
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,68 +77,6 @@ class ApiVideoPlayerControllerTest {
every { anyConstructed<DefaultMediaSourceFactory>().createMediaSource(any()) } returns mediaSource
}

@Test
fun `get a valid player json`() {
mockHttpStack.setResponseToReturn(
HttpResponse(
200,
emptyList(),
Resources.readFile("/assets/valid_player.json").toByteArray()
)
)

val lock = CountDownLatch(1)

val listener = object : ApiVideoPlayerController.Listener {
override fun onError(error: Exception) {
error.printStackTrace()
println(error.message)
lock.countDown()
}
}

ApiVideoPlayerController(
context,
VideoOptions("test", VideoType.VOD),
false,
listener,
playerView,
notificationController = null
)
lock.await(1, java.util.concurrent.TimeUnit.SECONDS)

assertEquals(1, lock.count) // OnError not called
}

@Test
fun `get an exception on player json connection`() {
mockHttpStack.setExceptionToThrow(IOException())

val lock = CountDownLatch(1)

val listener = object : ApiVideoPlayerController.Listener {
override fun onError(error: Exception) {
lock.countDown()
}
}

ApiVideoPlayerController(
context,
VideoOptions(
"test",
VideoType.VOD,
"token"
), // The endpoint is only called when a token is provided
false,
listener,
playerView,
notificationController = null
)
lock.await(1, java.util.concurrent.TimeUnit.SECONDS)

assertEquals(0, lock.count)
}

@Test
fun `play test`() {
val player =
Expand Down
15 changes: 0 additions & 15 deletions player/src/test/resources/assets/player_with_unknown_key.json

This file was deleted.

14 changes: 0 additions & 14 deletions player/src/test/resources/assets/valid_player.json

This file was deleted.

0 comments on commit 5ccfec3

Please sign in to comment.