/packages/apps/Settings/tests/robotests/src/com/android/settings/notification/ |
D | VolumeSeekBarPreferenceTest.java | 53 private VolumeSeekBarPreference mPreference; field in VolumeSeekBarPreferenceTest 77 doCallRealMethod().when(mPreference).setStream(anyInt()); in setUp() 78 doCallRealMethod().when(mPreference).updateContentDescription(CONTENT_DESCRIPTION); in setUp() 79 mPreference.mSeekBar = mSeekBar; in setUp() 80 mPreference.mAudioManager = mAudioManager; in setUp() 81 mPreference.mSeekBarVolumizerFactory = mSeekBarVolumizerFactory; in setUp() 82 mListener = () -> mPreference.updateContentDescription(CONTENT_DESCRIPTION); in setUp() 94 mPreference.setStream(STREAM); in setStream_shouldSetMinMaxAndProgress() 96 verify(mPreference).setMax(max); in setStream_shouldSetMinMaxAndProgress() 97 verify(mPreference).setMin(min); in setStream_shouldSetMinMaxAndProgress() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/widget/ |
D | AddPreferenceTest.java | 48 private AddPreference mPreference; field in AddPreferenceTest 53 mPreference = new AddPreference(mContext, null); in setUp() 55 final View view = spy(View.inflate(mContext, mPreference.getLayoutResource(), null)); in setUp() 58 mAddWidget = spy(View.inflate(mContext, mPreference.getSecondTargetResId(), null)); in setUp() 59 when(mViewHolder.findViewById(mPreference.getAddWidgetResId())).thenReturn(mAddWidget); in setUp() 64 mPreference.onBindViewHolder(mViewHolder); in onBindViewHolder_noListener_addButtonNotVisible() 65 assertThat(mPreference.shouldHideSecondTarget()).isTrue(); in onBindViewHolder_noListener_addButtonNotVisible() 71 mPreference.setOnAddClickListener(p -> {}); in onBindViewHolder_hasListener_addButtonVisible() 72 mPreference.onBindViewHolder(mViewHolder); in onBindViewHolder_hasListener_addButtonVisible() 73 assertThat(mPreference.shouldHideSecondTarget()).isFalse(); in onBindViewHolder_hasListener_addButtonVisible() [all …]
|
D | PrimaryCheckBoxPreferenceTest.java | 45 private PrimaryCheckBoxPreference mPreference; field in PrimaryCheckBoxPreferenceTest 50 mPreference = new PrimaryCheckBoxPreference(mContext); in setUp() 55 assertThat(mPreference.getWidgetLayoutResource()) in createNewPreference_shouldSetLayout() 65 mPreference.onBindViewHolder(holder); in setChecked_shouldUpdateCheckBoxCheckedState() 67 mPreference.setChecked(true); in setChecked_shouldUpdateCheckBoxCheckedState() 70 mPreference.setChecked(false); in setChecked_shouldUpdateCheckBoxCheckedState() 80 mPreference.onBindViewHolder(holder); in setEnabled_shouldUpdateCheckBoxEnabledState() 82 mPreference.setEnabled(true); in setEnabled_shouldUpdateCheckBoxEnabledState() 85 mPreference.setEnabled(false); in setEnabled_shouldUpdateCheckBoxEnabledState() 95 mPreference.onBindViewHolder(holder); in setCheckboxEnabled_shouldOnlyUpdateCheckBoxEnabledState() [all …]
|
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/enterprise/ |
D | DeviceAdminAddHeaderPreferenceControllerTest.java | 40 private TwoStatePreference mPreference; field in DeviceAdminAddHeaderPreferenceControllerTest 126 mController.onResumeInternal(mPreference); in testOnResumeInternal_inactiveAdmin() 128 verifyPreferenceSetChecked(mPreference, false); in testOnResumeInternal_inactiveAdmin() 129 verifyPreferenceEnabled(mPreference); in testOnResumeInternal_inactiveAdmin() 139 mController.onResumeInternal(mPreference); in testOnResumeInternal_activeAdmin() 141 verifyPreferenceSetChecked(mPreference, true); in testOnResumeInternal_activeAdmin() 142 verifyPreferenceEnabled(mPreference); in testOnResumeInternal_activeAdmin() 152 mController.onResumeInternal(mPreference); in testOnResumeInternal_deviceOwner() 154 verifyPreferenceSetChecked(mPreference, true); in testOnResumeInternal_deviceOwner() 155 verifyPreferenceDisabled(mPreference); in testOnResumeInternal_deviceOwner() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/accessibility/ |
D | VibrationIntensityPreferenceControllerTest.java | 73 private SeekBarPreference mPreference; field in VibrationIntensityPreferenceControllerTest 87 controller.updateState(mPreference); in missingSetting_shouldReturnDefault() 88 assertThat(mPreference.getProgress()) in missingSetting_shouldReturnDefault() 98 controller.updateState(mPreference); in updateState_mainSwitchUpdates_shouldPreserveSettingBetweenUpdates() 99 assertThat(mPreference.getProgress()).isEqualTo(Vibrator.VIBRATION_INTENSITY_LOW); in updateState_mainSwitchUpdates_shouldPreserveSettingBetweenUpdates() 100 assertThat(mPreference.isEnabled()).isTrue(); in updateState_mainSwitchUpdates_shouldPreserveSettingBetweenUpdates() 103 controller.updateState(mPreference); in updateState_mainSwitchUpdates_shouldPreserveSettingBetweenUpdates() 104 assertThat(mPreference.getProgress()).isEqualTo(Vibrator.VIBRATION_INTENSITY_OFF); in updateState_mainSwitchUpdates_shouldPreserveSettingBetweenUpdates() 105 assertThat(mPreference.isEnabled()).isFalse(); in updateState_mainSwitchUpdates_shouldPreserveSettingBetweenUpdates() 108 controller.updateState(mPreference); in updateState_mainSwitchUpdates_shouldPreserveSettingBetweenUpdates() [all …]
|
D | RingVibrationTogglePreferenceControllerTest.java | 59 private SwitchPreference mPreference; field in RingVibrationTogglePreferenceControllerTest 71 mPreference = new SwitchPreference(mContext); in setUp() 72 mPreference.setSummary("Test summary"); in setUp() 73 when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference); in setUp() 88 mController.updateState(mPreference); in missingSetting_shouldReturnDefault() 89 assertThat(mPreference.isChecked()).isTrue(); in missingSetting_shouldReturnDefault() 97 mController.updateState(mPreference); in updateState_ringerModeUpdates_shouldPreserveSettingAndDisplaySummary() 98 assertThat(mPreference.isChecked()).isTrue(); in updateState_ringerModeUpdates_shouldPreserveSettingAndDisplaySummary() 99 assertThat(mPreference.getSummary()).isNull(); in updateState_ringerModeUpdates_shouldPreserveSettingAndDisplaySummary() 100 assertThat(mPreference.isEnabled()).isTrue(); in updateState_ringerModeUpdates_shouldPreserveSettingAndDisplaySummary() [all …]
|
D | VibrationTogglePreferenceControllerTest.java | 69 private SwitchPreference mPreference; field in VibrationTogglePreferenceControllerTest 80 mPreference = new SwitchPreference(mContext); in setUp() 81 mPreference.setTitle("Test title"); in setUp() 82 when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference); in setUp() 89 mController.updateState(mPreference); in missingSetting_shouldBeCheckedByDefault() 90 assertThat(mPreference.isChecked()).isTrue(); in missingSetting_shouldBeCheckedByDefault() 98 mController.updateState(mPreference); in updateState_mainSwitchUpdates_shouldPreserveSettingBetweenUpdates() 99 assertThat(mPreference.isChecked()).isTrue(); in updateState_mainSwitchUpdates_shouldPreserveSettingBetweenUpdates() 100 assertThat(mPreference.isEnabled()).isTrue(); in updateState_mainSwitchUpdates_shouldPreserveSettingBetweenUpdates() 103 mController.updateState(mPreference); in updateState_mainSwitchUpdates_shouldPreserveSettingBetweenUpdates() [all …]
|
D | HapticFeedbackTogglePreferenceControllerTest.java | 58 private SwitchPreference mPreference; field in HapticFeedbackTogglePreferenceControllerTest 70 mPreference = new SwitchPreference(mContext); in setUp() 71 mPreference.setSummary("Test summary"); in setUp() 72 when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference); in setUp() 87 mController.updateState(mPreference); in missingSetting_shouldReturnDefault() 88 assertThat(mPreference.isChecked()).isTrue(); in missingSetting_shouldReturnDefault() 96 mController.updateState(mPreference); in updateState_ringerModeUpdates_shouldNotAffectSettings() 97 assertThat(mPreference.isChecked()).isTrue(); in updateState_ringerModeUpdates_shouldNotAffectSettings() 98 assertThat(mPreference.isEnabled()).isTrue(); in updateState_ringerModeUpdates_shouldNotAffectSettings() 101 mController.updateState(mPreference); in updateState_ringerModeUpdates_shouldNotAffectSettings() [all …]
|
D | NotificationVibrationTogglePreferenceControllerTest.java | 57 private SwitchPreference mPreference; field in NotificationVibrationTogglePreferenceControllerTest 69 mPreference = new SwitchPreference(mContext); in setUp() 70 mPreference.setSummary("Test summary"); in setUp() 71 when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference); in setUp() 86 mController.updateState(mPreference); in missingSetting_shouldReturnDefault() 87 assertThat(mPreference.isChecked()).isTrue(); in missingSetting_shouldReturnDefault() 96 mController.updateState(mPreference); in updateState_ringerModeUpdates_shouldPreserveSettingAndDisplaySummary() 97 assertThat(mPreference.isChecked()).isTrue(); in updateState_ringerModeUpdates_shouldPreserveSettingAndDisplaySummary() 98 assertThat(mPreference.getSummary()).isNull(); in updateState_ringerModeUpdates_shouldPreserveSettingAndDisplaySummary() 99 assertThat(mPreference.isEnabled()).isTrue(); in updateState_ringerModeUpdates_shouldPreserveSettingAndDisplaySummary() [all …]
|
D | RingVibrationIntensityPreferenceControllerTest.java | 62 private SeekBarPreference mPreference; field in RingVibrationIntensityPreferenceControllerTest 75 mPreference = new SeekBarPreference(mContext); in setUp() 76 mPreference.setSummary("Test summary"); in setUp() 77 when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference); in setUp() 94 mController.updateState(mPreference); in missingSetting_shouldReturnDefault() 95 assertThat(mPreference.getProgress()).isEqualTo( in missingSetting_shouldReturnDefault() 104 mController.updateState(mPreference); in updateState_ringerModeUpdates_shouldPreserveSettingAndDisplaySummary() 105 assertThat(mPreference.getProgress()).isEqualTo(Vibrator.VIBRATION_INTENSITY_LOW); in updateState_ringerModeUpdates_shouldPreserveSettingAndDisplaySummary() 106 assertThat(mPreference.getSummary()).isNull(); in updateState_ringerModeUpdates_shouldPreserveSettingAndDisplaySummary() 107 assertThat(mPreference.isEnabled()).isTrue(); in updateState_ringerModeUpdates_shouldPreserveSettingAndDisplaySummary() [all …]
|
D | AlarmVibrationTogglePreferenceControllerTest.java | 56 private SwitchPreference mPreference; field in AlarmVibrationTogglePreferenceControllerTest 68 mPreference = new SwitchPreference(mContext); in setUp() 69 mPreference.setSummary("Test summary"); in setUp() 70 when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference); in setUp() 86 mController.updateState(mPreference); in missingSetting_shouldReturnDefault() 88 assertThat(mPreference.isChecked()).isTrue(); in missingSetting_shouldReturnDefault() 96 mController.updateState(mPreference); in updateState_ringerModeUpdates_shouldNotAffectSettings() 97 assertThat(mPreference.isChecked()).isTrue(); in updateState_ringerModeUpdates_shouldNotAffectSettings() 98 assertThat(mPreference.isEnabled()).isTrue(); in updateState_ringerModeUpdates_shouldNotAffectSettings() 101 mController.updateState(mPreference); in updateState_ringerModeUpdates_shouldNotAffectSettings() [all …]
|
D | HapticFeedbackIntensityPreferenceControllerTest.java | 61 private SeekBarPreference mPreference; field in HapticFeedbackIntensityPreferenceControllerTest 74 mPreference = new SeekBarPreference(mContext); in setUp() 75 mPreference.setSummary("Test summary"); in setUp() 76 when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference); in setUp() 93 mController.updateState(mPreference); in missingSetting_shouldReturnDefault() 94 assertThat(mPreference.getProgress()) in missingSetting_shouldReturnDefault() 103 mController.updateState(mPreference); in updateState_ringerModeUpdates_shouldNotAffectSettings() 104 assertThat(mPreference.getProgress()).isEqualTo(Vibrator.VIBRATION_INTENSITY_LOW); in updateState_ringerModeUpdates_shouldNotAffectSettings() 105 assertThat(mPreference.isEnabled()).isTrue(); in updateState_ringerModeUpdates_shouldNotAffectSettings() 108 mController.updateState(mPreference); in updateState_ringerModeUpdates_shouldNotAffectSettings() [all …]
|
D | MediaVibrationTogglePreferenceControllerTest.java | 62 private SwitchPreference mPreference; field in MediaVibrationTogglePreferenceControllerTest 74 mPreference = new SwitchPreference(mContext); in setUp() 75 mPreference.setSummary("Test summary"); in setUp() 76 when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference); in setUp() 97 mController.updateState(mPreference); in missingSetting_shouldReturnDefault() 99 assertThat(mPreference.isChecked()).isTrue(); in missingSetting_shouldReturnDefault() 107 mController.updateState(mPreference); in updateState_ringerModeUpdates_shouldNotAffectSettings() 108 assertThat(mPreference.isChecked()).isTrue(); in updateState_ringerModeUpdates_shouldNotAffectSettings() 109 assertThat(mPreference.isEnabled()).isTrue(); in updateState_ringerModeUpdates_shouldNotAffectSettings() 112 mController.updateState(mPreference); in updateState_ringerModeUpdates_shouldNotAffectSettings() [all …]
|
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/bluetooth/ |
D | BluetoothDevicePreferenceTest.java | 56 private BluetoothDevicePreference mPreference; field in BluetoothDevicePreferenceTest 78 mPreference = new BluetoothDevicePreference(mContext, mCachedDevice); in setUp() 83 assertThat(mPreference.getActionItem(MultiActionPreference.ActionItem.ACTION_ITEM1) in actionIsHiddenByDefault() 85 assertThat(mPreference.getActionItem(MultiActionPreference.ActionItem.ACTION_ITEM1) in actionIsHiddenByDefault() 87 assertThat(mPreference.getActionItem(MultiActionPreference.ActionItem.ACTION_ITEM1) in actionIsHiddenByDefault() 93 mPreference.onAttached(); in onAttached_registersDeviceCallback() 103 mPreference.onAttached(); in onAttached_setsDeviceNameAsTitle() 105 assertThat(mPreference.getTitle()).isEqualTo(name); in onAttached_setsDeviceNameAsTitle() 114 mPreference.onAttached(); in onAttached_notConnected_setsCarConnectionSummaryAsSummary() 116 assertThat(mPreference.getSummary()).isEqualTo(summary); in onAttached_notConnected_setsCarConnectionSummaryAsSummary() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/development/ |
D | BluetoothMaxConnectedAudioDevicesPreferenceControllerTest.java | 62 private ListPreference mPreference; field in BluetoothMaxConnectedAudioDevicesPreferenceControllerTest 75 mPreference = new ListPreference(mSpyContext); in setup() 76 mPreference.setEntries(R.array.bluetooth_max_connected_audio_devices); in setup() 77 mPreference.setEntryValues(R.array.bluetooth_max_connected_audio_devices_values); in setup() 84 mPreference); in setup() 86 mListValues = mPreference.getEntryValues(); in setup() 87 mListEntries = mPreference.getEntries(); in setup() 99 mController.updateState(mPreference); in verifyResourceSizeAndRange() 101 assertThat(mPreference.getValue()).isEqualTo(mListValues[0]); in verifyResourceSizeAndRange() 102 assertThat(mPreference.getEntry()).isEqualTo(mListEntries[0]); in verifyResourceSizeAndRange() [all …]
|
/packages/apps/Settings/tests/unit/src/com/android/settings/development/mediadrm/ |
D | ForceSwSecureCryptoFallbackPreferenceControllerTest.java | 57 private SwitchPreference mPreference; field in ForceSwSecureCryptoFallbackPreferenceControllerTest 63 mPreference = new SwitchPreference(mContext); in setUp() 70 mController.updateState(mPreference); in updateState_flagEnabled_checkPreference() 71 assumeTrue(mPreference.isEnabled()); in updateState_flagEnabled_checkPreference() 72 assertThat(mPreference.isChecked()).isFalse(); in updateState_flagEnabled_checkPreference() 77 mController.updateState(mPreference); in updateState_flagEnabled_checkPreference() 79 assertThat(mPreference.isEnabled()).isTrue(); in updateState_flagEnabled_checkPreference() 80 assertThat(mPreference.isChecked()).isTrue(); in updateState_flagEnabled_checkPreference() 84 mController.updateState(mPreference); in updateState_flagEnabled_checkPreference() 86 assertThat(mPreference.isEnabled()).isTrue(); in updateState_flagEnabled_checkPreference() [all …]
|
/packages/apps/Settings/src/com/android/settings/widget/ |
D | GenericSwitchController.java | 35 private Preference mPreference; field in GenericSwitchController 47 mPreference = preference; in setPreference() 57 mPreference.setOnPreferenceChangeListener(this); in startListening() 62 mPreference.setOnPreferenceChangeListener(null); in stopListening() 67 if (mPreference instanceof PrimarySwitchPreference) { in setChecked() 68 ((PrimarySwitchPreference) mPreference).setChecked(checked); in setChecked() 69 } else if (mPreference instanceof RestrictedSwitchPreference) { in setChecked() 70 ((RestrictedSwitchPreference) mPreference).setChecked(checked); in setChecked() 76 if (mPreference instanceof PrimarySwitchPreference) { in isChecked() 77 return ((PrimarySwitchPreference) mPreference).isChecked(); in isChecked() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/accounts/ |
D | ContactSearchPreferenceControllerTest.java | 55 private RestrictedSwitchPreference mPreference; field in ContactSearchPreferenceControllerTest 69 mPreference = spy(new RestrictedSwitchPreference(mContext)); in setUp() 98 mController.updateState(mPreference); in updateState_shouldRefreshContent() 100 assertThat(mPreference.isChecked()).isFalse(); in updateState_shouldRefreshContent() 105 mController.updateState(mPreference); in updateState_shouldRefreshContent() 107 assertThat(mPreference.isChecked()).isTrue(); in updateState_shouldRefreshContent() 112 mController.updateState(mPreference); in updateState_preferenceShouldBeDisabled() 114 verify(mPreference).setDisabledByAdmin(any()); in updateState_preferenceShouldBeDisabled() 119 mController.onPreferenceChange(mPreference, false); in onPreferenceChange_shouldUpdateProviderValue() 125 mController.onPreferenceChange(mPreference, true); in onPreferenceChange_shouldUpdateProviderValue() [all …]
|
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/common/ |
D | PreferenceControllerTest.java | 84 private CarUiPreference mPreference; field in PreferenceControllerTest 98 mPreferenceController.setPreference(mPreference); in onUxRestrictionsChanged_restricted_preferenceRestricted() 101 Mockito.reset(mPreference); in onUxRestrictionsChanged_restricted_preferenceRestricted() 104 verify((UxRestrictablePreference) mPreference).setUxRestricted(true); in onUxRestrictionsChanged_restricted_preferenceRestricted() 109 mPreferenceController.setPreference(mPreference); in onUxRestrictionsChanged_restricted_viewOnly_preferenceUnrestricted() 113 Mockito.reset(mPreference); in onUxRestrictionsChanged_restricted_viewOnly_preferenceUnrestricted() 116 verify((UxRestrictablePreference) mPreference).setUxRestricted(false); in onUxRestrictionsChanged_restricted_viewOnly_preferenceUnrestricted() 185 mPreference.setEnabled(false); in onCreate_unrestricted_disabled_preferenceUnrestricted() 186 mPreferenceController.setPreference(mPreference); in onCreate_unrestricted_disabled_preferenceUnrestricted() 189 verify((UxRestrictablePreference) mPreference).setUxRestricted(false); in onCreate_unrestricted_disabled_preferenceUnrestricted() [all …]
|
/packages/apps/Car/Settings/tests/robotests/src/com/android/car/settings/bluetooth/ |
D | BluetoothDeviceProfilePreferenceTest.java | 56 private BluetoothDeviceProfilePreference mPreference; field in BluetoothDeviceProfilePreferenceTest 66 mPreference = new BluetoothDeviceProfilePreference(mContext, mProfile, mCachedDevice); in setUp() 71 assertThat(mPreference.getKey()).isEqualTo(mProfile.toString()); in onConstruction_setsProfileStringAsKey() 76 assertThat(mPreference.getTitle()).isEqualTo(mContext.getString(R.string.bt_profile_name)); in onConstruction_setsProfileNameAsTitle() 81 mPreference.onAttached(); in onAttached_registersDeviceCallback() 90 mPreference.onAttached(); in onAttached_deviceNotBusy_setsEnabled() 92 assertThat(mPreference.isEnabled()).isTrue(); in onAttached_deviceNotBusy_setsEnabled() 99 mPreference.onAttached(); in onAttached_deviceBusy_setsNotEnabled() 101 assertThat(mPreference.isEnabled()).isFalse(); in onAttached_deviceBusy_setsNotEnabled() 108 mPreference.onAttached(); in onAttached_preferred_setsChecked() [all …]
|
/packages/apps/Settings/src/com/android/settings/notification/ |
D | VolumeSeekBarPreferenceController.java | 36 protected VolumeSeekBarPreference mPreference; field in VolumeSeekBarPreferenceController 64 mPreference = screen.findPreference(getPreferenceKey()); in setupVolPreference() 65 mPreference.setCallback(mVolumePreferenceCallback); in setupVolPreference() 66 mPreference.setListener(mVolumePreferenceListener); in setupVolPreference() 67 mPreference.setStream(getAudioStream()); in setupVolPreference() 68 mPreference.setMuteIcon(getMuteIcon()); in setupVolPreference() 73 if (mPreference != null) { in onResume() 74 mPreference.onActivityResume(); in onResume() 80 if (mPreference != null) { in onPause() 81 mPreference.onActivityPause(); in onPause() [all …]
|
/packages/apps/Settings/tests/unit/src/com/android/settings/development/bluetooth/ |
D | BluetoothStackLogPreferenceControllerTest.java | 53 private ListPreference mPreference; field in BluetoothStackLogPreferenceControllerTest 73 mPreference = new ListPreference(mContext); in setup() 77 mPreference.setKey(mController.getPreferenceKey()); in setup() 78 mPreference.setEntries(com.android.settings.R.array.bt_stack_log_level_entries); in setup() 79 mPreference.setEntryValues(com.android.settings.R.array.bt_stack_log_level_values); in setup() 81 mPreferenceScreen.addPreference(mPreference); in setup() 84 mListValues = mPreference.getEntryValues(); in setup() 85 mListEntries = mPreference.getEntries(); in setup() 93 mController.onPreferenceChange(mPreference, mController.getDefaultModeIndex()); in verifyDefaultState_enablesDefaultLogLevelEntriesAndValuesSameSize() 94 assertThat(mPreference.getValue().toString()).isEqualTo(mListValues in verifyDefaultState_enablesDefaultLogLevelEntriesAndValuesSameSize() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/network/ |
D | PrivateDnsModeDialogPreferenceTest.java | 60 private PrivateDnsModeDialogPreference mPreference; field in PrivateDnsModeDialogPreferenceTest 80 mPreference = new PrivateDnsModeDialogPreference(mContext); in setUp() 81 ReflectionHelpers.setField(mPreference, "mFragment", fragment); in setUp() 87 mPreference.onBindDialogView(view); in setUp() 92 mPreference.onCheckedChanged(null, R.id.private_dns_mode_off); in testOnCheckedChanged_dnsModeOff_disableEditText() 94 assertThat(mPreference.mMode).isEqualTo(PRIVATE_DNS_MODE_OFF); in testOnCheckedChanged_dnsModeOff_disableEditText() 95 assertThat(mPreference.mEditText.isEnabled()).isFalse(); in testOnCheckedChanged_dnsModeOff_disableEditText() 100 mPreference.onCheckedChanged(null, R.id.private_dns_mode_opportunistic); in testOnCheckedChanged_dnsModeOpportunistic_disableEditText() 102 assertThat(mPreference.mMode).isEqualTo(PRIVATE_DNS_MODE_OPPORTUNISTIC); in testOnCheckedChanged_dnsModeOpportunistic_disableEditText() 103 assertThat(mPreference.mEditText.isEnabled()).isFalse(); in testOnCheckedChanged_dnsModeOpportunistic_disableEditText() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/fuelgauge/ |
D | UnrestrictedPreferenceControllerTest.java | 44 private SelectorWithWidgetPreference mPreference; field in UnrestrictedPreferenceControllerTest 60 mPreference = new SelectorWithWidgetPreference(RuntimeEnvironment.application); in setUp() 70 mController.updateState(mPreference); in testUpdateState_isValidPackage_prefEnabled() 73 assertThat(mPreference.isEnabled()).isTrue(); in testUpdateState_isValidPackage_prefEnabled() 81 mController.updateState(mPreference); in testUpdateState_invalidPackage_prefDisabled() 84 assertThat(mPreference.isEnabled()).isFalse(); in testUpdateState_invalidPackage_prefDisabled() 94 mController.updateState(mPreference); in testUpdateState_isSystemOrDefaultAppAndUnrestrictedStates_prefChecked() 96 assertThat(mPreference.isChecked()).isTrue(); in testUpdateState_isSystemOrDefaultAppAndUnrestrictedStates_prefChecked() 106 mController.updateState(mPreference); in testUpdateState_isSystemOrDefaultApp_prefUnchecked() 108 assertThat(mPreference.isEnabled()).isFalse(); in testUpdateState_isSystemOrDefaultApp_prefUnchecked() [all …]
|
/packages/apps/EmergencyInfo/tests/robolectric/src/com/android/emergency/preferences/ |
D | EmergencyListPreferenceTest.java | 49 private EmergencyListPreference mPreference; field in EmergencyListPreferenceTest 59 mPreference = spy( in setUp() 64 prefRoot.addPreference(mPreference); in setUp() 76 mPreference.setKey(PreferenceKeys.KEY_ORGAN_DONOR); in testReloadFromPreference() 77 mPreference.setEntryValues(organDonorValues); in testReloadFromPreference() 79 mPreference.reloadFromPreference(); in testReloadFromPreference() 80 assertThat(mPreference.getValue()).isEqualTo(mPreference.getEntryValues()[0]); in testReloadFromPreference() 81 assertThat(mPreference.isNotSet()).isFalse(); in testReloadFromPreference() 92 mPreference.setKey(PreferenceKeys.KEY_ORGAN_DONOR); in testSetValue() 93 mPreference.setEntries(organDonorEntries); in testSetValue() [all …]
|