Add 5-second timeout to testFlacHeapOverflow
Bug: 23793209
Change-Id: If82a2094a1269805d0babdb393f2976052ed73d2
diff --git a/tests/tests/media/src/android/media/cts/MediaPlayerTest.java b/tests/tests/media/src/android/media/cts/MediaPlayerTest.java
index 7cdc483..2a696e0 100644
--- a/tests/tests/media/src/android/media/cts/MediaPlayerTest.java
+++ b/tests/tests/media/src/android/media/cts/MediaPlayerTest.java
@@ -99,6 +99,7 @@
public boolean onError(MediaPlayer mp, int what, int extra) {
assertTrue(mp == mMediaPlayer);
assertTrue("mediaserver process died", what != MediaPlayer.MEDIA_ERROR_SERVER_DIED);
+ Log.w(LOG_TAG, "onError " + what);
return false;
}
});
@@ -116,7 +117,9 @@
afd.close();
mMediaPlayer.prepare();
mMediaPlayer.start();
- mOnCompletionCalled.waitForSignal();
+ if (!mOnCompletionCalled.waitForSignal(5000)) {
+ Log.w(LOG_TAG, "testIfMediaServerDied: Timed out waiting for Error/Completion");
+ }
mMediaPlayer.release();
}