Use external/robolectric-shadows/run_robotests.mk
This allows Settings to test against the latest framework changes. Also replaced TestConfig with traditional robolectric.properties. Bug: 73173204 Bug: 73892008 Test: make -j56 RunSettingsRoboTests Change-Id: I3135b4fa5f095ba79b282a76f45dd9baa2584bc7
This commit is contained in:
@@ -16,9 +16,7 @@
|
||||
|
||||
package com.android.settings.development;
|
||||
|
||||
import static com.android.settings.development.HardwareOverlaysPreferenceController
|
||||
.SURFACE_FLINGER_READ_CODE;
|
||||
|
||||
import static com.android.settings.development.HardwareOverlaysPreferenceController.SURFACE_FLINGER_READ_CODE;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyBoolean;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
@@ -35,7 +33,6 @@ import android.os.RemoteException;
|
||||
import android.support.v14.preference.SwitchPreference;
|
||||
import android.support.v7.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.TestConfig;
|
||||
import com.android.settings.testutils.SettingsRobolectricTestRunner;
|
||||
import com.android.settings.testutils.shadow.ShadowParcel;
|
||||
|
||||
@@ -48,7 +45,6 @@ import org.robolectric.annotation.Config;
|
||||
import org.robolectric.util.ReflectionHelpers;
|
||||
|
||||
@RunWith(SettingsRobolectricTestRunner.class)
|
||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
||||
public class HardwareOverlaysPreferenceControllerTest {
|
||||
|
||||
@Mock
|
||||
@@ -90,8 +86,8 @@ public class HardwareOverlaysPreferenceControllerTest {
|
||||
@Config(shadows = {ShadowParcel.class})
|
||||
public void updateState_settingEnabled_shouldCheckPreference() throws RemoteException {
|
||||
ShadowParcel.sReadIntResult = 1;
|
||||
doReturn(true).when(mSurfaceFlinger).transact(eq(SURFACE_FLINGER_READ_CODE), any(), any(),
|
||||
eq(0 /* flags */));
|
||||
doReturn(true).when(mSurfaceFlinger)
|
||||
.transact(eq(SURFACE_FLINGER_READ_CODE), any(), any(), eq(0 /* flags */));
|
||||
mController.updateState(mPreference);
|
||||
|
||||
verify(mPreference).setChecked(true);
|
||||
@@ -101,8 +97,8 @@ public class HardwareOverlaysPreferenceControllerTest {
|
||||
@Config(shadows = {ShadowParcel.class})
|
||||
public void updateState_settingDisabled_shouldUnCheckPreference() throws RemoteException {
|
||||
ShadowParcel.sReadIntResult = 0;
|
||||
doReturn(true).when(mSurfaceFlinger).transact(eq(SURFACE_FLINGER_READ_CODE), any(), any(),
|
||||
eq(0 /* flags */));
|
||||
doReturn(true).when(mSurfaceFlinger)
|
||||
.transact(eq(SURFACE_FLINGER_READ_CODE), any(), any(), eq(0 /* flags */));
|
||||
mController.updateState(mPreference);
|
||||
|
||||
verify(mPreference).setChecked(false);
|
||||
|
Reference in New Issue
Block a user