Loading android/app/tests/unit/src/com/android/bluetooth/TestUtils.java +8 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import android.service.media.MediaBrowserService; import androidx.test.InstrumentationRegistry; import androidx.test.rule.ServiceTestRule; import androidx.test.uiautomator.UiDevice; import com.android.bluetooth.avrcpcontroller.BluetoothMediaBrowserService; import com.android.bluetooth.btservice.AdapterService; Loading Loading @@ -380,6 +381,13 @@ public class TestUtils { return intent; } public static void wakeUpAndDismissKeyGuard() throws Exception { final UiDevice device = UiDevice.getInstance( androidx.test.platform.app.InstrumentationRegistry.getInstrumentation()); device.wakeUp(); device.executeShellCommand("wm dismiss-keyguard"); } /** * Helper class used to run synchronously a runnable action on a looper. */ Loading android/app/tests/unit/src/com/android/bluetooth/map/BluetoothMapSettingsTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.runner.AndroidJUnit4; import com.android.bluetooth.R; import com.android.bluetooth.TestUtils; import org.junit.After; import org.junit.Assume; Loading @@ -53,8 +54,9 @@ public class BluetoothMapSettingsTest { ActivityScenario<BluetoothMapSettings> mActivityScenario; @Before public void setUp() { public void setUp() throws Exception { enableActivity(true); TestUtils.wakeUpAndDismissKeyGuard(); mIntent = new Intent(); mIntent.setClass(mTargetContext, BluetoothMapSettings.class); mActivityScenario = ActivityScenario.launch(mIntent); Loading @@ -70,7 +72,6 @@ public class BluetoothMapSettingsTest { enableActivity(false); } @Ignore("b/277596416") @Test public void initialize() throws Exception { onView(withId(R.id.bluetooth_map_settings_list_view)).check(matches(isDisplayed())); Loading android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppBtEnableActivityTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import androidx.test.espresso.intent.Intents; import androidx.test.platform.app.InstrumentationRegistry; import com.android.bluetooth.R; import com.android.bluetooth.TestUtils; import org.junit.After; import org.junit.Before; Loading @@ -56,7 +57,7 @@ public class BluetoothOppBtEnableActivityTest { mIntent.setClass(mTargetContext, BluetoothOppBtEnableActivity.class); Intents.init(); BluetoothOppTestUtils.enableOppActivities(true, mTargetContext); BluetoothOppTestUtils.wakeUpAndDismissKeyGuard(); TestUtils.wakeUpAndDismissKeyGuard(); } @After Loading android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppBtEnablingActivityTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.runner.AndroidJUnit4; import com.android.bluetooth.BluetoothMethodProxy; import com.android.bluetooth.TestUtils; import org.junit.After; import org.junit.Before; Loading Loading @@ -74,7 +75,7 @@ public class BluetoothOppBtEnablingActivityTest { mRealTimeoutValue = BluetoothOppBtEnablingActivity.sBtEnablingTimeoutMs; BluetoothOppTestUtils.enableOppActivities(true, mTargetContext); BluetoothOppTestUtils.wakeUpAndDismissKeyGuard(); TestUtils.wakeUpAndDismissKeyGuard(); } @After Loading android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppLauncherActivityTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ import androidx.test.runner.AndroidJUnit4; import com.android.bluetooth.BluetoothMethodProxy; import com.android.bluetooth.R; import com.android.bluetooth.TestUtils; import org.junit.After; import org.junit.Before; Loading Loading @@ -85,7 +86,7 @@ public class BluetoothOppLauncherActivityTest { mIntent.setClass(mTargetContext, BluetoothOppLauncherActivity.class); BluetoothOppTestUtils.enableOppActivities(true, mTargetContext); BluetoothOppTestUtils.wakeUpAndDismissKeyGuard(); TestUtils.wakeUpAndDismissKeyGuard(); BluetoothOppManager.setInstance(mBluetoothOppManager); Intents.init(); Loading Loading
android/app/tests/unit/src/com/android/bluetooth/TestUtils.java +8 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import android.service.media.MediaBrowserService; import androidx.test.InstrumentationRegistry; import androidx.test.rule.ServiceTestRule; import androidx.test.uiautomator.UiDevice; import com.android.bluetooth.avrcpcontroller.BluetoothMediaBrowserService; import com.android.bluetooth.btservice.AdapterService; Loading Loading @@ -380,6 +381,13 @@ public class TestUtils { return intent; } public static void wakeUpAndDismissKeyGuard() throws Exception { final UiDevice device = UiDevice.getInstance( androidx.test.platform.app.InstrumentationRegistry.getInstrumentation()); device.wakeUp(); device.executeShellCommand("wm dismiss-keyguard"); } /** * Helper class used to run synchronously a runnable action on a looper. */ Loading
android/app/tests/unit/src/com/android/bluetooth/map/BluetoothMapSettingsTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.runner.AndroidJUnit4; import com.android.bluetooth.R; import com.android.bluetooth.TestUtils; import org.junit.After; import org.junit.Assume; Loading @@ -53,8 +54,9 @@ public class BluetoothMapSettingsTest { ActivityScenario<BluetoothMapSettings> mActivityScenario; @Before public void setUp() { public void setUp() throws Exception { enableActivity(true); TestUtils.wakeUpAndDismissKeyGuard(); mIntent = new Intent(); mIntent.setClass(mTargetContext, BluetoothMapSettings.class); mActivityScenario = ActivityScenario.launch(mIntent); Loading @@ -70,7 +72,6 @@ public class BluetoothMapSettingsTest { enableActivity(false); } @Ignore("b/277596416") @Test public void initialize() throws Exception { onView(withId(R.id.bluetooth_map_settings_list_view)).check(matches(isDisplayed())); Loading
android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppBtEnableActivityTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import androidx.test.espresso.intent.Intents; import androidx.test.platform.app.InstrumentationRegistry; import com.android.bluetooth.R; import com.android.bluetooth.TestUtils; import org.junit.After; import org.junit.Before; Loading @@ -56,7 +57,7 @@ public class BluetoothOppBtEnableActivityTest { mIntent.setClass(mTargetContext, BluetoothOppBtEnableActivity.class); Intents.init(); BluetoothOppTestUtils.enableOppActivities(true, mTargetContext); BluetoothOppTestUtils.wakeUpAndDismissKeyGuard(); TestUtils.wakeUpAndDismissKeyGuard(); } @After Loading
android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppBtEnablingActivityTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.runner.AndroidJUnit4; import com.android.bluetooth.BluetoothMethodProxy; import com.android.bluetooth.TestUtils; import org.junit.After; import org.junit.Before; Loading Loading @@ -74,7 +75,7 @@ public class BluetoothOppBtEnablingActivityTest { mRealTimeoutValue = BluetoothOppBtEnablingActivity.sBtEnablingTimeoutMs; BluetoothOppTestUtils.enableOppActivities(true, mTargetContext); BluetoothOppTestUtils.wakeUpAndDismissKeyGuard(); TestUtils.wakeUpAndDismissKeyGuard(); } @After Loading
android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppLauncherActivityTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ import androidx.test.runner.AndroidJUnit4; import com.android.bluetooth.BluetoothMethodProxy; import com.android.bluetooth.R; import com.android.bluetooth.TestUtils; import org.junit.After; import org.junit.Before; Loading Loading @@ -85,7 +86,7 @@ public class BluetoothOppLauncherActivityTest { mIntent.setClass(mTargetContext, BluetoothOppLauncherActivity.class); BluetoothOppTestUtils.enableOppActivities(true, mTargetContext); BluetoothOppTestUtils.wakeUpAndDismissKeyGuard(); TestUtils.wakeUpAndDismissKeyGuard(); BluetoothOppManager.setInstance(mBluetoothOppManager); Intents.init(); Loading