Loading tests/robotests/src/com/android/settings/DisplaySettingsTest.java +3 −5 Original line number Diff line number Diff line Loading @@ -4,15 +4,14 @@ import static com.google.common.truth.Truth.assertThat; import android.content.Context; import androidx.test.core.app.ApplicationProvider; import com.android.settings.testutils.XmlTestUtils; import com.android.settings.testutils.shadow.ShadowPowerManager; import com.android.settingslib.core.AbstractPreferenceController; 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.ArrayList; import java.util.List; Loading @@ -21,9 +20,8 @@ import java.util.List; public class DisplaySettingsTest { @Test @Config(shadows = ShadowPowerManager.class) public void testPreferenceControllers_getPreferenceKeys_existInPreferenceScreen() { final Context context = RuntimeEnvironment.application; final Context context = ApplicationProvider.getApplicationContext(); final DisplaySettings fragment = new DisplaySettings(); final List<String> preferenceScreenKeys = XmlTestUtils.getKeysFromPreferenceXml(context, fragment.getPreferenceScreenResId()); Loading tests/robotests/src/com/android/settings/testutils/shadow/ShadowPowerManager.javadeleted 100644 → 0 +0 −38 Original line number Diff line number Diff line /* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.android.settings.testutils.shadow; import android.os.PowerManager; import org.robolectric.annotation.Implementation; import org.robolectric.annotation.Implements; @Implements(PowerManager.class) public class ShadowPowerManager { @Implementation protected int getMinimumScreenBrightnessSetting() { return 0; } @Implementation protected int getMaximumScreenBrightnessSetting() { return 0; } } Loading
tests/robotests/src/com/android/settings/DisplaySettingsTest.java +3 −5 Original line number Diff line number Diff line Loading @@ -4,15 +4,14 @@ import static com.google.common.truth.Truth.assertThat; import android.content.Context; import androidx.test.core.app.ApplicationProvider; import com.android.settings.testutils.XmlTestUtils; import com.android.settings.testutils.shadow.ShadowPowerManager; import com.android.settingslib.core.AbstractPreferenceController; 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.ArrayList; import java.util.List; Loading @@ -21,9 +20,8 @@ import java.util.List; public class DisplaySettingsTest { @Test @Config(shadows = ShadowPowerManager.class) public void testPreferenceControllers_getPreferenceKeys_existInPreferenceScreen() { final Context context = RuntimeEnvironment.application; final Context context = ApplicationProvider.getApplicationContext(); final DisplaySettings fragment = new DisplaySettings(); final List<String> preferenceScreenKeys = XmlTestUtils.getKeysFromPreferenceXml(context, fragment.getPreferenceScreenResId()); Loading
tests/robotests/src/com/android/settings/testutils/shadow/ShadowPowerManager.javadeleted 100644 → 0 +0 −38 Original line number Diff line number Diff line /* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.android.settings.testutils.shadow; import android.os.PowerManager; import org.robolectric.annotation.Implementation; import org.robolectric.annotation.Implements; @Implements(PowerManager.class) public class ShadowPowerManager { @Implementation protected int getMinimumScreenBrightnessSetting() { return 0; } @Implementation protected int getMaximumScreenBrightnessSetting() { return 0; } }