Added test for shutdown/widget updater race in PSTM

This commit is contained in:
Joe Stein 2019-05-21 18:35:03 -04:00
parent c98a7c0c38
commit 4f3fa6246e
1 changed files with 9 additions and 0 deletions

View File

@ -228,6 +228,15 @@ public class PlaybackServiceTaskManagerTest {
pstm.shutdown(); pstm.shutdown();
} }
@Test
public void testStartWidgetUpdaterAfterShutdown() {
// Should not throw.
final Context c = InstrumentationRegistry.getInstrumentation().getTargetContext();
PlaybackServiceTaskManager pstm = new PlaybackServiceTaskManager(c, defaultPSTM);
pstm.shutdown();
pstm.startWidgetUpdater();
}
@Test @Test
public void testIsWidgetUpdaterActive() { public void testIsWidgetUpdaterActive() {
final Context c = InstrumentationRegistry.getInstrumentation().getTargetContext(); final Context c = InstrumentationRegistry.getInstrumentation().getTargetContext();