Add SearchIndexable to improve search coverage
- Add searachIndex test - Increase accessibility framework feature fragment coverage Bug: 197695932 Test: make RunSettingsRoboTests Change-Id: Icb7e2cf70bb0443304af7866efd48bed1d9af5bf
This commit is contained in:
@@ -18,6 +18,7 @@ package com.android.settings.accessibility;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
@@ -25,6 +26,7 @@ import androidx.test.core.app.ApplicationProvider;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.testutils.XmlTestUtils;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
@@ -35,7 +37,30 @@ import java.util.List;
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class AudioAdjustmentFragmentTest {
|
||||
|
||||
private Context mContext = ApplicationProvider.getApplicationContext();
|
||||
private final Context mContext = ApplicationProvider.getApplicationContext();
|
||||
private AudioAdjustmentFragment mFragment;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mFragment = new AudioAdjustmentFragment();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getMetricsCategory_returnsCorrectCategory() {
|
||||
assertThat(mFragment.getMetricsCategory()).isEqualTo(
|
||||
SettingsEnums.ACCESSIBILITY_AUDIO_ADJUSTMENT);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getPreferenceScreenResId_returnsCorrectXml() {
|
||||
assertThat(mFragment.getPreferenceScreenResId()).isEqualTo(
|
||||
R.xml.accessibility_audio_adjustment);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getLogTag_returnsCorrectTag() {
|
||||
assertThat(mFragment.getLogTag()).isEqualTo("AudioAdjustmentFragment");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getNonIndexableKeys_existInXmlLayout() {
|
||||
|
Reference in New Issue
Block a user