Let fragment and indexProvider share prefControllers

Bug: 35812240
Test: make RunSettingsRoboTests
Change-Id: Ifd96f935836a52e0a56f170f3cdf9b9ddf7c499a
This commit is contained in:
Fan Zhang
2017-02-28 10:52:46 -08:00
parent 6c146f2ab5
commit b00811da64
17 changed files with 265 additions and 255 deletions

View File

@@ -22,9 +22,6 @@ import android.telephony.TelephonyManager;
import com.android.settings.SettingsRobolectricTestRunner;
import com.android.settings.TestConfig;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,8 +30,10 @@ import org.mockito.MockitoAnnotations;
import org.robolectric.annotation.Config;
import org.robolectric.shadows.ShadowApplication;
import java.util.ArrayList;
import java.util.List;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Mockito.when;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@@ -61,8 +60,7 @@ public class CastPreferenceControllerTest {
}
@Test
public void updateNonIndexableKeys_voiceCapable_shouldNotUpdate() {
when(mTelephonyManager.isVoiceCapable()).thenReturn(true);
public void updateNonIndexableKeys_shouldNotUpdate() {
final List<String> keys = new ArrayList<>();
mController.updateNonIndexableKeys(keys);
@@ -70,14 +68,4 @@ public class CastPreferenceControllerTest {
assertThat(keys).isEmpty();
}
@Test
public void updateNonIndexableKeys_voiceIncapable_shouldUpdate() {
when(mTelephonyManager.isVoiceCapable()).thenReturn(false);
final List<String> keys = new ArrayList<>();
mController.updateNonIndexableKeys(keys);
assertThat(keys).isNotEmpty();
}
}