FileDocCategorySizeDatePackage
MediaPlayerPowerTest.javaAPI DocAndroid 5.1 API2764Thu Mar 12 22:22:30 GMT 2015com.android.mediaframeworktest.power

MediaPlayerPowerTest

public class MediaPlayerPowerTest extends android.test.ActivityInstrumentationTestCase2
Junit / Instrumentation test case for the power measurment the media player

Fields Summary
private String
TAG
private String
MP3_POWERTEST
private String
MP3_STREAM
private String
OGG_STREAM
private String
AAC_STREAM
Constructors Summary
public MediaPlayerPowerTest()


      
        super("com.android.mediaframeworktest", MediaFrameworkTest.class);
    
Methods Summary
public voidaudioPlayback(java.lang.String filePath)

        try {
            MediaPlayer mp = new MediaPlayer();
            mp.setDataSource(filePath);
            mp.prepare();
            mp.start();
            Thread.sleep(200000);
            mp.stop();
            mp.release();
        } catch (Exception e) {
            Log.v(TAG, e.toString());
            assertTrue("MP3 Playback", false);
        }
    
protected voidsetUp()

        getActivity();
        super.setUp();

    
public voidtestPowerLocalMP3Playback()

        audioPlayback(MP3_POWERTEST);
    
public voidtestPowerStreamAACPlayback()

        audioPlayback(AAC_STREAM);
    
public voidtestPowerStreamMP3Playback()

        audioPlayback(MP3_STREAM);
    
public voidtestPowerStreamOGGPlayback()

        audioPlayback(OGG_STREAM);