use of de.danoeh.antennapod.core.service.playback.PlaybackServiceTaskManager in project AntennaPod by AntennaPod.
the class PlaybackServiceTaskManagerTest method testGetQueueWriteBeforeCreation.
public void testGetQueueWriteBeforeCreation() throws InterruptedException {
final Context c = getInstrumentation().getTargetContext();
List<FeedItem> queue = writeTestQueue("a");
assertNotNull(queue);
PlaybackServiceTaskManager pstm = new PlaybackServiceTaskManager(c, defaultPSTM);
List<FeedItem> testQueue = pstm.getQueue();
assertNotNull(testQueue);
assertTrue(queue.size() == testQueue.size());
for (int i = 0; i < queue.size(); i++) {
assertTrue(queue.get(i).getId() == testQueue.get(i).getId());
}
pstm.shutdown();
}
use of de.danoeh.antennapod.core.service.playback.PlaybackServiceTaskManager in project AntennaPod by AntennaPod.
the class PlaybackServiceTaskManagerTest method testCancelWidgetUpdater.
@Test
public void testCancelWidgetUpdater() {
final Context c = InstrumentationRegistry.getInstrumentation().getTargetContext();
PlaybackServiceTaskManager pstm = new PlaybackServiceTaskManager(c, defaultPSTM);
pstm.startWidgetUpdater();
pstm.cancelWidgetUpdater();
assertFalse(pstm.isWidgetUpdaterActive());
pstm.shutdown();
}
use of de.danoeh.antennapod.core.service.playback.PlaybackServiceTaskManager in project AntennaPod by AntennaPod.
the class PlaybackServiceTaskManagerTest method testInit.
@Test
public void testInit() {
Context context = InstrumentationRegistry.getInstrumentation().getTargetContext();
PlaybackServiceTaskManager pstm = new PlaybackServiceTaskManager(context, defaultPSTM);
pstm.shutdown();
}
use of de.danoeh.antennapod.core.service.playback.PlaybackServiceTaskManager in project AntennaPod by AntennaPod.
the class PlaybackServiceTaskManagerTest method testCancelAllTasksAllTasksStarted.
@Test
@UiThreadTest
public void testCancelAllTasksAllTasksStarted() {
final Context c = InstrumentationRegistry.getInstrumentation().getTargetContext();
PlaybackServiceTaskManager pstm = new PlaybackServiceTaskManager(c, defaultPSTM);
pstm.startWidgetUpdater();
pstm.startPositionSaver();
pstm.setSleepTimer(100000);
pstm.cancelAllTasks();
assertFalse(pstm.isPositionSaverActive());
assertFalse(pstm.isWidgetUpdaterActive());
assertFalse(pstm.isSleepTimerActive());
pstm.shutdown();
}
use of de.danoeh.antennapod.core.service.playback.PlaybackServiceTaskManager in project AntennaPod by AntennaPod.
the class PlaybackServiceTaskManagerTest method testIsWidgetUpdaterActive.
@Test
public void testIsWidgetUpdaterActive() {
final Context c = InstrumentationRegistry.getInstrumentation().getTargetContext();
PlaybackServiceTaskManager pstm = new PlaybackServiceTaskManager(c, defaultPSTM);
pstm.startWidgetUpdater();
assertTrue(pstm.isWidgetUpdaterActive());
pstm.shutdown();
}
Aggregations