use of com.android.settingslib.widget.RadioButtonPreference in project android_packages_apps_Settings by omnirom.
the class WebViewAppPickerTest method testSuccessfulClickChangesProvider.
private void testSuccessfulClickChangesProvider() {
when(mWvusWrapper.getValidWebViewApplicationInfos(any())).thenReturn(Collections.singletonList(createApplicationInfo(PACKAGE_NAME)));
when(mWvusWrapper.setWebViewProvider(eq(PACKAGE_NAME))).thenReturn(true);
RadioButtonPreference defaultPackagePref = mock(RadioButtonPreference.class);
when(defaultPackagePref.getKey()).thenReturn(PACKAGE_NAME);
mPicker.onRadioButtonClicked(defaultPackagePref);
verify(mWvusWrapper, times(1)).setWebViewProvider(eq(PACKAGE_NAME));
verify(mPicker, times(1)).updateCheckedState(PACKAGE_NAME);
verify(mWvusWrapper, never()).showInvalidChoiceToast(any());
}
use of com.android.settingslib.widget.RadioButtonPreference in project android_packages_apps_Settings by omnirom.
the class WebViewAppPickerTest method testEnabledPackageShownAsEnabled.
@Test
public void testEnabledPackageShownAsEnabled() {
String disabledReason = "";
DefaultAppInfo webviewAppInfo = mPicker.createDefaultAppInfo(mContext, mContext.getPackageManager(), createApplicationInfo(PACKAGE_NAME), disabledReason);
RadioButtonPreference preference = mock(RadioButtonPreference.class);
mPicker.bindPreference(preference, PACKAGE_NAME, webviewAppInfo, null);
mPicker.bindPreferenceExtra(preference, PACKAGE_NAME, webviewAppInfo, null, null);
verify(preference, times(1)).setEnabled(eq(true));
verify(preference, never()).setEnabled(eq(false));
}
Aggregations