mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fix flakiness of MediaBrowserListenerWithMediaBrowserServiceCompatTest
PiperOrigin-RevId: 688870397
This commit is contained in:
parent
6c932722e4
commit
0038dda3c3
1 changed files with 4 additions and 3 deletions
|
|
@ -698,14 +698,15 @@ public class MediaBrowserListenerWithMediaBrowserServiceCompatTest {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ListenableFuture<LibraryResult<Void>> future =
|
LibraryResult<Void> result =
|
||||||
threadTestRule
|
threadTestRule
|
||||||
.getHandler()
|
.getHandler()
|
||||||
.postAndSync(() -> browser.subscribe("parentId", new LibraryParams.Builder().build()));
|
.postAndSync(() -> browser.subscribe("parentId", new LibraryParams.Builder().build()))
|
||||||
|
.get();
|
||||||
// Trigger calling onLoadChildren that is rejected.
|
// Trigger calling onLoadChildren that is rejected.
|
||||||
remoteService.notifyChildrenChanged("parentId");
|
remoteService.notifyChildrenChanged("parentId");
|
||||||
|
|
||||||
assertThat(future.get().resultCode).isEqualTo(RESULT_SUCCESS);
|
assertThat(result.resultCode).isEqualTo(RESULT_SUCCESS);
|
||||||
assertThat(onChildrenChangedLatch.await(TIMEOUT_MS, MILLISECONDS)).isTrue();
|
assertThat(onChildrenChangedLatch.await(TIMEOUT_MS, MILLISECONDS)).isTrue();
|
||||||
assertThat(changedParentIds).containsExactly("parentId", "parentId");
|
assertThat(changedParentIds).containsExactly("parentId", "parentId");
|
||||||
assertThat(changedItemCounts).containsExactly(2, Integer.MAX_VALUE).inOrder();
|
assertThat(changedItemCounts).containsExactly(2, Integer.MAX_VALUE).inOrder();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue