Commit 654fcd5
Only drain main looper when it is paused.
ControlledLooper.drainMainThreadUntilIdle was created
so Robolectric can manually execute tasks when main looper is paused.
Now with the introduction of INSTRUMENTATION_TEST looper mode with a
free running looper, it doesn't make sense to always idle the main looper,
and could lead to deviation of behavior between a test run with Robolectric
INSTRUMENTATION_TEST mode and real android.
This commit changes drainMainThreadUntilIdle so its a no-op if main looper
is not paused.
PiperOrigin-RevId: 7036344851 parent f5ff2c3 commit 654fcd5
File tree
2 files changed
+9
-0
lines changed- espresso
- core/java/androidx/test/espresso/base
2 files changed
+9
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
45 | 51 | | |
46 | 52 | | |
47 | 53 | | |
| |||
85 | 91 | | |
86 | 92 | | |
87 | 93 | | |
| 94 | + | |
88 | 95 | | |
89 | 96 | | |
90 | 97 | | |
| |||
0 commit comments