FileDocCategorySizeDatePackage
RealMediaPlayerTest.javaAPI DocAndroid 5.1 API1789Thu Mar 12 22:22:48 GMT 2015com.android.ex.variablespeed

RealMediaPlayerTest

public class RealMediaPlayerTest extends MediaPlayerProxyTestCase
Tests that MediaPlayerProxyTestCase contains reasonable tests with a real {@link MediaPlayer}.

Fields Summary
Constructors Summary
Methods Summary
public MediaPlayerProxycreateTestMediaPlayer()

        // We have to construct the MediaPlayer on the main thread (or at least on a thread with an
        // associated looper) otherwise we don't get sent the messages when callbacks should be
        // invoked. I've raised a bug for this: http://b/4602011.
        Callable<MediaPlayer> callable = new Callable<MediaPlayer>() {
            @Override
            public MediaPlayer call() throws Exception {
                return new MediaPlayer();
            }
        };
        FutureTask<MediaPlayer> future = new FutureTask<MediaPlayer>(callable);
        getInstrumentation().runOnMainSync(future);
        return DynamicProxy.dynamicProxy(MediaPlayerProxy.class, future.get(1, TimeUnit.SECONDS));