Home
last modified time | relevance | path

Searched refs:mPreference (Results 1 – 25 of 28) sorted by relevance

12

/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/
DButtonPreferenceTest.java44 private ButtonPreference mPreference; field in ButtonPreferenceTest
53 mPreference = new ButtonPreference(mContext); in setUp()
60 mPreference.setTitle(testTitle); in onBindViewHolder_whenTitleSet_shouldSetButtonText()
62 mPreference.onBindViewHolder(mHolder); in onBindViewHolder_whenTitleSet_shouldSetButtonText()
64 final Button button = mPreference.getButton(); in onBindViewHolder_whenTitleSet_shouldSetButtonText()
66 assertThat(mPreference.getTitle().toString()).isEqualTo(testTitle); in onBindViewHolder_whenTitleSet_shouldSetButtonText()
71mPreference.setIcon(com.android.settingslib.widget.preference.banner.R.drawable.settingslib_ic_cro… in onBindViewHolder_whenIconSet_shouldSetIcon()
73 mPreference.onBindViewHolder(mHolder); in onBindViewHolder_whenIconSet_shouldSetIcon()
75 final Button button = mPreference.getButton(); in onBindViewHolder_whenIconSet_shouldSetIcon()
83 mPreference.setEnabled(true); in onBindViewHolder_setEnable_shouldSetButtonEnabled()
[all …]
DIllustrationPreferenceTest.java73 private IllustrationPreference mPreference; field in IllustrationPreferenceTest
100 mPreference = new IllustrationPreference(mContext, attributeSet); in setUp()
114 mPreference.setMiddleGroundView(view); in setMiddleGroundView_middleGroundView_shouldVisible()
115 mPreference.onBindViewHolder(mViewHolder); in setMiddleGroundView_middleGroundView_shouldVisible()
122 mPreference.enableAnimationAutoScale(true); in enableAnimationAutoScale_shouldChangeScaleType()
123 mPreference.onBindViewHolder(mViewHolder); in enableAnimationAutoScale_shouldChangeScaleType()
133 mPreference.setImageUri(mImageUri); in playAnimationWithUri_animatedImageDrawable_success()
134 mPreference.onBindViewHolder(mViewHolder); in playAnimationWithUri_animatedImageDrawable_success()
144 mPreference.setImageUri(mImageUri); in playAnimationWithUri_animatedVectorDrawable_success()
145 mPreference.onBindViewHolder(mViewHolder); in playAnimationWithUri_animatedVectorDrawable_success()
[all …]
DLayoutPreferenceTest.java41 private LayoutPreference mPreference; field in LayoutPreferenceTest
47 mPreference = new LayoutPreference(mContext, R.layout.settings_entity_header); in setUp()
56 mPreference.setOnPreferenceClickListener(listener); in setOnPreferenceClickListener_layoutPreferenceShouldListenClickEvent()
57 mPreference.onBindViewHolder(mHolder); in setOnPreferenceClickListener_layoutPreferenceShouldListenClickEvent()
61 verify(listener).onPreferenceClick(mPreference); in setOnPreferenceClickListener_layoutPreferenceShouldListenClickEvent()
68 mPreference.setSelectable(false); in setNonSelectable_viewShouldNotBeSelectable()
69 mPreference.onBindViewHolder(mHolder); in setNonSelectable_viewShouldNotBeSelectable()
77 mPreference.findViewById(android.R.id.button1).setEnabled(false); in disableSomeView_shouldMaintainStateAfterBind()
78 mPreference.findViewById(android.R.id.button2).setEnabled(true); in disableSomeView_shouldMaintainStateAfterBind()
80 mPreference.onBindViewHolder(mHolder); in disableSomeView_shouldMaintainStateAfterBind()
[all …]
DBarChartPreferenceTest.java57 private BarChartPreference mPreference; field in BarChartPreferenceTest
65 mPreference = new BarChartPreference(mContext, null /* attrs */); in setUp()
90 mPreference.initializeBarChart(barChartInfo); in initializeBarChart_titleSet_shouldSetTitleInChartView()
91 mPreference.onBindViewHolder(mHolder); in initializeBarChart_titleSet_shouldSetTitleInChartView()
104 mPreference.initializeBarChart(barChartInfo); in initializeBarChart_noBarViewSet_shouldShowTitleAndEmptyView()
106 mPreference.onBindViewHolder(mHolder); in initializeBarChart_noBarViewSet_shouldShowTitleAndEmptyView()
126 mPreference.initializeBarChart(barChartInfo); in initializeBarChart_detailsSet_shouldShowBarChartDetailsView()
127 mPreference.onBindViewHolder(mHolder); in initializeBarChart_detailsSet_shouldShowBarChartDetailsView()
144 mPreference.initializeBarChart(barChartInfo); in initializeBarChart_detailsNotSet_shouldHideBarChartDetailsView()
145 mPreference.onBindViewHolder(mHolder); in initializeBarChart_detailsNotSet_shouldHideBarChartDetailsView()
[all …]
DSelectorWithWidgetPreferenceTest.java43 private SelectorWithWidgetPreference mPreference; field in SelectorWithWidgetPreferenceTest
59 mPreference = new SelectorWithWidgetPreference(mContext); in setUp()
65 mPreference.onBindViewHolder(preferenceViewHolder); in setUp()
73 assertThat(mPreference.getLayoutResource()).isEqualTo( in shouldHaveRadioPreferenceLayout()
79 assertThat(mPreference.getWidgetLayoutResource()) in shouldHaveRadioButtonWidgetLayoutByDefault()
85 mPreference = new SelectorWithWidgetPreference(mContext, true); in shouldHaveCheckBoxWidgetLayoutIfSet()
86 assertThat(mPreference.getWidgetLayoutResource()) in shouldHaveCheckBoxWidgetLayoutIfSet()
92 assertThat(mPreference.isIconSpaceReserved()).isFalse(); in iconSpaceReservedShouldBeFalse()
97 mPreference.setSummary("some summary"); in onBindViewHolder_withSummary_containerShouldBeVisible()
104 mPreference.onBindViewHolder(preferenceViewHolder); in onBindViewHolder_withSummary_containerShouldBeVisible()
[all …]
DMainSwitchPreferenceTest.java41 private MainSwitchPreference mPreference; field in MainSwitchPreferenceTest
49 mPreference = new MainSwitchPreference(mContext); in setUp()
56 mPreference.onBindViewHolder(mHolder); in setTitle_shouldUpdateTitle()
57 mPreference.setTitle(defaultOnText); in setTitle_shouldUpdateTitle()
58 mPreference.updateStatus(true /* checked */); in setTitle_shouldUpdateTitle()
66 mPreference.onBindViewHolder(mHolder); in updateStatus_shouldMatchTheStatus()
67 mPreference.updateStatus(true); in updateStatus_shouldMatchTheStatus()
69 assertThat(mPreference.isChecked()).isTrue(); in updateStatus_shouldMatchTheStatus()
DTwoTargetPreferenceTest.java51 private TwoTargetPreference mPreference; field in TwoTargetPreferenceTest
58 mPreference = spy(new TwoTargetPreference(mContext)); in setUp()
68 assertThat(mPreference.shouldHideSecondTarget()).isTrue(); in bind_noSecondTarget_shouldNotDrawDivider()
70 mPreference.onBindViewHolder(mViewHolder); in bind_noSecondTarget_shouldNotDrawDivider()
78 doReturn(false).when(mPreference).shouldHideSecondTarget(); in bind_hasSecondTarget_shouldNotDrawDivider()
80 mPreference.onBindViewHolder(mViewHolder); in bind_hasSecondTarget_shouldNotDrawDivider()
88 mPreference.setIconSize(ICON_SIZE_SMALL); in bind_smallIcon_shouldUseSmallIconSize()
90 mPreference.onBindViewHolder(mViewHolder); in bind_smallIcon_shouldUseSmallIconSize()
104 mPreference.setIconSize(ICON_SIZE_MEDIUM); in bind_mediumIcon_shouldUseMediumIconSize()
106 mPreference.onBindViewHolder(mViewHolder); in bind_mediumIcon_shouldUseMediumIconSize()
[all …]
DAppHeaderPreferenceTest.java40 private AppHeaderPreference mPreference; field in AppHeaderPreferenceTest
48 mPreference = new AppHeaderPreference(mContext); in setUp()
53 mPreference.onBindViewHolder(mHolder); in setNonSelectable_viewShouldNotBeSelectable()
60 mPreference.onBindViewHolder(mHolder); in defaultInstallType_viewShouldNotBeVisible()
68 mPreference.onBindViewHolder(mHolder); in setIsInstantApp_shouldUpdateInstallType()
69 mPreference.setIsInstantApp(true); in setIsInstantApp_shouldUpdateInstallType()
79 mPreference.setSecondSummary(defaultTestText); in setSecondSummary_shouldUpdateSecondSummary()
80 mPreference.onBindViewHolder(mHolder); in setSecondSummary_shouldUpdateSecondSummary()
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/
DPrimarySwitchPreferenceTest.java47 private PrimarySwitchPreference mPreference; field in PrimarySwitchPreferenceTest
54 mPreference = new PrimarySwitchPreference(mContext); in setUp()
68 mPreference.onBindViewHolder(mHolder); in setChecked_shouldUpdateButtonCheckedState()
70 mPreference.setChecked(true); in setChecked_shouldUpdateButtonCheckedState()
73 mPreference.setChecked(false); in setChecked_shouldUpdateButtonCheckedState()
81 mPreference.onBindViewHolder(mHolder); in setSwitchEnabled_shouldUpdateButtonEnabledState()
83 mPreference.setSwitchEnabled(true); in setSwitchEnabled_shouldUpdateButtonEnabledState()
86 mPreference.setSwitchEnabled(false); in setSwitchEnabled_shouldUpdateButtonEnabledState()
95 mPreference.setSwitchEnabled(false); in setSwitchEnabled_shouldUpdateButtonEnabledState_beforeViewBound()
96 mPreference.onBindViewHolder(mHolder); in setSwitchEnabled_shouldUpdateButtonEnabledState_beforeViewBound()
[all …]
DRestrictedTopLevelPreferenceTest.java39 private RestrictedTopLevelPreference mPreference; field in RestrictedTopLevelPreferenceTest
45 mPreference = spy(new RestrictedTopLevelPreference(mContext)); in setUp()
46 mHelper = spy(new RestrictedPreferenceHelper(mContext, mPreference, null)); in setUp()
47 ReflectionHelpers.setField(mPreference, "mHelper", mHelper); in setUp()
54 mPreference.setEnabled(true); in setEnabled_disabledByAdmin_shouldCallSetDisabledByAdmin()
63 mPreference.setEnabled(true); in setEnabled_notDisabledByAdmin_shouldNotCallSetDisabledByAdmin()
70 mPreference.setDisabledByAdmin(new RestrictedLockUtils.EnforcedAdmin()); in setDisabledByAdmin_shouldNotCallSetEnabled()
72 verify(mPreference, never()).setEnabled(anyBoolean()); in setDisabledByAdmin_shouldNotCallSetEnabled()
DCustomEditTextPreferenceTest.java43 private TestPreference mPreference; field in CustomEditTextPreferenceTest
48 mPreference = new TestPreference(RuntimeEnvironment.application); in setUp()
58 mPreference.onBindDialogView(mView); in bindDialogView_shouldRequestFocus()
65 ReflectionHelpers.setField(mPreference, "mFragment", in getEditText_noDialog_shouldNotCrash()
68 mPreference.getEditText(); in getEditText_noDialog_shouldNotCrash()
DCustomEditTextPreferenceComaptTest.java43 private TestPreference mPreference; field in CustomEditTextPreferenceComaptTest
48 mPreference = new TestPreference(RuntimeEnvironment.application); in setUp()
58 mPreference.onBindDialogView(mView); in bindDialogView_shouldRequestFocus()
65 ReflectionHelpers.setField(mPreference, "mFragment", in getEditText_noDialog_shouldNotCrash()
68 mPreference.getEditText(); in getEditText_noDialog_shouldNotCrash()
DRestrictedSwitchPreferenceTest.java39 private RestrictedSwitchPreference mPreference; field in RestrictedSwitchPreferenceTest
48 mPreference = new RestrictedSwitchPreference(mContext); in setUp()
57 mPreference.setIconSize(SIZE); in onBindViewHolder_setIconSize_shouldHaveCorrectLayoutParam()
59 mPreference.onBindViewHolder(mViewHolder); in onBindViewHolder_setIconSize_shouldHaveCorrectLayoutParam()
67 mPreference.onBindViewHolder(mViewHolder); in onBindViewHolder_notSetIconSize_shouldHaveCorrectLayoutParam()
DRestrictedPreferenceHelperTest.java52 private Preference mPreference; field in RestrictedPreferenceHelperTest
71 mHelper = new RestrictedPreferenceHelper(mContext, mPreference, null); in setUp()
100 verify(mPreference).setSummary(R.string.disabled_by_app_ops_text); in bindPreference_disabledByEcm_shouldDisplayDisabledSummary()
126 verify(mPreference).setEnabled(false); in setDisabledByAdmin_RestrictedPreference_shouldDisablePreference()
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/development/
DEnableAdbPreferenceControllerTest.java65 private RestrictedSwitchPreference mPreference; field in EnableAdbPreferenceControllerTest
79 mPreference = new RestrictedSwitchPreference(mContext); in setUp()
80 mPreference.setKey(mController.getPreferenceKey()); in setUp()
81 when(mScreen.findPreference(mPreference.getKey())).thenReturn(mPreference); in setUp()
90 assertThat(mPreference.isVisible()).isFalse(); in displayPreference_isNotAdmin_shouldRemovePreference()
99 assertThat(mPreference.isVisible()).isTrue(); in displayPreference_isAdmin_shouldNotRemovePreference()
106 mPreference.setChecked(true); in resetPreference_shouldUncheck()
110 assertThat(mPreference.isChecked()).isFalse(); in resetPreference_shouldUncheck()
118 mPreference.setChecked(true); in handlePreferenceTreeClick_shouldUpdateSettings()
121 mController.handlePreferenceTreeClick(mPreference); in handlePreferenceTreeClick_shouldUpdateSettings()
[all …]
DDeveloperOptionsPreferenceControllerTest.java39 private Preference mPreference; field in DeveloperOptionsPreferenceControllerTest
49 doReturn(mPreference).when(mPreferenceScreen).findPreference(TEST_KEY); in setUp()
57 verify(mPreference).setEnabled(true); in onDeveloperOptionsEnabled_shouldEnablePreference()
64 verify(mPreference).setEnabled(false); in onDeveloperOptionsDisabled_shouldDisablePreference()
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/core/
DAbstractPreferenceControllerTest.java44 private Preference mPreference; field in AbstractPreferenceControllerTest
51 mPreference = new Preference(mContext); in setUp()
52 mPreference.setKey(KEY_PREF); in setUp()
53 when(mScreen.findPreference(KEY_PREF)).thenReturn(mPreference); in setUp()
63 assertThat(mPreference.isVisible()).isTrue(); in displayPref_ifAvailable()
72 assertThat(mPreference.isVisible()).isTrue(); in displayPref_noKey_shouldDoNothing()
79 assertThat(mPreference.isVisible()).isTrue(); in setVisible_prefIsVisible_shouldSetToVisible()
86 assertThat(mPreference.isVisible()).isFalse(); in setVisible_prefNotVisible_shouldSetToInvisible()
95 assertThat(mPreference.isVisible()).isFalse(); in doNotDisplayPref_ifNotAvailable()
100 mTestPrefController.updateState(mPreference); in updateState_hasSummary_shouldSetSummary()
[all …]
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/deviceinfo/
DSerialNumberPreferenceControllerTest.java43 private Preference mPreference; field in SerialNumberPreferenceControllerTest
50 mPreference = new Preference(mContext); in setUp()
51 mPreference.setKey(AbstractSerialNumberPreferenceController.KEY_SERIAL_NUMBER); in setUp()
52 when(mScreen.findPreference(mPreference.getKey())).thenReturn(mPreference); in setUp()
75 assertThat(mPreference.isVisible()).isFalse(); in testDisplay_noSerial_shouldHidePreference()
85 assertThat(mPreference.isVisible()).isTrue(); in testDisplay_hasSerial_shouldSetSummary()
86 assertThat(mPreference.getSummary()).isEqualTo(serial); in testDisplay_hasSerial_shouldSetSummary()
DUptimePreferenceControllerTest.java50 private Preference mPreference; field in UptimePreferenceControllerTest
55 doReturn(mPreference).when(mScreen) in setUp()
67 verify(mPreference).setSummary( in testDisplayPreference()
78 verify(mPreference, times(1)).setSummary(any(CharSequence.class)); in testUptimeTick()
82 verify(mPreference, times(2)).setSummary(any(CharSequence.class)); in testUptimeTick()
86 verify(mPreference, times(3)).setSummary(any(CharSequence.class)); in testUptimeTick()
90 verify(mPreference, times(4)).setSummary(any(CharSequence.class)); in testUptimeTick()
DWifiMacAddressPreferenceControllerTest.java62 private Preference mPreference; field in WifiMacAddressPreferenceControllerTest
71 mPreference = new Preference(mContext); in setUp()
73 doReturn(mPreference).when(mScreen) in setUp()
98 assertThat(mPreference.getSummary()) in updateConnectivity_null_setMacUnavailable()
107 assertThat(mPreference.getSummary()).isEqualTo(TEST_MAC_ADDRESS); in updateConnectivity_validMac_setValidMac()
DIpAddressPreferenceControllerTest.java51 private Preference mPreference; field in IpAddressPreferenceControllerTest
56 doReturn(mPreference).when(mScreen) in setUp()
/frameworks/base/core/tests/coretests/src/android/preference/
DPreferenceIconSpaceTest.java43 private TestPreference mPreference; field in PreferenceIconSpaceTest
60 mPreference = new TestPreference(InstrumentationRegistry.getTargetContext()); in setUp()
65 mPreference.setIconSpaceReserved(true); in bindView_iconSpaceReserved_shouldReserveIconSpace()
66 mPreference.bindView(mViewGroup); in bindView_iconSpaceReserved_shouldReserveIconSpace()
74 mPreference.setIconSpaceReserved(false); in bindView_iconSpaceNotReserved_shouldNotReserveIconSpace()
75 mPreference.bindView(mViewGroup); in bindView_iconSpaceNotReserved_shouldNotReserveIconSpace()
83 mPreference.setIcon(new ColorDrawable(Color.BLACK)); in bindView_hasIcon_shouldDisplayIcon()
84 mPreference.bindView(mViewGroup); in bindView_hasIcon_shouldDisplayIcon()
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/development/
DAbstractEnableAdbPreferenceController.java50 protected RestrictedSwitchPreference mPreference; field in AbstractEnableAdbPreferenceController
60 mPreference = (RestrictedSwitchPreference) screen.findPreference(KEY_ENABLE_ADB); in displayPreference()
93 mPreference.setDisabledByAdmin( in onDeveloperOptionsSwitchEnabled()
100 mPreference.setEnabled(enabled); in enablePreference()
105 if (mPreference.isChecked()) { in resetPreference()
106 mPreference.setChecked(false); in resetPreference()
107 handlePreferenceTreeClick(mPreference); in resetPreference()
DDeveloperOptionsPreferenceController.java34 protected Preference mPreference; field in DeveloperOptionsPreferenceController
53 mPreference = screen.findPreference(getPreferenceKey()); in displayPreference()
78 mPreference.setEnabled(true); in onDeveloperOptionsSwitchEnabled()
85 mPreference.setEnabled(false); in onDeveloperOptionsSwitchDisabled()
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/
DRestrictedPreferenceHelper.java51 private final Preference mPreference; field in RestrictedPreferenceHelper
73 mPreference = preference; in RestrictedPreferenceHelper()
282 if (!(mPreference instanceof RestrictedTopLevelPreference)) { in updateDisabledState()
283 mPreference.setEnabled(isEnabled); in updateDisabledState()
286 if (mPreference instanceof PrimarySwitchPreference) { in updateDisabledState()
287 ((PrimarySwitchPreference) mPreference).setSwitchEnabled(isEnabled); in updateDisabledState()
291 mPreference.setSummary(R.string.disabled_by_app_ops_text); in updateDisabledState()

12