FileDocCategorySizeDatePackage
MediaPlayerInvokeTest.javaAPI DocAndroid 5.1 API2301Thu Mar 12 22:22:30 GMT 2015com.android.mediaframeworktest.functional

MediaPlayerInvokeTest

public class MediaPlayerInvokeTest extends android.test.ActivityInstrumentationTestCase2

Fields Summary
private static final String
TAG
private android.media.MediaPlayer
mPlayer
private Random
rnd
Constructors Summary
public MediaPlayerInvokeTest()


     
       super("com.android.mediaframeworktest", MediaFrameworkTest.class);
       rnd = new Random(Calendar.getInstance().getTimeInMillis());
    
Methods Summary
protected voidsetUp()

      super.setUp();
      mPlayer = new MediaPlayer();
    
protected voidtearDown()

        mPlayer.release();
        super.tearDown();
    
public voidtestPing()

        mPlayer.setDataSource("test:invoke_mock_media_player.so?url=ping");

        Parcel request = mPlayer.newRequest();
        Parcel reply = Parcel.obtain();

        int val = rnd.nextInt();
        request.writeInt(val);
        mPlayer.invoke(request, reply);
        assertEquals(val, reply.readInt());