diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2021-11-28 22:19:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-28 22:19:14 +0100 |
commit | f0100e61ac633516082ea112363132c99f7c0b7a (patch) | |
tree | f7598c0cee85780b409ab895a8041d1607eec312 /app/src/androidTest | |
parent | af2835c59dcb0473aba7a48b38f5abe28dca34d3 (diff) | |
download | AntennaPod-f0100e61ac633516082ea112363132c99f7c0b7a.zip |
Chromecast rework (#5518)
Diffstat (limited to 'app/src/androidTest')
4 files changed, 59 insertions, 44 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/playback/PlaybackTest.java b/app/src/androidTest/java/de/test/antennapod/playback/PlaybackTest.java index 9f7af3a16..2ab2361d7 100644 --- a/app/src/androidTest/java/de/test/antennapod/playback/PlaybackTest.java +++ b/app/src/androidTest/java/de/test/antennapod/playback/PlaybackTest.java @@ -11,6 +11,7 @@ import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.rule.ActivityTestRule; import de.danoeh.antennapod.model.feed.FeedItemFilter; +import de.danoeh.antennapod.playback.base.PlayerStatus; import org.awaitility.Awaitility; import org.hamcrest.Matcher; import org.junit.After; @@ -32,7 +33,6 @@ import de.danoeh.antennapod.model.feed.FeedMedia; import de.danoeh.antennapod.core.preferences.PlaybackPreferences; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.service.playback.PlaybackService; -import de.danoeh.antennapod.core.service.playback.PlayerStatus; import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.DBWriter; import de.danoeh.antennapod.core.util.IntentUtils; diff --git a/app/src/androidTest/java/de/test/antennapod/service/playback/CancelablePSMPCallback.java b/app/src/androidTest/java/de/test/antennapod/service/playback/CancelablePSMPCallback.java index 2c164f131..4d57b9b43 100644 --- a/app/src/androidTest/java/de/test/antennapod/service/playback/CancelablePSMPCallback.java +++ b/app/src/androidTest/java/de/test/antennapod/service/playback/CancelablePSMPCallback.java @@ -1,9 +1,10 @@ package de.test.antennapod.service.playback; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import de.danoeh.antennapod.model.playback.MediaType; -import de.danoeh.antennapod.core.service.playback.PlaybackServiceMediaPlayer; import de.danoeh.antennapod.model.playback.Playable; +import de.danoeh.antennapod.playback.base.PlaybackServiceMediaPlayer; public class CancelablePSMPCallback implements PlaybackServiceMediaPlayer.PSMPCallback { @@ -43,14 +44,6 @@ public class CancelablePSMPCallback implements PlaybackServiceMediaPlayer.PSMPCa } @Override - public boolean onMediaPlayerInfo(int code, int resourceId) { - if (isCancelled) { - return true; - } - return originalCallback.onMediaPlayerInfo(code, resourceId); - } - - @Override public void onPostPlayback(@NonNull Playable media, boolean ended, boolean skipped, boolean playingNext) { if (isCancelled) { return; @@ -82,6 +75,15 @@ public class CancelablePSMPCallback implements PlaybackServiceMediaPlayer.PSMPCa return originalCallback.getNextInQueue(currentMedia); } + @Nullable + @Override + public Playable findMedia(@NonNull String url) { + if (isCancelled) { + return null; + } + return originalCallback.findMedia(url); + } + @Override public void onPlaybackEnded(MediaType mediaType, boolean stopPlaying) { if (isCancelled) { @@ -89,4 +91,12 @@ public class CancelablePSMPCallback implements PlaybackServiceMediaPlayer.PSMPCa } originalCallback.onPlaybackEnded(mediaType, stopPlaying); } + + @Override + public void ensureMediaInfoLoaded(@NonNull Playable media) { + if (isCancelled) { + return; + } + originalCallback.ensureMediaInfoLoaded(media); + } }
\ No newline at end of file diff --git a/app/src/androidTest/java/de/test/antennapod/service/playback/DefaultPSMPCallback.java b/app/src/androidTest/java/de/test/antennapod/service/playback/DefaultPSMPCallback.java index 090a94d6e..fb55c7ad0 100644 --- a/app/src/androidTest/java/de/test/antennapod/service/playback/DefaultPSMPCallback.java +++ b/app/src/androidTest/java/de/test/antennapod/service/playback/DefaultPSMPCallback.java @@ -1,54 +1,59 @@ package de.test.antennapod.service.playback; import androidx.annotation.NonNull; -import androidx.annotation.StringRes; +import androidx.annotation.Nullable; import de.danoeh.antennapod.model.playback.MediaType; -import de.danoeh.antennapod.core.service.playback.PlaybackServiceMediaPlayer; import de.danoeh.antennapod.model.playback.Playable; +import de.danoeh.antennapod.playback.base.PlaybackServiceMediaPlayer; public class DefaultPSMPCallback implements PlaybackServiceMediaPlayer.PSMPCallback { - @Override - public void statusChanged(PlaybackServiceMediaPlayer.PSMPInfo newInfo) { + @Override + public void statusChanged(PlaybackServiceMediaPlayer.PSMPInfo newInfo) { - } + } - @Override - public void shouldStop() { + @Override + public void shouldStop() { - } + } - @Override - public void onMediaChanged(boolean reloadUI) { + @Override + public void onMediaChanged(boolean reloadUI) { - } + } - @Override - public boolean onMediaPlayerInfo(int code, @StringRes int resourceId) { - return false; - } + @Override + public void onPostPlayback(@NonNull Playable media, boolean ended, boolean skipped, boolean playingNext) { - @Override - public void onPostPlayback(@NonNull Playable media, boolean ended, boolean skipped, boolean playingNext) { + } - } + @Override + public void onPlaybackStart(@NonNull Playable playable, int position) { - @Override - public void onPlaybackStart(@NonNull Playable playable, int position) { + } - } + @Override + public void onPlaybackPause(Playable playable, int position) { - @Override - public void onPlaybackPause(Playable playable, int position) { + } - } + @Override + public Playable getNextInQueue(Playable currentMedia) { + return null; + } - @Override - public Playable getNextInQueue(Playable currentMedia) { - return null; - } + @Nullable + @Override + public Playable findMedia(@NonNull String url) { + return null; + } - @Override - public void onPlaybackEnded(MediaType mediaType, boolean stopPlaying) { + @Override + public void onPlaybackEnded(MediaType mediaType, boolean stopPlaying) { - } - }
\ No newline at end of file + } + + @Override + public void ensureMediaInfoLoaded(@NonNull Playable media) { + } +}
\ No newline at end of file diff --git a/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java b/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java index 87a5fa65c..32298200e 100644 --- a/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java +++ b/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java @@ -5,6 +5,8 @@ import android.content.Context; import androidx.test.filters.MediumTest; import de.danoeh.antennapod.model.feed.VolumeAdaptionSetting; +import de.danoeh.antennapod.playback.base.PlaybackServiceMediaPlayer; +import de.danoeh.antennapod.playback.base.PlayerStatus; import de.test.antennapod.EspressoTestUtils; import junit.framework.AssertionFailedError; @@ -24,8 +26,6 @@ import de.danoeh.antennapod.model.feed.FeedItem; import de.danoeh.antennapod.model.feed.FeedMedia; import de.danoeh.antennapod.model.feed.FeedPreferences; import de.danoeh.antennapod.core.service.playback.LocalPSMP; -import de.danoeh.antennapod.core.service.playback.PlaybackServiceMediaPlayer; -import de.danoeh.antennapod.core.service.playback.PlayerStatus; import de.danoeh.antennapod.core.storage.PodDBAdapter; import de.danoeh.antennapod.model.playback.Playable; import de.test.antennapod.util.service.download.HTTPBin; |