Some Settings Tests are currently broken, disabling for now Bug: 147464840 Test: make RunRoboSettingsTests Change-Id: I7c00faa00ce91030e76b7d4d028f6a30e471738f
55 lines
1.6 KiB
Java
55 lines
1.6 KiB
Java
package com.android.settings.wifi;
|
|
|
|
import static com.google.common.truth.Truth.assertThat;
|
|
|
|
import static org.mockito.Mockito.spy;
|
|
|
|
import android.content.Context;
|
|
|
|
import com.android.settings.testutils.XmlTestUtils;
|
|
|
|
import org.junit.Before;
|
|
import org.junit.Ignore;
|
|
import org.junit.Test;
|
|
import org.junit.runner.RunWith;
|
|
import org.robolectric.RobolectricTestRunner;
|
|
import org.robolectric.RuntimeEnvironment;
|
|
import org.robolectric.annotation.Config;
|
|
|
|
import java.util.List;
|
|
|
|
@RunWith(RobolectricTestRunner.class)
|
|
public class ConfigureWifiSettingsTest {
|
|
|
|
private Context mContext;
|
|
|
|
@Before
|
|
public void setUp() {
|
|
mContext = spy(RuntimeEnvironment.application);
|
|
}
|
|
|
|
@Test
|
|
@Ignore
|
|
public void testNonIndexableKeys_existInXmlLayout() {
|
|
final List<String> niks =
|
|
ConfigureWifiSettings.SEARCH_INDEX_DATA_PROVIDER.getNonIndexableKeys(mContext);
|
|
final int xmlId = new ConfigureWifiSettings().getPreferenceScreenResId();
|
|
|
|
final List<String> keys = XmlTestUtils.getKeysFromPreferenceXml(mContext, xmlId);
|
|
|
|
assertThat(keys).containsAllIn(niks);
|
|
}
|
|
|
|
@Test
|
|
@Config(qualifiers = "mcc999")
|
|
public void testNonIndexableKeys_ifPageDisabled_shouldNotIndexResource() {
|
|
final List<String> niks =
|
|
ConfigureWifiSettings.SEARCH_INDEX_DATA_PROVIDER.getNonIndexableKeys(mContext);
|
|
final int xmlId = new ConfigureWifiSettings().getPreferenceScreenResId();
|
|
|
|
final List<String> keys = XmlTestUtils.getKeysFromPreferenceXml(mContext, xmlId);
|
|
assertThat(keys).isNotNull();
|
|
assertThat(niks).containsAllIn(keys);
|
|
}
|
|
}
|