Loading android/app/tests/unit/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ java_defaults { "androidx.test.espresso.intents", "androidx.test.ext.truth", "androidx.test.rules", "androidx.test.uiautomator_uiautomator", "framework-bluetooth-pre-jarjar", "gson", "mockito-target", Loading android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppBtEnableActivityTest.java +4 −6 Original line number Diff line number Diff line Loading @@ -16,10 +16,6 @@ package com.android.bluetooth.opp; import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DEFAULT; import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED; import static android.content.pm.PackageManager.DONT_KILL_APP; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; Loading @@ -31,7 +27,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.mockito.Mockito.mock; import android.content.ComponentName; import android.content.Context; import android.content.Intent; Loading @@ -46,19 +41,22 @@ import org.junit.Before; import org.junit.Test; import org.mockito.MockitoAnnotations; import java.io.IOException; public class BluetoothOppBtEnableActivityTest { Intent mIntent; Context mTargetContext; @Before public void setUp() { public void setUp() throws Exception { MockitoAnnotations.initMocks(this); mTargetContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); mIntent = new Intent(); mIntent.setClass(mTargetContext, BluetoothOppBtEnableActivity.class); Intents.init(); BluetoothOppTestUtils.enableOppActivities(true, mTargetContext); BluetoothOppTestUtils.wakeUpAndDismissKeyGuard(); } @After Loading android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppBtEnablingActivityTest.java +4 −1 Original line number Diff line number Diff line Loading @@ -49,6 +49,8 @@ import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.mockito.Spy; import java.io.IOException; @RunWith(AndroidJUnit4.class) public class BluetoothOppBtEnablingActivityTest { @Spy Loading @@ -60,7 +62,7 @@ public class BluetoothOppBtEnablingActivityTest { int mRealTimeoutValue; @Before public void setUp() { public void setUp() throws Exception { MockitoAnnotations.initMocks(this); mBluetoothMethodProxy = Mockito.spy(BluetoothMethodProxy.getInstance()); BluetoothMethodProxy.setInstanceForTesting(mBluetoothMethodProxy); Loading @@ -72,6 +74,7 @@ public class BluetoothOppBtEnablingActivityTest { mRealTimeoutValue = BluetoothOppBtEnablingActivity.sBtEnablingTimeoutMs; BluetoothOppTestUtils.enableOppActivities(true, mTargetContext); BluetoothOppTestUtils.wakeUpAndDismissKeyGuard(); } @After Loading android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppLauncherActivityTest.java +4 −5 Original line number Diff line number Diff line Loading @@ -20,14 +20,10 @@ import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DEFAULT; import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED; import static android.content.pm.PackageManager.DONT_KILL_APP; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.intent.Intents.intended; import static androidx.test.espresso.intent.matcher.IntentMatchers.hasAction; import static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent; import static androidx.test.espresso.matcher.RootMatchers.isDialog; import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.withText; import static com.google.common.truth.Truth.assertThat; Loading Loading @@ -65,6 +61,7 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; import java.io.File; import java.io.IOException; @MediumTest @RunWith(AndroidJUnit4.class) Loading @@ -77,7 +74,7 @@ public class BluetoothOppLauncherActivityTest { BluetoothOppManager mBluetoothOppManager; @Before public void setUp() { public void setUp() throws Exception { MockitoAnnotations.initMocks(this); mTargetContext = spy(new ContextWrapper( ApplicationProvider.getApplicationContext())); Loading @@ -88,6 +85,8 @@ public class BluetoothOppLauncherActivityTest { mIntent.setClass(mTargetContext, BluetoothOppLauncherActivity.class); BluetoothOppTestUtils.enableOppActivities(true, mTargetContext); BluetoothOppTestUtils.wakeUpAndDismissKeyGuard(); BluetoothOppManager.setInstance(mBluetoothOppManager); Intents.init(); } Loading android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppReceiverTest.java +3 −1 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import java.io.IOException; import java.util.ArrayList; import java.util.List; Loading @@ -72,7 +73,7 @@ public class BluetoothOppReceiverTest { BluetoothOppReceiver mReceiver; @Before public void setUp() { public void setUp() throws Exception { MockitoAnnotations.initMocks(this); mContext = spy(new ContextWrapper( InstrumentationRegistry.getInstrumentation().getTargetContext())); Loading @@ -85,6 +86,7 @@ public class BluetoothOppReceiverTest { Intents.init(); BluetoothOppTestUtils.enableOppActivities(true, mContext); BluetoothOppTestUtils.wakeUpAndDismissKeyGuard(); } @After Loading Loading
android/app/tests/unit/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ java_defaults { "androidx.test.espresso.intents", "androidx.test.ext.truth", "androidx.test.rules", "androidx.test.uiautomator_uiautomator", "framework-bluetooth-pre-jarjar", "gson", "mockito-target", Loading
android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppBtEnableActivityTest.java +4 −6 Original line number Diff line number Diff line Loading @@ -16,10 +16,6 @@ package com.android.bluetooth.opp; import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DEFAULT; import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED; import static android.content.pm.PackageManager.DONT_KILL_APP; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; Loading @@ -31,7 +27,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.mockito.Mockito.mock; import android.content.ComponentName; import android.content.Context; import android.content.Intent; Loading @@ -46,19 +41,22 @@ import org.junit.Before; import org.junit.Test; import org.mockito.MockitoAnnotations; import java.io.IOException; public class BluetoothOppBtEnableActivityTest { Intent mIntent; Context mTargetContext; @Before public void setUp() { public void setUp() throws Exception { MockitoAnnotations.initMocks(this); mTargetContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); mIntent = new Intent(); mIntent.setClass(mTargetContext, BluetoothOppBtEnableActivity.class); Intents.init(); BluetoothOppTestUtils.enableOppActivities(true, mTargetContext); BluetoothOppTestUtils.wakeUpAndDismissKeyGuard(); } @After Loading
android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppBtEnablingActivityTest.java +4 −1 Original line number Diff line number Diff line Loading @@ -49,6 +49,8 @@ import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.mockito.Spy; import java.io.IOException; @RunWith(AndroidJUnit4.class) public class BluetoothOppBtEnablingActivityTest { @Spy Loading @@ -60,7 +62,7 @@ public class BluetoothOppBtEnablingActivityTest { int mRealTimeoutValue; @Before public void setUp() { public void setUp() throws Exception { MockitoAnnotations.initMocks(this); mBluetoothMethodProxy = Mockito.spy(BluetoothMethodProxy.getInstance()); BluetoothMethodProxy.setInstanceForTesting(mBluetoothMethodProxy); Loading @@ -72,6 +74,7 @@ public class BluetoothOppBtEnablingActivityTest { mRealTimeoutValue = BluetoothOppBtEnablingActivity.sBtEnablingTimeoutMs; BluetoothOppTestUtils.enableOppActivities(true, mTargetContext); BluetoothOppTestUtils.wakeUpAndDismissKeyGuard(); } @After Loading
android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppLauncherActivityTest.java +4 −5 Original line number Diff line number Diff line Loading @@ -20,14 +20,10 @@ import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DEFAULT; import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED; import static android.content.pm.PackageManager.DONT_KILL_APP; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.intent.Intents.intended; import static androidx.test.espresso.intent.matcher.IntentMatchers.hasAction; import static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent; import static androidx.test.espresso.matcher.RootMatchers.isDialog; import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.withText; import static com.google.common.truth.Truth.assertThat; Loading Loading @@ -65,6 +61,7 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; import java.io.File; import java.io.IOException; @MediumTest @RunWith(AndroidJUnit4.class) Loading @@ -77,7 +74,7 @@ public class BluetoothOppLauncherActivityTest { BluetoothOppManager mBluetoothOppManager; @Before public void setUp() { public void setUp() throws Exception { MockitoAnnotations.initMocks(this); mTargetContext = spy(new ContextWrapper( ApplicationProvider.getApplicationContext())); Loading @@ -88,6 +85,8 @@ public class BluetoothOppLauncherActivityTest { mIntent.setClass(mTargetContext, BluetoothOppLauncherActivity.class); BluetoothOppTestUtils.enableOppActivities(true, mTargetContext); BluetoothOppTestUtils.wakeUpAndDismissKeyGuard(); BluetoothOppManager.setInstance(mBluetoothOppManager); Intents.init(); } Loading
android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppReceiverTest.java +3 −1 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import java.io.IOException; import java.util.ArrayList; import java.util.List; Loading @@ -72,7 +73,7 @@ public class BluetoothOppReceiverTest { BluetoothOppReceiver mReceiver; @Before public void setUp() { public void setUp() throws Exception { MockitoAnnotations.initMocks(this); mContext = spy(new ContextWrapper( InstrumentationRegistry.getInstrumentation().getTargetContext())); Loading @@ -85,6 +86,7 @@ public class BluetoothOppReceiverTest { Intents.init(); BluetoothOppTestUtils.enableOppActivities(true, mContext); BluetoothOppTestUtils.wakeUpAndDismissKeyGuard(); } @After Loading