From 4824ff3d008fb7165293df8673490f3e79987d63 Mon Sep 17 00:00:00 2001 From: jeffreyhuang Date: Mon, 27 Nov 2017 15:42:25 -0800 Subject: [PATCH] Move bluetooth test package to sdk 26 Test: make RunSettingsRoboTests -j40 Change-Id: I26e6f437052caafd97f3f164b388d379fc890e7e --- .../android/settings/bluetooth/AlwaysDiscoverableTest.java | 2 +- .../bluetooth/BluetoothDetailsButtonsControllerTest.java | 2 +- .../bluetooth/BluetoothDetailsControllerTestBase.java | 6 ++++++ .../bluetooth/BluetoothDeviceDetailsFragmentTest.java | 2 +- .../BluetoothDeviceNamePreferenceControllerTest.java | 2 +- .../settings/bluetooth/BluetoothDevicePreferenceTest.java | 2 +- .../BluetoothDeviceRenamePreferenceControllerTest.java | 2 +- .../android/settings/bluetooth/BluetoothEnablerTest.java | 2 +- .../bluetooth/BluetoothFilesPreferenceControllerTest.java | 2 +- .../BluetoothMasterSwitchPreferenceControllerTest.java | 2 +- .../settings/bluetooth/BluetoothPairingDetailTest.java | 2 +- .../settings/bluetooth/BluetoothPairingDialogTest.java | 2 +- .../bluetooth/BluetoothPairingPreferenceControllerTest.java | 2 +- .../bluetooth/BluetoothSettingsSummaryProviderTest.java | 2 +- .../android/settings/bluetooth/BluetoothSettingsTest.java | 2 +- .../settings/bluetooth/BluetoothSummaryUpdaterTest.java | 2 +- .../bluetooth/DeviceListPreferenceFragmentTest.java | 2 +- .../settings/bluetooth/DevicePickerFragmentTest.java | 2 +- .../settings/bluetooth/DeviceProfilesSettingsTest.java | 2 +- .../settings/bluetooth/ForgetDeviceDialogFragmentTest.java | 2 +- .../bluetooth/RemoteDeviceNameDialogFragmentTest.java | 2 +- .../src/com/android/settings/bluetooth/UtilsTest.java | 2 +- 22 files changed, 27 insertions(+), 21 deletions(-) diff --git a/tests/robotests/src/com/android/settings/bluetooth/AlwaysDiscoverableTest.java b/tests/robotests/src/com/android/settings/bluetooth/AlwaysDiscoverableTest.java index fd46b4b3727..3cc90bd94c8 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/AlwaysDiscoverableTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/AlwaysDiscoverableTest.java @@ -41,7 +41,7 @@ import org.mockito.MockitoAnnotations; import org.robolectric.annotation.Config; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O) public class AlwaysDiscoverableTest { @Mock private LocalBluetoothAdapter mLocalAdapter; diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsButtonsControllerTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsButtonsControllerTest.java index 7b0a3f23f03..e7ce7e07077 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsButtonsControllerTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsButtonsControllerTest.java @@ -43,7 +43,7 @@ import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = SettingsShadowBluetoothDevice.class) public class BluetoothDetailsButtonsControllerTest extends BluetoothDetailsControllerTestBase { private BluetoothDetailsButtonsController mController; diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsControllerTestBase.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsControllerTestBase.java index 33a5ed59438..b03ecc102aa 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsControllerTestBase.java +++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsControllerTestBase.java @@ -28,14 +28,20 @@ import android.support.v7.preference.PreferenceManager; import android.support.v7.preference.PreferenceScreen; import com.android.settings.R; +import com.android.settings.TestConfig; +import com.android.settings.testutils.SettingsRobolectricTestRunner; import com.android.settingslib.bluetooth.CachedBluetoothDevice; import com.android.settingslib.core.lifecycle.Lifecycle; import org.junit.Before; +import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.robolectric.RuntimeEnvironment; +import org.robolectric.annotation.Config; +@RunWith(SettingsRobolectricTestRunner.class) +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O) public class BluetoothDetailsControllerTestBase { protected Context mContext; protected Lifecycle mLifecycle; diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragmentTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragmentTest.java index 544b5903c9c..cd07a905066 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragmentTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragmentTest.java @@ -53,7 +53,7 @@ import org.robolectric.annotation.Config; import org.robolectric.fakes.RoboMenu; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O) public class BluetoothDeviceDetailsFragmentTest { private BluetoothDeviceDetailsFragment mFragment; private Context mContext; diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceNamePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceNamePreferenceControllerTest.java index 2e094e24071..93de52d63c4 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceNamePreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceNamePreferenceControllerTest.java @@ -40,7 +40,7 @@ import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O) public class BluetoothDeviceNamePreferenceControllerTest { private static final String DEVICE_NAME = "Nightshade"; private static final int ORDER = 1; diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDevicePreferenceTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDevicePreferenceTest.java index bc1151bbb6a..3dd97bb0753 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDevicePreferenceTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDevicePreferenceTest.java @@ -49,7 +49,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = SettingsShadowResources.class) public class BluetoothDevicePreferenceTest { private static final boolean SHOW_DEVICES_WITHOUT_NAMES = true; diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceRenamePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceRenamePreferenceControllerTest.java index cde95cd5b16..186e274855d 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceRenamePreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceRenamePreferenceControllerTest.java @@ -43,7 +43,7 @@ import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O) public class BluetoothDeviceRenamePreferenceControllerTest { private static final String DEVICE_NAME = "Nightshade"; diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothEnablerTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothEnablerTest.java index b973edb674d..102f0a76127 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothEnablerTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothEnablerTest.java @@ -58,7 +58,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = { +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = { SettingsShadowResources.class, SettingsShadowResources.SettingsShadowTheme.class }) public class BluetoothEnablerTest { diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothFilesPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothFilesPreferenceControllerTest.java index cdaf87637ce..ed63fc45edf 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothFilesPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothFilesPreferenceControllerTest.java @@ -35,7 +35,7 @@ import org.robolectric.annotation.Config; import org.robolectric.shadows.ShadowApplication; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O) public class BluetoothFilesPreferenceControllerTest { private Context mContext; private BluetoothFilesPreferenceController mController; diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothMasterSwitchPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothMasterSwitchPreferenceControllerTest.java index c9d57461c62..534cace1745 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothMasterSwitchPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothMasterSwitchPreferenceControllerTest.java @@ -47,7 +47,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O) public class BluetoothMasterSwitchPreferenceControllerTest { @Mock(answer = Answers.RETURNS_DEEP_STUBS) diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDetailTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDetailTest.java index d1d49354403..2b30ae404cf 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDetailTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDetailTest.java @@ -52,7 +52,7 @@ import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O) public class BluetoothPairingDetailTest { @Mock diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDialogTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDialogTest.java index fba11de8066..25a24d4a381 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDialogTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDialogTest.java @@ -53,7 +53,7 @@ import org.robolectric.shadows.ShadowApplication; import org.robolectric.util.FragmentTestUtil; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows=ShadowEventLogWriter.class) public class BluetoothPairingDialogTest { diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingPreferenceControllerTest.java index 4459f6197e4..192e447fc30 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingPreferenceControllerTest.java @@ -49,7 +49,7 @@ import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O) public class BluetoothPairingPreferenceControllerTest { private static final int ORDER = 1; private Context mContext; diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothSettingsSummaryProviderTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothSettingsSummaryProviderTest.java index 0061ee52ea1..e7a66fabe1c 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothSettingsSummaryProviderTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothSettingsSummaryProviderTest.java @@ -35,7 +35,7 @@ import org.robolectric.annotation.Config; import static org.mockito.Mockito.verify; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O) public class BluetoothSettingsSummaryProviderTest { private Context mContext; diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothSettingsTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothSettingsTest.java index c772560d717..b17772962b3 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothSettingsTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothSettingsTest.java @@ -50,7 +50,7 @@ import org.robolectric.annotation.Config; import java.util.List; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O) public class BluetoothSettingsTest { private static final String FOOTAGE_MAC_STRING = "Bluetooth mac: xxxx"; diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothSummaryUpdaterTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothSummaryUpdaterTest.java index 0c27412c551..cb04347cdb8 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothSummaryUpdaterTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothSummaryUpdaterTest.java @@ -51,7 +51,7 @@ import java.util.HashSet; import java.util.Set; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O) public class BluetoothSummaryUpdaterTest { private static final String DEVICE_NAME = "Nightshade"; private static final String DEVICE_KEYBOARD_NAME = "Bluetooth Keyboard"; diff --git a/tests/robotests/src/com/android/settings/bluetooth/DeviceListPreferenceFragmentTest.java b/tests/robotests/src/com/android/settings/bluetooth/DeviceListPreferenceFragmentTest.java index 49efecbc42c..169db240ee8 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/DeviceListPreferenceFragmentTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/DeviceListPreferenceFragmentTest.java @@ -49,7 +49,7 @@ import org.robolectric.annotation.Config; import java.util.List; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O) public class DeviceListPreferenceFragmentTest { private static final String FOOTAGE_MAC_STRING = "Bluetooth mac: xxxx"; diff --git a/tests/robotests/src/com/android/settings/bluetooth/DevicePickerFragmentTest.java b/tests/robotests/src/com/android/settings/bluetooth/DevicePickerFragmentTest.java index 3294ffd0405..f9b392e926c 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/DevicePickerFragmentTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/DevicePickerFragmentTest.java @@ -30,7 +30,7 @@ import org.mockito.MockitoAnnotations; import org.robolectric.annotation.Config; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O) public class DevicePickerFragmentTest { @Mock private LocalBluetoothAdapter mLocalAdapter; diff --git a/tests/robotests/src/com/android/settings/bluetooth/DeviceProfilesSettingsTest.java b/tests/robotests/src/com/android/settings/bluetooth/DeviceProfilesSettingsTest.java index a6793bb20df..56454b8f67c 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/DeviceProfilesSettingsTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/DeviceProfilesSettingsTest.java @@ -56,7 +56,7 @@ import java.util.ArrayList; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = { +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = { ShadowEventLogWriter.class }) public class DeviceProfilesSettingsTest { diff --git a/tests/robotests/src/com/android/settings/bluetooth/ForgetDeviceDialogFragmentTest.java b/tests/robotests/src/com/android/settings/bluetooth/ForgetDeviceDialogFragmentTest.java index 93437212bdb..71e99330866 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/ForgetDeviceDialogFragmentTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/ForgetDeviceDialogFragmentTest.java @@ -46,7 +46,7 @@ import org.robolectric.annotation.Config; import org.robolectric.shadows.ShadowDialog; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O) public class ForgetDeviceDialogFragmentTest { @Mock(answer = Answers.RETURNS_DEEP_STUBS) diff --git a/tests/robotests/src/com/android/settings/bluetooth/RemoteDeviceNameDialogFragmentTest.java b/tests/robotests/src/com/android/settings/bluetooth/RemoteDeviceNameDialogFragmentTest.java index a8ef4e6df5c..65fe46c4e0b 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/RemoteDeviceNameDialogFragmentTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/RemoteDeviceNameDialogFragmentTest.java @@ -50,7 +50,7 @@ import org.robolectric.shadows.ShadowDialog; import org.robolectric.util.FragmentTestUtil; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O) public class RemoteDeviceNameDialogFragmentTest { @Mock(answer = Answers.RETURNS_DEEP_STUBS) diff --git a/tests/robotests/src/com/android/settings/bluetooth/UtilsTest.java b/tests/robotests/src/com/android/settings/bluetooth/UtilsTest.java index e0d46388f44..43583ed29d7 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/UtilsTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/UtilsTest.java @@ -41,7 +41,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = SettingsShadowResources.class) public class UtilsTest {