summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-11-18 16:07:26 -0800
committerJames Dong <jdong@google.com>2010-11-19 16:56:02 -0800
commitf360acf8759d5eedc2b4110c721c8d1a3262470c (patch)
tree8fe5ffb0b7edf7cdf975a338fb67f37fa81fcd77 /media
parent9803d7f87054ad67b62011e5b84e8963c5930e51 (diff)
downloadframeworks_base-f360acf8759d5eedc2b4110c721c8d1a3262470c.zip
frameworks_base-f360acf8759d5eedc2b4110c721c8d1a3262470c.tar.gz
frameworks_base-f360acf8759d5eedc2b4110c721c8d1a3262470c.tar.bz2
Fixed MediaPlayer unit test issues
o We used to have two different "idle" state with OpenCore. Now, with SF, we have a single and consistent "idle" state. bug - 3198642 Change-Id: I2bbb5e8b6c2d8166841a6e99a1c2c4a47e00b574
Diffstat (limited to 'media')
-rw-r--r--media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerGetCurrentPositionStateUnitTest.java4
-rw-r--r--media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerGetDurationStateUnitTest.java2
-rw-r--r--media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerPauseStateUnitTest.java8
-rw-r--r--media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerSeekToStateUnitTest.java4
-rw-r--r--media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerSetAudioStreamTypeStateUnitTest.java2
-rw-r--r--media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerStartStateUnitTest.java2
-rw-r--r--media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerStopStateUnitTest.java2
7 files changed, 12 insertions, 12 deletions
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerGetCurrentPositionStateUnitTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerGetCurrentPositionStateUnitTest.java
index 032b469..fd1c2d3 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerGetCurrentPositionStateUnitTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerGetCurrentPositionStateUnitTest.java
@@ -45,11 +45,11 @@ public class MediaPlayerGetCurrentPositionStateUnitTest extends AndroidTestCase
assertTrue(!stateErrors.errorInPausedState);
assertTrue(!stateErrors.errorInStoppedState);
assertTrue(!stateErrors.errorInPlaybackCompletedState);
- assertTrue(!stateErrors.errorInIdleStateAfterReset);
// Invalid states.
assertTrue(stateErrors.errorInErrorState);
- assertTrue(!stateErrors.errorInIdleState); // onError() won't be called
+ assertTrue(stateErrors.errorInIdleStateAfterReset);
+ assertTrue(stateErrors.errorInIdleState);
}
public void invokeMethodUnderTest(MediaPlayer player) {
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerGetDurationStateUnitTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerGetDurationStateUnitTest.java
index 5f7abe5..48fd16c 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerGetDurationStateUnitTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerGetDurationStateUnitTest.java
@@ -46,10 +46,10 @@ public class MediaPlayerGetDurationStateUnitTest extends AndroidTestCase impleme
assertTrue(!stateErrors.errorInPlaybackCompletedState);
// Invalid states.
- assertTrue(!stateErrors.errorInIdleState); // onError() won't be called
assertTrue(stateErrors.errorInInitializedState);
assertTrue(stateErrors.errorInErrorState);
assertTrue(stateErrors.errorInIdleStateAfterReset);
+ assertTrue(stateErrors.errorInIdleState);
}
public void invokeMethodUnderTest(MediaPlayer player) {
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerPauseStateUnitTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerPauseStateUnitTest.java
index 0a18a39..7a96792 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerPauseStateUnitTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerPauseStateUnitTest.java
@@ -29,9 +29,9 @@ public class MediaPlayerPauseStateUnitTest extends AndroidTestCase implements Me
/**
* 1. It is valid to call pause() in the following states:
- * {Started, Paused}.
+ * {Started, Paused, PlaybackCompleted}.
* 2. It is invalid to call pause() in the following states:
- * {Idle, Initialized, Prepared, Stopped, PlaybackCompleted, Error}
+ * {Idle, Initialized, Prepared, Stopped, Error}
*
* @param stateErrors the MediaPlayerStateErrors to check against.
*/
@@ -40,12 +40,12 @@ public class MediaPlayerPauseStateUnitTest extends AndroidTestCase implements Me
assertTrue(!stateErrors.errorInStartedState);
assertTrue(!stateErrors.errorInStartedStateAfterPause);
assertTrue(!stateErrors.errorInPausedState);
+ assertTrue(!stateErrors.errorInPlaybackCompletedState);
// Invalid states.
assertTrue(stateErrors.errorInPreparedState);
assertTrue(stateErrors.errorInPreparedStateAfterStop);
- assertTrue(stateErrors.errorInPlaybackCompletedState);
- assertTrue(!stateErrors.errorInIdleState); // noError() won't be called
+ assertTrue(stateErrors.errorInIdleState);
assertTrue(stateErrors.errorInIdleStateAfterReset);
assertTrue(stateErrors.errorInInitializedState);
assertTrue(stateErrors.errorInStoppedState);
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerSeekToStateUnitTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerSeekToStateUnitTest.java
index 46bba9b..991fe9c 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerSeekToStateUnitTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerSeekToStateUnitTest.java
@@ -39,17 +39,17 @@ public class MediaPlayerSeekToStateUnitTest extends AndroidTestCase implements M
// Valid states.
assertTrue(!stateErrors.errorInPreparedState);
assertTrue(!stateErrors.errorInPreparedStateAfterStop);
- assertTrue(!stateErrors.errorInStartedState);
assertTrue(!stateErrors.errorInStartedStateAfterPause);
assertTrue(!stateErrors.errorInPausedState);
assertTrue(!stateErrors.errorInPlaybackCompletedState);
// Invalid states.
- assertTrue(!stateErrors.errorInIdleState); // onError() won't be called
+ assertTrue(stateErrors.errorInIdleState);
assertTrue(stateErrors.errorInIdleStateAfterReset);
assertTrue(stateErrors.errorInInitializedState);
assertTrue(stateErrors.errorInStoppedState);
assertTrue(stateErrors.errorInErrorState);
+ assertTrue(!stateErrors.errorInStartedState);
}
public void invokeMethodUnderTest(MediaPlayer player) {
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerSetAudioStreamTypeStateUnitTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerSetAudioStreamTypeStateUnitTest.java
index 3153792..b984514 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerSetAudioStreamTypeStateUnitTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerSetAudioStreamTypeStateUnitTest.java
@@ -58,7 +58,7 @@ public class MediaPlayerSetAudioStreamTypeStateUnitTest extends AndroidTestCase
}
@LargeTest
- public void testSetAudioSystemType() {
+ public void testSetAudioStreamType() {
mTestTemplate.runTestOnMethod(this);
}
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerStartStateUnitTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerStartStateUnitTest.java
index 6debbb4..68c8e42 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerStartStateUnitTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerStartStateUnitTest.java
@@ -45,7 +45,7 @@ public class MediaPlayerStartStateUnitTest extends AndroidTestCase implements Me
assertTrue(!stateErrors.errorInPlaybackCompletedState);
// Invalid states.
- assertTrue(!stateErrors.errorInIdleState); // onError() won't be called
+ assertTrue(stateErrors.errorInIdleState);
assertTrue(stateErrors.errorInErrorState);
assertTrue(stateErrors.errorInIdleStateAfterReset);
assertTrue(stateErrors.errorInInitializedState);
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerStopStateUnitTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerStopStateUnitTest.java
index 3427f86..ab8519a 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerStopStateUnitTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerStopStateUnitTest.java
@@ -46,7 +46,7 @@ public class MediaPlayerStopStateUnitTest extends AndroidTestCase implements Med
assertTrue(!stateErrors.errorInPausedState);
// Invalid states.
- assertTrue(!stateErrors.errorInIdleState); // noError() won't be called
+ assertTrue(stateErrors.errorInIdleState);
assertTrue(stateErrors.errorInIdleStateAfterReset);
assertTrue(stateErrors.errorInInitializedState);
assertTrue(stateErrors.errorInErrorState);