Skip to content

Commit

Permalink
Fix track duration
Browse files Browse the repository at this point in the history
  • Loading branch information
stoyicker committed Jun 25, 2024
1 parent 06882d9 commit ab2102f
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ class PlayLogTest {
// https://github.com/androidx/media/issues/1252
assertThat(get("startAssetPosition").asDouble).isAssetPositionEqualTo(0.0)
// https://github.com/androidx/media/issues/1253
assertThat(get("endAssetPosition").asDouble).isAssetPositionEqualTo(5.065)
assertThat(get("endAssetPosition").asDouble)
.isAssetPositionEqualTo(MEDIA_PRODUCT_DURATION_1_SECONDS)
assertThat(get("actualProductId").asString).isEqualTo(mediaProduct.productId)
assertThat(get("sourceType")?.asString).isEqualTo(mediaProduct.sourceType)
assertThat(get("sourceId")?.asString).isEqualTo(mediaProduct.sourceId)
Expand Down Expand Up @@ -263,7 +264,8 @@ class PlayLogTest {
argThat {
with(gson.fromJson(this, JsonObject::class.java)["payload"].asJsonObject) {
assertThat(get("startAssetPosition").asDouble).isAssetPositionEqualTo(0.0)
assertThat(get("endAssetPosition").asDouble).isAssetPositionEqualTo(5.065)
assertThat(get("endAssetPosition").asDouble)
.isAssetPositionEqualTo(MEDIA_PRODUCT_DURATION_1_SECONDS)
assertThat(get("actualProductId").asString).isEqualTo(mediaProduct.productId)
assertThat(get("sourceType")?.asString).isEqualTo(mediaProduct.sourceType)
assertThat(get("sourceId")?.asString).isEqualTo(mediaProduct.sourceId)
Expand Down Expand Up @@ -375,3 +377,5 @@ class PlayLogTest {
isCloseTo(targetPosition, 0.5)
}
}

private const val MEDIA_PRODUCT_DURATION_1_SECONDS = 5.055

0 comments on commit ab2102f

Please sign in to comment.