Merge "Release the media player when the video preference is not visible."

This commit is contained in:
TreeHugger Robot
2019-01-03 20:15:33 +00:00
committed by Android (Google) Code Review
2 changed files with 40 additions and 23 deletions

View File

@@ -92,4 +92,13 @@ public class VideoPreferenceTest {
verify(mMediaPlayer, never()).start();
}
@Test
public void onViewInvisible_shouldReleaseMediaplayer() {
mVideoPreference.onViewVisible(false);
mVideoPreference.onViewInvisible();
verify(mMediaPlayer).release();
}
}