Commit 93e203f9 by ibaker Committed by Oliver Woodman

Tweak the assertions in MediaSourceTestRunner to give clearer failures

PiperOrigin-RevId: 300519989
parent 16e6ea6e
...@@ -215,7 +215,7 @@ public class MediaSourceTestRunner { ...@@ -215,7 +215,7 @@ public class MediaSourceTestRunner {
* runner was created if neither method has been called). * runner was created if neither method has been called).
*/ */
public void assertNoTimelineChange() { public void assertNoTimelineChange() {
assertThat(timelines.isEmpty()).isTrue(); assertThat(timelines).isEmpty();
} }
/** /**
...@@ -304,8 +304,10 @@ public class MediaSourceTestRunner { ...@@ -304,8 +304,10 @@ public class MediaSourceTestRunner {
List<Integer> expectedWindowIndices = new ArrayList<>(Arrays.asList(windowIndices)); List<Integer> expectedWindowIndices = new ArrayList<>(Arrays.asList(windowIndices));
for (Pair<Integer, MediaPeriodId> windowIndexAndMediaPeriodId : completedLoads) { for (Pair<Integer, MediaPeriodId> windowIndexAndMediaPeriodId : completedLoads) {
if (windowIndexAndMediaPeriodId.second == null) { if (windowIndexAndMediaPeriodId.second == null) {
boolean loadExpected = expectedWindowIndices.remove(windowIndexAndMediaPeriodId.first); assertWithMessage("Missing expected load")
assertThat(loadExpected).isTrue(); .that(expectedWindowIndices)
.contains(windowIndexAndMediaPeriodId.first);
expectedWindowIndices.remove(windowIndexAndMediaPeriodId.first);
} }
} }
assertWithMessage("Not all expected media source loads have been completed.") assertWithMessage("Not all expected media source loads have been completed.")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment