diff options
author | Hugo Hudson <hugohudson@google.com> | 2011-07-25 17:04:42 +0100 |
---|---|---|
committer | Hugo Hudson <hugohudson@google.com> | 2011-07-25 20:45:39 +0100 |
commit | 9730f15ebbf4b64cd48e0777850e56cb516a9ed4 (patch) | |
tree | 796a76a6b0f18c1d4f5799eb1d359b0961b083f3 /common/tests/AndroidManifest.xml | |
parent | 376a291b7a3016cc85501ee1c044629cce60e75c (diff) | |
download | android_frameworks_ex-9730f15ebbf4b64cd48e0777850e56cb516a9ed4.tar.gz android_frameworks_ex-9730f15ebbf4b64cd48e0777850e56cb516a9ed4.tar.bz2 android_frameworks_ex-9730f15ebbf4b64cd48e0777850e56cb516a9ed4.zip |
Adds tests for Variable Speed code.
The test changes:
- Adds many, many test cases against a MediaPlayerProxy, checking that
it behaves to the contract of a MediaPlayer.
- Adds the RealMediaPlayer class to check a real MediaPlayer.
- Adds the VariableSpeed class, to check a VariableSpeed instance
against the same contract as the MediaPlayer.
- Adds an Android.mk for the unit tests.
- Adds also an AndroidManifest.xml for the unit tests.
- Adds some test asset media files (3gpp file and mp3 file).
Required for the test changes:
- Adds a DynamicProxy class to adapt a MediaPlayer as a
MediaPlayerProxy class, i.e. to test the implementation of
MediaPlayerProxy, required to avoid writing an adapter.
- Adds a couple of listeners, OnErrorListener and
OnCompletionListener, that can be waited for synchronously in unit
tests.
Improvements as a result of the tests:
- During the testing, fixes the case where we weren't throwing
IllegalStateException if asked for the duration on released player.
- Refactored the create engine, create and realize output mix, create
and realize audio player, get play interfaces and callbacks, all
separated into their own static methods.
- This allows me to create the audio player during the main while loop
actually after the decoding has begun rather than before starting.
This work is a precursor to using the decoder's report on sample rate
and channels as the input to these methods.
- slSampleRate and slOutputChannels no longer computed in the
constructor, but computed when needed in the construction and
realization of the audio player.
Other changes:
- Remove some overly verbose logs on getDuration() and
getCurrentPosition().
- Adding the decoder interface to the callback.
- Extract metadata from decoder method now takes the metadata
interface, so this will be usable from the decoder callack in a follow
up.
- Temporarily stop getting the metadata out of the decoder, I'm going
to be doing it on the decoding callback instead.
- Renames the comment in AndroidManifest.xml to describe the
correct invocation to run the common tests.
Bug: 5048252
Bug: 5048257
Change-Id: Icdc18b19ef89c9924f73128b70aa4696b4e727c5
Diffstat (limited to 'common/tests/AndroidManifest.xml')
-rw-r--r-- | common/tests/AndroidManifest.xml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/tests/AndroidManifest.xml b/common/tests/AndroidManifest.xml index 151ec20..cf84c5b 100644 --- a/common/tests/AndroidManifest.xml +++ b/common/tests/AndroidManifest.xml @@ -22,7 +22,7 @@ <uses-library android:name="android.test.runner" /> </application> - <!-- Run tests with "runtest common" --> + <!-- Run tests with "runtest android-common" --> <instrumentation android:name="android.test.InstrumentationTestRunner" android:targetPackage="com.android.common.tests" android:label="Android Common Library Tests" /> |