Merge "Allow Magnification Settings launch from outside of AccessibilitySettings" into udc-dev

This commit is contained in:
TreeHugger Robot
2023-02-24 18:54:44 +00:00
committed by Android (Google) Code Review
4 changed files with 44 additions and 12 deletions

View File

@@ -23,6 +23,7 @@ import static com.android.settings.accessibility.ToggleFeaturePreferenceFragment
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
@@ -405,6 +406,17 @@ public class ToggleScreenMagnificationPreferenceFragmentTest {
assertThat(mFragment.getHelpResource()).isEqualTo(R.string.help_url_magnification);
}
@Test
public void onProcessArguments_defaultArgumentUnavailable_shouldSetDefaultArguments() {
Bundle arguments = new Bundle();
mFragment.onProcessArguments(arguments);
assertTrue(arguments.containsKey(AccessibilitySettings.EXTRA_PREFERENCE_KEY));
assertTrue(arguments.containsKey(AccessibilitySettings.EXTRA_INTRO));
assertTrue(arguments.containsKey(AccessibilitySettings.EXTRA_HTML_DESCRIPTION));
}
private void putStringIntoSettings(String key, String componentName) {
Settings.Secure.putString(mContext.getContentResolver(), key, componentName);
}