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