You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This method is useful for cases where the target condition can
become true outside of a message on the main thread. To ensure we
don't execute the rest of the test method in parallel with other
code, we have to introduce artifical messages on the main thread
that check the target condition.
PiperOrigin-RevId: 628072444
Copy file name to clipboardexpand all lines: libraries/test_utils_robolectric/src/main/java/androidx/media3/test/utils/robolectric/RobolectricUtil.java
+24
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,12 @@ public long elapsedRealtime() {
63
63
*
64
64
* <p>Must be called on the main test thread.
65
65
*
66
+
* <p>Note for {@link androidx.media3.test.utils.FakeClock} users: If the condition changes
67
+
* outside of a main {@link Looper} message, for example because it's checking a volatile variable
68
+
* or shared synchronized state that is updated on a background thread, or because checking the
69
+
* condition itself may cause it to become true, then the remainder of the test method may be
70
+
* executed in parallel with other background thread messages.
71
+
*
66
72
* @param condition The condition.
67
73
* @throws TimeoutException If the {@link #DEFAULT_TIMEOUT_MS} is exceeded.
Copy file name to clipboardexpand all lines: libraries/test_utils_robolectric/src/main/java/androidx/media3/test/utils/robolectric/TestPlayerRunHelper.java
0 commit comments