use of androidx.preference.Preference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class EnableContentCapturePreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = RuntimeEnvironment.application;
mController = new EnableContentCapturePreferenceController(mContext, "THE_KEY_TO_SUCCESS");
mPreference = new Preference(mContext);
mPreference.setKey(mController.getPreferenceKey());
}
use of androidx.preference.Preference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class WorkPolicyInfoPreferenceControllerTest method handlePreferenceTreeClick_matchingKey_shouldShowWorkPolicyInfo.
@Test
public void handlePreferenceTreeClick_matchingKey_shouldShowWorkPolicyInfo() {
when(mEnterpriseProvider.hasWorkPolicyInfo()).thenReturn(true);
WorkPolicyInfoPreferenceController controller = new WorkPolicyInfoPreferenceController(mContext, "test_key");
final Preference pref = new Preference(mContext);
pref.setKey(controller.getPreferenceKey());
assertThat(controller.handlePreferenceTreeClick(pref)).isTrue();
verify(mEnterpriseProvider).showWorkPolicyInfo();
}
use of androidx.preference.Preference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class EncryptionStatusPreferenceControllerTest method setUp.
@Before
public void setUp() {
mContext = RuntimeEnvironment.application;
mController = new EncryptionStatusPreferenceController(mContext, PREF_KEY_ENCRYPTION_DETAIL_PAGE);
mShadowUserManager = ShadowUserManager.getShadow();
mPreference = new Preference(mContext);
}
use of androidx.preference.Preference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class TrustAgentListPreferenceControllerTest method onResume_shouldClearOldAgents.
@Test
public void onResume_shouldClearOldAgents() {
final Preference oldAgent = new Preference(mActivity);
oldAgent.setKey(PREF_KEY_TRUST_AGENT);
when(mCategory.findPreference(PREF_KEY_TRUST_AGENT)).thenReturn(oldAgent).thenReturn(null);
mController.displayPreference(mScreen);
mController.onResume();
verify(mCategory).removePreference(oldAgent);
}
use of androidx.preference.Preference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ShowPasswordPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = RuntimeEnvironment.application;
mFeatureFactory = FakeFeatureFactory.setupForTest();
when(mFeatureFactory.securityFeatureProvider.getLockPatternUtils(mContext)).thenReturn(mLockPatternUtils);
mController = new ShowPasswordPreferenceController(mContext);
mPreference = new Preference(mContext);
mPreference.setKey(mController.getPreferenceKey());
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
}
Aggregations