• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package com.android.settings.wifi;
2 
3 import static com.google.common.truth.Truth.assertThat;
4 
5 import static org.mockito.Mockito.spy;
6 
7 import android.content.Context;
8 
9 import com.android.settings.testutils.XmlTestUtils;
10 
11 import org.junit.Before;
12 import org.junit.Test;
13 import org.junit.runner.RunWith;
14 import org.robolectric.RobolectricTestRunner;
15 import org.robolectric.RuntimeEnvironment;
16 import org.robolectric.annotation.Config;
17 
18 import java.util.List;
19 
20 @RunWith(RobolectricTestRunner.class)
21 public class ConfigureWifiSettingsTest {
22 
23     private Context mContext;
24 
25     @Before
setUp()26     public void setUp() {
27         mContext = spy(RuntimeEnvironment.application);
28     }
29 
30     @Test
31     @Config(qualifiers = "mcc999")
testNonIndexableKeys_ifPageDisabled_shouldNotIndexResource()32     public void testNonIndexableKeys_ifPageDisabled_shouldNotIndexResource() {
33         final List<String> niks =
34             ConfigureWifiSettings.SEARCH_INDEX_DATA_PROVIDER.getNonIndexableKeys(mContext);
35         final int xmlId = new ConfigureWifiSettings().getPreferenceScreenResId();
36 
37         final List<String> keys = XmlTestUtils.getKeysFromPreferenceXml(mContext, xmlId);
38         assertThat(keys).isNotNull();
39         assertThat(niks).containsAtLeastElementsIn(keys);
40     }
41 }
42