diff --git a/tests/robotests/src/com/android/settings/testutils/shadow/ShadowBidiFormatter.java b/tests/robotests/src/com/android/settings/testutils/shadow/ShadowBidiFormatter.java new file mode 100644 index 00000000000..66d7338f9bd --- /dev/null +++ b/tests/robotests/src/com/android/settings/testutils/shadow/ShadowBidiFormatter.java @@ -0,0 +1,31 @@ +/* + * 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.support.v4.text.BidiFormatter; +import android.support.v4.text.TextDirectionHeuristicCompat; + +import org.robolectric.annotation.Implements; + +@Implements(BidiFormatter.class) +public class ShadowBidiFormatter { + + public CharSequence unicodeWrap(CharSequence str, TextDirectionHeuristicCompat heuristic, + boolean isolate) { + return str; + } +} diff --git a/tests/robotests/src/com/android/settings/wifi/CellularFallbackPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/CellularFallbackPreferenceControllerTest.java index 415cd92bf6f..84d73c174aa 100644 --- a/tests/robotests/src/com/android/settings/wifi/CellularFallbackPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/wifi/CellularFallbackPreferenceControllerTest.java @@ -34,7 +34,7 @@ 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) +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O) public class CellularFallbackPreferenceControllerTest { @Mock(answer = Answers.RETURNS_DEEP_STUBS) diff --git a/tests/robotests/src/com/android/settings/wifi/ConfigureWifiSettingsTest.java b/tests/robotests/src/com/android/settings/wifi/ConfigureWifiSettingsTest.java index 687287be8a4..3cd5ee86a4b 100644 --- a/tests/robotests/src/com/android/settings/wifi/ConfigureWifiSettingsTest.java +++ b/tests/robotests/src/com/android/settings/wifi/ConfigureWifiSettingsTest.java @@ -23,7 +23,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 ConfigureWifiSettingsTest { private Context mContext; diff --git a/tests/robotests/src/com/android/settings/wifi/ConnectedAccessPointPreferenceTest.java b/tests/robotests/src/com/android/settings/wifi/ConnectedAccessPointPreferenceTest.java index 2eaa5875012..5a38c4e5342 100644 --- a/tests/robotests/src/com/android/settings/wifi/ConnectedAccessPointPreferenceTest.java +++ b/tests/robotests/src/com/android/settings/wifi/ConnectedAccessPointPreferenceTest.java @@ -37,7 +37,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 ConnectedAccessPointPreferenceTest { @Mock private AccessPoint mAccessPoint; diff --git a/tests/robotests/src/com/android/settings/wifi/LinkablePreferenceTest.java b/tests/robotests/src/com/android/settings/wifi/LinkablePreferenceTest.java index 9321827864f..f8d8428a442 100644 --- a/tests/robotests/src/com/android/settings/wifi/LinkablePreferenceTest.java +++ b/tests/robotests/src/com/android/settings/wifi/LinkablePreferenceTest.java @@ -38,7 +38,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 LinkablePreferenceTest { private static final String TITLE = "Title"; diff --git a/tests/robotests/src/com/android/settings/wifi/NotifyOpenNetworkPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/NotifyOpenNetworkPreferenceControllerTest.java index b83a3e3f628..f1299f4d26c 100644 --- a/tests/robotests/src/com/android/settings/wifi/NotifyOpenNetworkPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/wifi/NotifyOpenNetworkPreferenceControllerTest.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 NotifyOpenNetworkPreferenceControllerTest { private Context mContext; diff --git a/tests/robotests/src/com/android/settings/wifi/SavedAccessPointsWifiSettingsTest.java b/tests/robotests/src/com/android/settings/wifi/SavedAccessPointsWifiSettingsTest.java index ec406cd464c..d157615ed27 100644 --- a/tests/robotests/src/com/android/settings/wifi/SavedAccessPointsWifiSettingsTest.java +++ b/tests/robotests/src/com/android/settings/wifi/SavedAccessPointsWifiSettingsTest.java @@ -37,7 +37,7 @@ import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O) public class SavedAccessPointsWifiSettingsTest { @Mock private WifiManagerWrapper mockWifiManager; diff --git a/tests/robotests/src/com/android/settings/wifi/UseOpenWifiPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/UseOpenWifiPreferenceControllerTest.java index 16d883a2371..851c4c21173 100644 --- a/tests/robotests/src/com/android/settings/wifi/UseOpenWifiPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/wifi/UseOpenWifiPreferenceControllerTest.java @@ -58,7 +58,7 @@ import java.util.ArrayList; 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 UseOpenWifiPreferenceControllerTest { private static ComponentName sEnableActivityComponent; private static NetworkScorerAppData sAppData; diff --git a/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java b/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java index e9b61463c08..7cef9ce12f3 100644 --- a/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java +++ b/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java @@ -41,7 +41,7 @@ import static com.google.common.truth.Truth.assertThat; import static org.mockito.Mockito.*; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = ShadowConnectivityManager.class) public class WifiConfigControllerTest { diff --git a/tests/robotests/src/com/android/settings/wifi/WifiDialogTest.java b/tests/robotests/src/com/android/settings/wifi/WifiDialogTest.java index 00941ad1662..1460c339bad 100644 --- a/tests/robotests/src/com/android/settings/wifi/WifiDialogTest.java +++ b/tests/robotests/src/com/android/settings/wifi/WifiDialogTest.java @@ -21,7 +21,7 @@ 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 = ShadowEntityHeaderController.class) public class WifiDialogTest { @Mock private AccessPoint mockAccessPoint; diff --git a/tests/robotests/src/com/android/settings/wifi/WifiEnablerTest.java b/tests/robotests/src/com/android/settings/wifi/WifiEnablerTest.java index 63f89e62c5c..b9dbae575c2 100644 --- a/tests/robotests/src/com/android/settings/wifi/WifiEnablerTest.java +++ b/tests/robotests/src/com/android/settings/wifi/WifiEnablerTest.java @@ -38,7 +38,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 WifiEnablerTest { @Mock diff --git a/tests/robotests/src/com/android/settings/wifi/WifiInfoPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/WifiInfoPreferenceControllerTest.java index cf3cca75d1a..7582143791a 100644 --- a/tests/robotests/src/com/android/settings/wifi/WifiInfoPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/wifi/WifiInfoPreferenceControllerTest.java @@ -46,7 +46,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 WifiInfoPreferenceControllerTest { @Mock diff --git a/tests/robotests/src/com/android/settings/wifi/WifiMasterSwitchPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/WifiMasterSwitchPreferenceControllerTest.java index 307cccbfd0b..8523ceadfe6 100644 --- a/tests/robotests/src/com/android/settings/wifi/WifiMasterSwitchPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/wifi/WifiMasterSwitchPreferenceControllerTest.java @@ -45,7 +45,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 WifiMasterSwitchPreferenceControllerTest { @Mock(answer = Answers.RETURNS_DEEP_STUBS) diff --git a/tests/robotests/src/com/android/settings/wifi/WifiSummaryUpdaterTest.java b/tests/robotests/src/com/android/settings/wifi/WifiSummaryUpdaterTest.java index 4507e548d1c..a9757bd37bc 100644 --- a/tests/robotests/src/com/android/settings/wifi/WifiSummaryUpdaterTest.java +++ b/tests/robotests/src/com/android/settings/wifi/WifiSummaryUpdaterTest.java @@ -44,7 +44,7 @@ import static org.mockito.Mockito.spy; 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 WifiSummaryUpdaterTest { @Mock(answer = Answers.RETURNS_DEEP_STUBS) diff --git a/tests/robotests/src/com/android/settings/wifi/WifiUtilsTest.java b/tests/robotests/src/com/android/settings/wifi/WifiUtilsTest.java index 1ccdb1f6eff..3cdcee48ec4 100644 --- a/tests/robotests/src/com/android/settings/wifi/WifiUtilsTest.java +++ b/tests/robotests/src/com/android/settings/wifi/WifiUtilsTest.java @@ -27,7 +27,7 @@ import org.robolectric.annotation.Config; import static com.google.common.truth.Truth.assertThat; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O) public class WifiUtilsTest { @Test diff --git a/tests/robotests/src/com/android/settings/wifi/WifiWakeupPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/WifiWakeupPreferenceControllerTest.java index 29df5397bde..07f2d308e29 100644 --- a/tests/robotests/src/com/android/settings/wifi/WifiWakeupPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/wifi/WifiWakeupPreferenceControllerTest.java @@ -46,7 +46,7 @@ import org.robolectric.annotation.Config; @RunWith(SettingsRobolectricTestRunner.class) @Config( manifest = TestConfig.MANIFEST_PATH, - sdk = TestConfig.SDK_VERSION, + sdk = TestConfig.SDK_VERSION_O, shadows = { SettingsShadowResources.class }) public class WifiWakeupPreferenceControllerTest { diff --git a/tests/robotests/src/com/android/settings/wifi/WpsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/WpsPreferenceControllerTest.java index 7a734e505dc..21488e8c8de 100644 --- a/tests/robotests/src/com/android/settings/wifi/WpsPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/wifi/WpsPreferenceControllerTest.java @@ -48,7 +48,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 WpsPreferenceControllerTest { @Mock diff --git a/tests/robotests/src/com/android/settings/wifi/WriteWifiConfigToNfcDialogTest.java b/tests/robotests/src/com/android/settings/wifi/WriteWifiConfigToNfcDialogTest.java index 5e10e0fc1f3..4fc118ae723 100644 --- a/tests/robotests/src/com/android/settings/wifi/WriteWifiConfigToNfcDialogTest.java +++ b/tests/robotests/src/com/android/settings/wifi/WriteWifiConfigToNfcDialogTest.java @@ -42,7 +42,7 @@ import org.robolectric.util.ReflectionHelpers; @RunWith(SettingsRobolectricTestRunner.class) @Config( manifest = TestConfig.MANIFEST_PATH, - sdk = TestConfig.SDK_VERSION, + sdk = TestConfig.SDK_VERSION_O, shadows = ShadowNfcAdapter.class ) public class WriteWifiConfigToNfcDialogTest { diff --git a/tests/robotests/src/com/android/settings/wifi/details/WifiDetailPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/details/WifiDetailPreferenceControllerTest.java index 3a0341c7be9..64d9f593599 100644 --- a/tests/robotests/src/com/android/settings/wifi/details/WifiDetailPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/wifi/details/WifiDetailPreferenceControllerTest.java @@ -66,6 +66,7 @@ import com.android.settings.TestConfig; import com.android.settings.applications.LayoutPreference; import com.android.settings.core.instrumentation.MetricsFeatureProvider; import com.android.settings.testutils.SettingsRobolectricTestRunner; +import com.android.settings.testutils.shadow.ShadowBidiFormatter; import com.android.settings.testutils.shadow.ShadowDevicePolicyManagerWrapper; import com.android.settings.testutils.shadow.ShadowEntityHeaderController; import com.android.settings.testutils.shadow.ShadowPackageManagerWrapper; @@ -97,11 +98,12 @@ import java.util.List; import java.util.stream.Collectors; @RunWith(SettingsRobolectricTestRunner.class) -@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = { ShadowDevicePolicyManagerWrapper.class, ShadowEntityHeaderController.class, ShadowPackageManagerWrapper.class, + ShadowBidiFormatter.class }) public class WifiDetailPreferenceControllerTest { diff --git a/tests/robotests/src/com/android/settings/wifi/p2p/P2pThisDevicePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/p2p/P2pThisDevicePreferenceControllerTest.java index 62fd01f8775..02017f7eeec 100644 --- a/tests/robotests/src/com/android/settings/wifi/p2p/P2pThisDevicePreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/wifi/p2p/P2pThisDevicePreferenceControllerTest.java @@ -37,7 +37,7 @@ import static org.mockito.Matchers.anyString; 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 P2pThisDevicePreferenceControllerTest { @Mock diff --git a/tests/robotests/src/com/android/settings/wifi/p2p/WifiP2PPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/p2p/WifiP2PPreferenceControllerTest.java index e8094312236..0b8d27a93c4 100644 --- a/tests/robotests/src/com/android/settings/wifi/p2p/WifiP2PPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/wifi/p2p/WifiP2PPreferenceControllerTest.java @@ -47,7 +47,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 WifiP2PPreferenceControllerTest { @Mock