Use framework support to customize dividers between prefs.
Bug: 33579296 Test: make RunSettingsRoboTests Change-Id: I1bb3b82b88dc727cda05b00058e6f40564f0e5db
This commit is contained in:
@@ -19,10 +19,6 @@ package com.android.settings;
|
||||
import android.content.Context;
|
||||
import android.os.UserManager;
|
||||
import android.support.v7.preference.PreferenceScreen;
|
||||
import android.test.AndroidTestCase;
|
||||
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
import com.android.settingslib.DeviceInfoUtils;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -33,14 +29,13 @@ import org.mockito.MockitoAnnotations;
|
||||
import org.robolectric.annotation.Config;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth.assertWithMessage;
|
||||
import static org.mockito.Mockito.doReturn;
|
||||
import static org.mockito.Mockito.spy;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@RunWith(SettingsRobolectricTestRunner.class)
|
||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
||||
public class DeviceInfoSettingsTest extends AndroidTestCase {
|
||||
public class DeviceInfoSettingsTest {
|
||||
|
||||
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
|
||||
private Context mContext;
|
||||
@@ -49,21 +44,18 @@ public class DeviceInfoSettingsTest extends AndroidTestCase {
|
||||
@Mock
|
||||
private UserManager mUserManager;
|
||||
|
||||
private FakeFeatureFactory mFeatureFactory;
|
||||
private DeviceInfoSettings mSettings;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
FakeFeatureFactory.setupForTest(mContext);
|
||||
mFeatureFactory = (FakeFeatureFactory) FakeFeatureFactory.getFactory(mContext);
|
||||
when(mContext.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
|
||||
mSettings = spy(new DeviceInfoSettings());
|
||||
doReturn(mScreen).when(mSettings).getPreferenceScreen();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getPrefXml_shoudlReturnDeviceInfoXml() {
|
||||
public void getPrefXml_shouldReturnDeviceInfoXml() {
|
||||
assertThat(mSettings.getPreferenceScreenResId()).isEqualTo(R.xml.device_info_settings);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user