diff options
author | ByteHamster <info@bytehamster.com> | 2020-05-20 10:38:51 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2020-05-20 11:13:07 +0200 |
commit | 2273d60ac47535e632392a77c1a572d800bb8b0d (patch) | |
tree | fefa3ca0910cfd87665d731b1d25633c1b4291fa /app/src/androidTest/java | |
parent | 62fc413f9c626f4e749d2aa9c4e2e0b7225b16cb (diff) | |
download | AntennaPod-2273d60ac47535e632392a77c1a572d800bb8b0d.zip |
Sleep timer adjustments
- Close button instead of OK
- Save settings on-the-fly
Diffstat (limited to 'app/src/androidTest/java')
-rw-r--r-- | app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceTaskManagerTest.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceTaskManagerTest.java b/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceTaskManagerTest.java index dbc86a228..fce78ea4f 100644 --- a/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceTaskManagerTest.java +++ b/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceTaskManagerTest.java @@ -5,6 +5,7 @@ import androidx.test.InstrumentationRegistry; import androidx.test.annotation.UiThreadTest; import androidx.test.filters.LargeTest; +import de.danoeh.antennapod.core.preferences.SleepTimerPreferences; import org.awaitility.Awaitility; import org.greenrobot.eventbus.EventBus; import org.junit.After; @@ -53,6 +54,8 @@ public class PlaybackServiceTaskManagerTest { PodDBAdapter adapter = PodDBAdapter.getInstance(); adapter.open(); adapter.close(); + SleepTimerPreferences.setShakeToReset(false); + SleepTimerPreferences.setVibrate(false); } @Test @@ -304,7 +307,7 @@ public class PlaybackServiceTaskManagerTest { PlaybackServiceTaskManager pstm = new PlaybackServiceTaskManager(c, defaultPSTM); pstm.startWidgetUpdater(); pstm.startPositionSaver(); - pstm.setSleepTimer(100000, false, false); + pstm.setSleepTimer(100000); pstm.cancelAllTasks(); assertFalse(pstm.isPositionSaverActive()); assertFalse(pstm.isWidgetUpdaterActive()); @@ -353,7 +356,7 @@ public class PlaybackServiceTaskManagerTest { } }); - pstm.setSleepTimer(TIME, false, false); + pstm.setSleepTimer(TIME); countDownLatch.await(TIMEOUT, TimeUnit.MILLISECONDS); pstm.shutdown(); } @@ -396,7 +399,7 @@ public class PlaybackServiceTaskManagerTest { } }); - pstm.setSleepTimer(TIME, false, false); + pstm.setSleepTimer(TIME); pstm.disableSleepTimer(); assertFalse(countDownLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)); pstm.shutdown(); @@ -407,7 +410,7 @@ public class PlaybackServiceTaskManagerTest { public void testIsSleepTimerActivePositive() { final Context c = InstrumentationRegistry.getInstrumentation().getTargetContext(); PlaybackServiceTaskManager pstm = new PlaybackServiceTaskManager(c, defaultPSTM); - pstm.setSleepTimer(10000, false, false); + pstm.setSleepTimer(1000); assertTrue(pstm.isSleepTimerActive()); pstm.shutdown(); } @@ -417,7 +420,7 @@ public class PlaybackServiceTaskManagerTest { public void testIsSleepTimerActiveNegative() { final Context c = InstrumentationRegistry.getInstrumentation().getTargetContext(); PlaybackServiceTaskManager pstm = new PlaybackServiceTaskManager(c, defaultPSTM); - pstm.setSleepTimer(10000, false, false); + pstm.setSleepTimer(10000); pstm.disableSleepTimer(); assertFalse(pstm.isSleepTimerActive()); pstm.shutdown(); |