### Question:
IllustrationVideoView extends TextureView implements Animatable,
        SurfaceTextureListener,
        OnPreparedListener,
        OnSeekCompleteListener,
        OnInfoListener,
        OnErrorListener { @Override public void onWindowFocusChanged(boolean hasWindowFocus) { super.onWindowFocusChanged(hasWindowFocus); if (hasWindowFocus) { start(); } else { stop(); } } IllustrationVideoView(Context context, AttributeSet attrs); void setVideoResource(@RawRes int videoResId, String videoResPackageName); void setVideoResource(@RawRes int resId); @Override void onWindowFocusChanged(boolean hasWindowFocus); void release(); @Override void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int width, int height); @Override void onSurfaceTextureSizeChanged(SurfaceTexture surfaceTexture, int width, int height); @Override boolean onSurfaceTextureDestroyed(SurfaceTexture surfaceTexture); @Override void onSurfaceTextureUpdated(SurfaceTexture surfaceTexture); @Override void start(); @Override void stop(); @Override boolean isRunning(); @Override boolean onInfo(MediaPlayer mp, int what, int extra); @Override void onPrepared(MediaPlayer mp); @Override void onSeekComplete(MediaPlayer mp); int getCurrentPosition(); @Override boolean onError(MediaPlayer mediaPlayer, int what, int extra);  }### Answer:
@Test public void testStartedWhenWindowFocusRegained() { testPausedWhenWindowFocusLost(); Robolectric.flushForegroundThreadScheduler(); view.onWindowFocusChanged(true); assertThat(getShadowMediaPlayer().getState()).isEqualTo(ShadowMediaPlayer.State.STARTED); }