Tweak the assertions in MediaSourceTestRunner to give clearer failures
PiperOrigin-RevId: 300519989
This commit is contained in:
parent
16e6ea6e40
commit
93e203f970
@ -215,7 +215,7 @@ public class MediaSourceTestRunner {
|
||||
* runner was created if neither method has been called).
|
||||
*/
|
||||
public void assertNoTimelineChange() {
|
||||
assertThat(timelines.isEmpty()).isTrue();
|
||||
assertThat(timelines).isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -304,8 +304,10 @@ public class MediaSourceTestRunner {
|
||||
List<Integer> expectedWindowIndices = new ArrayList<>(Arrays.asList(windowIndices));
|
||||
for (Pair<Integer, MediaPeriodId> windowIndexAndMediaPeriodId : completedLoads) {
|
||||
if (windowIndexAndMediaPeriodId.second == null) {
|
||||
boolean loadExpected = expectedWindowIndices.remove(windowIndexAndMediaPeriodId.first);
|
||||
assertThat(loadExpected).isTrue();
|
||||
assertWithMessage("Missing expected load")
|
||||
.that(expectedWindowIndices)
|
||||
.contains(windowIndexAndMediaPeriodId.first);
|
||||
expectedWindowIndices.remove(windowIndexAndMediaPeriodId.first);
|
||||
}
|
||||
}
|
||||
assertWithMessage("Not all expected media source loads have been completed.")
|
||||
|
Loading…
x
Reference in New Issue
Block a user