Search in sources :

Example 6 with MediaEvent

use of org.robolectric.shadows.ShadowMediaPlayer.MediaEvent in project robolectric by robolectric.

the class ShadowMediaPlayerTest method testRemoveEvent.

@Test
public void testRemoveEvent() {
    shadowMediaPlayer.setState(PREPARED);
    mediaPlayer.start();
    scheduler.advanceBy(200);
    MediaEvent e = info.scheduleInfoAtOffset(500, 1, 3);
    scheduler.advanceBy(299);
    shadowMediaPlayer.doStop();
    info.removeEvent(e);
    shadowMediaPlayer.doStart();
    scheduler.advanceToLastPostedRunnable();
    Mockito.verifyZeroInteractions(infoListener);
}
Also used : MediaEvent(org.robolectric.shadows.ShadowMediaPlayer.MediaEvent) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 MediaEvent (org.robolectric.shadows.ShadowMediaPlayer.MediaEvent)6 MediaPlayer (android.media.MediaPlayer)1