summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Xie <dxie@google.com>2016-04-05 22:40:01 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-04-05 22:40:01 +0000
commiteb7f4d9c93970e62acbf70df6ee4e17ecff9bb6a (patch)
treeaf63b30cc0a8a10238da7aa3e4d3718821778642
parent9b1c0e13edc3c3a4aa43d8243abb03f9122d5770 (diff)
parent5bb05ee82c9ffbc23693ee0c7380b49b1ff2310c (diff)
downloadcts-eb7f4d9c93970e62acbf70df6ee4e17ecff9bb6a.tar.gz
Merge "DO NOT MERGE Sonivox: add CTS test." into kitkat-cts-dev
-rw-r--r--tests/tests/security/res/raw/bug_26366256.midibin0 -> 565820 bytes
-rw-r--r--tests/tests/security/src/android/security/cts/StagefrightTest.java10
2 files changed, 9 insertions, 1 deletions
diff --git a/tests/tests/security/res/raw/bug_26366256.midi b/tests/tests/security/res/raw/bug_26366256.midi
new file mode 100644
index 00000000000..5114d92a852
--- /dev/null
+++ b/tests/tests/security/res/raw/bug_26366256.midi
Binary files differ
diff --git a/tests/tests/security/src/android/security/cts/StagefrightTest.java b/tests/tests/security/src/android/security/cts/StagefrightTest.java
index 0f79860a133..14a62bb23e9 100644
--- a/tests/tests/security/src/android/security/cts/StagefrightTest.java
+++ b/tests/tests/security/src/android/security/cts/StagefrightTest.java
@@ -43,6 +43,8 @@ import com.android.cts.security.R;
public class StagefrightTest extends InstrumentationTestCase {
static final String TAG = "StagefrightTest";
+ private final long TIMEOUT_NS = 10000000000L; // 10 seconds.
+
public StagefrightTest() {
}
@@ -94,6 +96,10 @@ public class StagefrightTest extends InstrumentationTestCase {
doStagefrightTest(R.raw.cve_2015_6598);
}
+ public void testStagefright_bug_26366256() throws Exception {
+ doStagefrightTest(R.raw.bug_26366256);
+ }
+
private void doStagefrightTest(final int rid) throws Exception {
class MediaPlayerCrashListener
implements MediaPlayer.OnErrorListener,
@@ -124,7 +130,9 @@ public class StagefrightTest extends InstrumentationTestCase {
public int waitForError() throws InterruptedException {
lock.lock();
- condition.await();
+ if (condition.awaitNanos(TIMEOUT_NS) <= 0) {
+ Log.d(TAG, "timed out on waiting for error");
+ }
lock.unlock();
return what;
}