summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorTacoTheDank <SkytkRSfan3895@gmail.com>2022-05-15 15:02:21 -0400
committerTacoTheDank <SkytkRSfan3895@gmail.com>2022-05-15 15:02:21 -0400
commit0e96df3cba68e604ebc608fc016e43bb7ab2529a (patch)
tree3f5092d05afc3f845deec785a29702e6d088944f /app
parent0fbc6992a1947436943e46bbe021311f41290bec (diff)
downloadAntennaPod-0e96df3cba68e604ebc608fc016e43bb7ab2529a.zip
Move test mp3s to androidTest directory
Diffstat (limited to 'app')
-rw-r--r--app/src/androidTest/assets/30sec.mp3 (renamed from app/src/main/assets/30sec.mp3)bin120017 -> 120017 bytes
-rw-r--r--app/src/androidTest/assets/3sec.mp3 (renamed from app/src/main/assets/3sec.mp3)bin49043 -> 49043 bytes
-rw-r--r--app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java2
-rw-r--r--app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java6
4 files changed, 6 insertions, 2 deletions
diff --git a/app/src/main/assets/30sec.mp3 b/app/src/androidTest/assets/30sec.mp3
index 48e398434..48e398434 100644
--- a/app/src/main/assets/30sec.mp3
+++ b/app/src/androidTest/assets/30sec.mp3
Binary files differ
diff --git a/app/src/main/assets/3sec.mp3 b/app/src/androidTest/assets/3sec.mp3
index 8ae450d01..8ae450d01 100644
--- a/app/src/main/assets/3sec.mp3
+++ b/app/src/androidTest/assets/3sec.mp3
Binary files differ
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 e115bc34e..aa2f1cf98 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
@@ -85,7 +85,7 @@ public class PlaybackServiceMediaPlayerTest {
assertTrue(cacheDir.canWrite());
assertTrue(cacheDir.canRead());
if (!dest.exists()) {
- InputStream i = getInstrumentation().getTargetContext().getAssets().open("3sec.mp3");
+ InputStream i = getInstrumentation().getContext().getAssets().open("3sec.mp3");
OutputStream o = new FileOutputStream(new File(cacheDir, PLAYABLE_DEST_URL));
IOUtils.copy(i, o);
o.flush();
diff --git a/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java b/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java
index 834c7d48b..44a11d9cf 100644
--- a/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java
+++ b/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java
@@ -2,6 +2,9 @@ package de.test.antennapod.ui;
import android.content.Context;
import android.util.Log;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+
import de.danoeh.antennapod.event.FeedListUpdateEvent;
import de.danoeh.antennapod.event.QueueEvent;
import de.danoeh.antennapod.model.feed.Feed;
@@ -99,7 +102,8 @@ public class UITestUtils {
}
Assert.assertFalse(mediaFile.exists());
- InputStream in = context.getAssets().open(testFileName);
+ InputStream in = InstrumentationRegistry.getInstrumentation().getContext()
+ .getAssets().open(testFileName);
Assert.assertNotNull(in);
FileOutputStream out = new FileOutputStream(mediaFile);