use of com.android.settings.widget.VideoPreference in project android_packages_apps_Settings by LineageOS.
the class GesturePreferenceControllerTest method onPause_shouldStopVideoPreference.
@Test
public void onPause_shouldStopVideoPreference() {
final VideoPreference videoPreference = mock(VideoPreference.class);
when(mScreen.findPreference(mController.getVideoPrefKey())).thenReturn(videoPreference);
mController.mIsPrefAvailable = true;
mController.displayPreference(mScreen);
mController.onPause();
verify(videoPreference).onViewInvisible();
}
use of com.android.settings.widget.VideoPreference in project android_packages_apps_Settings by crdroidandroid.
the class GesturePreferenceControllerTest method onResume_shouldStartVideoPreferenceWithVideoPauseState.
@Test
public void onResume_shouldStartVideoPreferenceWithVideoPauseState() {
final VideoPreference videoPreference = mock(VideoPreference.class);
when(mScreen.findPreference(mController.getVideoPrefKey())).thenReturn(videoPreference);
mController.mIsPrefAvailable = true;
mController.displayPreference(mScreen);
final Bundle savedState = new Bundle();
mController.onCreate(null);
mController.onResume();
verify(videoPreference).onViewVisible(false);
reset(videoPreference);
savedState.putBoolean(mController.KEY_VIDEO_PAUSED, true);
mController.onCreate(savedState);
mController.onResume();
verify(videoPreference).onViewVisible(true);
reset(videoPreference);
savedState.putBoolean(mController.KEY_VIDEO_PAUSED, false);
mController.onCreate(savedState);
mController.onResume();
verify(videoPreference).onViewVisible(false);
}
use of com.android.settings.widget.VideoPreference in project android_packages_apps_Settings by crdroidandroid.
the class GesturePreferenceControllerTest method onPause_shouldUpdateVideoPauseState.
@Test
public void onPause_shouldUpdateVideoPauseState() {
final VideoPreference videoPreference = mock(VideoPreference.class);
when(mScreen.findPreference(mController.getVideoPrefKey())).thenReturn(videoPreference);
mController.mIsPrefAvailable = true;
mController.displayPreference(mScreen);
when(videoPreference.isVideoPaused()).thenReturn(true);
mController.onPause();
assertThat(mController.mVideoPaused).isTrue();
when(videoPreference.isVideoPaused()).thenReturn(false);
mController.onPause();
assertThat(mController.mVideoPaused).isFalse();
}
use of com.android.settings.widget.VideoPreference in project android_packages_apps_Settings by DirtyUnicorns.
the class GesturePreferenceControllerTest method onPause_shouldStopVideoPreference.
@Test
public void onPause_shouldStopVideoPreference() {
final VideoPreference videoPreference = mock(VideoPreference.class);
when(mScreen.findPreference(mController.getVideoPrefKey())).thenReturn(videoPreference);
mController.mIsPrefAvailable = true;
mController.displayPreference(mScreen);
mController.onPause();
verify(videoPreference).onViewInvisible();
}
use of com.android.settings.widget.VideoPreference in project android_packages_apps_Settings by omnirom.
the class GesturePreferenceControllerTest method onPause_shouldUpdateVideoPauseState.
@Test
public void onPause_shouldUpdateVideoPauseState() {
final VideoPreference videoPreference = mock(VideoPreference.class);
when(mScreen.findPreference(mController.getVideoPrefKey())).thenReturn(videoPreference);
mController.mIsPrefAvailable = true;
mController.displayPreference(mScreen);
when(videoPreference.isVideoPaused()).thenReturn(true);
mController.onPause();
assertThat(mController.mVideoPaused).isTrue();
when(videoPreference.isVideoPaused()).thenReturn(false);
mController.onPause();
assertThat(mController.mVideoPaused).isFalse();
}
Aggregations