Merge "StreamingMediaPlayerTest: Moved assets to external storage" am: e400fa1ad1
Original change: https://android-review.googlesource.com/c/platform/cts/+/1433974
Change-Id: I45c901a101965b21e4bcf2493cca73f91744f4dc
diff --git a/tests/tests/media/src/android/media/cts/StreamingMediaPlayerTest.java b/tests/tests/media/src/android/media/cts/StreamingMediaPlayerTest.java
index 56fe9c5..fba0dee 100644
--- a/tests/tests/media/src/android/media/cts/StreamingMediaPlayerTest.java
+++ b/tests/tests/media/src/android/media/cts/StreamingMediaPlayerTest.java
@@ -53,6 +53,7 @@
public class StreamingMediaPlayerTest extends MediaPlayerTestBase {
private static final String TAG = "StreamingMediaPlayerTest";
+ static final String mInpPrefix = WorkDir.getMediaDirString() + "assets/";
private static final String HTTP_H263_AMR_VIDEO_1_KEY =
"streaming_media_player_test_http_h263_amr_video1";
@@ -284,9 +285,9 @@
if (redirect) {
// Stagefright doesn't have a limit, but we can't test support of infinite redirects
// Up to 4 redirects seems reasonable though.
- stream_url = mServer.getRedirectingAssetUrl(name, 4);
+ stream_url = mServer.getRedirectingAssetUrl(mInpPrefix + name, 4);
} else {
- stream_url = mServer.getAssetUrl(name);
+ stream_url = mServer.getAssetUrl(mInpPrefix + name);
}
if (nolength) {
stream_url = stream_url + "?" + CtsTestServer.NOLENGTH_POSTFIX;
@@ -342,9 +343,9 @@
if (redirect) {
// Stagefright doesn't have a limit, but we can't test support of infinite redirects
// Up to 4 redirects seems reasonable though.
- stream_url = mServer.getRedirectingAssetUrl(name, 4);
+ stream_url = mServer.getRedirectingAssetUrl(mInpPrefix + name, 4);
} else {
- stream_url = mServer.getAssetUrl(name);
+ stream_url = mServer.getAssetUrl(mInpPrefix + name);
}
if (nolength) {
stream_url = stream_url + "?" + CtsTestServer.NOLENGTH_POSTFIX;
@@ -414,7 +415,7 @@
// counter must be final if we want to access it inside onTimedMetaData;
// use AtomicInteger so we can have a final counter object with mutable integer value.
final AtomicInteger counter = new AtomicInteger();
- String stream_url = mServer.getAssetUrl("prog_index.m3u8");
+ String stream_url = mServer.getAssetUrl(mInpPrefix + "prog_index.m3u8");
mMediaPlayer.setDataSource(stream_url);
mMediaPlayer.setDisplay(getActivity().getSurfaceHolder());
mMediaPlayer.setScreenOnWhilePlaying(true);
@@ -549,7 +550,7 @@
final MediaPlayer mp = worker.getPlayer();
try {
- String path = mServer.getDelayedAssetUrl("noiseandchirps.ogg", 15000);
+ String path = mServer.getDelayedAssetUrl(mInpPrefix + "noiseandchirps.ogg", 15000);
mp.setDataSource(path);
mp.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
@@ -609,9 +610,9 @@
try {
String stream_url = null;
if (redirect) {
- stream_url = mServer.getQueryRedirectingAssetUrl(name);
+ stream_url = mServer.getQueryRedirectingAssetUrl(mInpPrefix + name);
} else {
- stream_url = mServer.getAssetUrl(name);
+ stream_url = mServer.getAssetUrl(mInpPrefix + name);
}
if (appendQueryString) {
stream_url += "?foo=bar/baz";