From 771b1e2a16545cc6a8bca433be6089e93a649359 Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Sun, 9 Aug 2015 11:42:43 +0200 Subject: Vibrate and lower volume when timer is about to expire, shake to reset timer --- .../playback/PlaybackServiceTaskManagerTest.java | 60 ++++++++++++++++++++-- 1 file changed, 55 insertions(+), 5 deletions(-) (limited to 'app/src/androidTest') 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 edb576249..385201f25 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 @@ -121,11 +121,21 @@ public class PlaybackServiceTaskManagerTest extends InstrumentationTestCase { countDownLatch.countDown(); } + @Override + public void onSleepTimerAlmostExpired() { + + } + @Override public void onSleepTimerExpired() { } + @Override + public void onSleepTimerReset() { + + } + @Override public void onWidgetUpdaterTick() { @@ -169,11 +179,21 @@ public class PlaybackServiceTaskManagerTest extends InstrumentationTestCase { } + @Override + public void onSleepTimerAlmostExpired() { + + } + @Override public void onSleepTimerExpired() { } + @Override + public void onSleepTimerReset() { + + } + @Override public void onWidgetUpdaterTick() { countDownLatch.countDown(); @@ -221,7 +241,7 @@ public class PlaybackServiceTaskManagerTest extends InstrumentationTestCase { PlaybackServiceTaskManager pstm = new PlaybackServiceTaskManager(c, defaultPSTM); pstm.startWidgetUpdater(); pstm.startPositionSaver(); - pstm.setSleepTimer(100000); + pstm.setSleepTimer(100000, false, false); pstm.cancelAllTasks(); assertFalse(pstm.isPositionSaverActive()); assertFalse(pstm.isWidgetUpdaterActive()); @@ -240,6 +260,11 @@ public class PlaybackServiceTaskManagerTest extends InstrumentationTestCase { } + @Override + public void onSleepTimerAlmostExpired() { + + } + @Override public void onSleepTimerExpired() { if (countDownLatch.getCount() == 0) { @@ -248,6 +273,11 @@ public class PlaybackServiceTaskManagerTest extends InstrumentationTestCase { countDownLatch.countDown(); } + @Override + public void onSleepTimerReset() { + + } + @Override public void onWidgetUpdaterTick() { @@ -258,7 +288,7 @@ public class PlaybackServiceTaskManagerTest extends InstrumentationTestCase { } }); - pstm.setSleepTimer(TIME); + pstm.setSleepTimer(TIME, false, false); countDownLatch.await(TIMEOUT, TimeUnit.MILLISECONDS); pstm.shutdown(); } @@ -274,11 +304,21 @@ public class PlaybackServiceTaskManagerTest extends InstrumentationTestCase { } + @Override + public void onSleepTimerAlmostExpired() { + + } + @Override public void onSleepTimerExpired() { fail("Sleeptimer expired"); } + @Override + public void onSleepTimerReset() { + + } + @Override public void onWidgetUpdaterTick() { @@ -289,7 +329,7 @@ public class PlaybackServiceTaskManagerTest extends InstrumentationTestCase { } }); - pstm.setSleepTimer(TIME); + pstm.setSleepTimer(TIME, false, false); pstm.disableSleepTimer(); assertFalse(countDownLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)); pstm.shutdown(); @@ -298,7 +338,7 @@ public class PlaybackServiceTaskManagerTest extends InstrumentationTestCase { public void testIsSleepTimerActivePositive() { final Context c = getInstrumentation().getTargetContext(); PlaybackServiceTaskManager pstm = new PlaybackServiceTaskManager(c, defaultPSTM); - pstm.setSleepTimer(10000); + pstm.setSleepTimer(10000, false, false); assertTrue(pstm.isSleepTimerActive()); pstm.shutdown(); } @@ -306,7 +346,7 @@ public class PlaybackServiceTaskManagerTest extends InstrumentationTestCase { public void testIsSleepTimerActiveNegative() { final Context c = getInstrumentation().getTargetContext(); PlaybackServiceTaskManager pstm = new PlaybackServiceTaskManager(c, defaultPSTM); - pstm.setSleepTimer(10000); + pstm.setSleepTimer(10000, false, false); pstm.disableSleepTimer(); assertFalse(pstm.isSleepTimerActive()); pstm.shutdown(); @@ -318,11 +358,21 @@ public class PlaybackServiceTaskManagerTest extends InstrumentationTestCase { } + @Override + public void onSleepTimerAlmostExpired() { + + } + @Override public void onSleepTimerExpired() { } + @Override + public void onSleepTimerReset() { + + } + @Override public void onWidgetUpdaterTick() { -- cgit v1.2.3