Loading android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppBtEnableActivityTest.java +7 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import static org.mockito.Mockito.mock; import android.content.Context; import android.content.Intent; import android.sysprop.BluetoothProperties; import androidx.test.core.app.ActivityScenario; import androidx.test.espresso.action.ViewActions; Loading @@ -39,6 +40,7 @@ import com.android.bluetooth.R; import com.android.bluetooth.TestUtils; import org.junit.After; import org.junit.Assume; import org.junit.Before; import org.junit.Rule; import org.junit.Test; Loading @@ -55,6 +57,8 @@ public class BluetoothOppBtEnableActivityTest { @Before public void setUp() throws Exception { Assume.assumeTrue(BluetoothProperties.isProfileOppEnabled().orElse(false)); mTargetContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); mIntent = new Intent(); mIntent.setClass(mTargetContext, BluetoothOppBtEnableActivity.class); Loading @@ -64,6 +68,9 @@ public class BluetoothOppBtEnableActivityTest { @After public void tearDown() throws Exception { if (!BluetoothProperties.isProfileOppEnabled().orElse(false)) { return; } TestUtils.tearDownUiTest(); Intents.release(); } Loading android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppBtEnablingActivityTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.bluetooth.BluetoothAdapter; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.sysprop.BluetoothProperties; import android.view.KeyEvent; import androidx.lifecycle.Lifecycle; Loading @@ -42,6 +43,7 @@ import com.android.bluetooth.BluetoothMethodProxy; import com.android.bluetooth.TestUtils; import org.junit.After; import org.junit.Assume; import org.junit.Before; import org.junit.Ignore; import org.junit.Rule; Loading Loading @@ -73,6 +75,8 @@ public class BluetoothOppBtEnablingActivityTest { @Before public void setUp() throws Exception { Assume.assumeTrue(BluetoothProperties.isProfileOppEnabled().orElse(false)); mBluetoothMethodProxy = Mockito.spy(BluetoothMethodProxy.getInstance()); BluetoothMethodProxy.setInstanceForTesting(mBluetoothMethodProxy); Loading android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppLauncherActivityTest.java +7 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import android.content.Context; import android.content.ContextWrapper; import android.content.Intent; import android.net.Uri; import android.sysprop.BluetoothProperties; import androidx.lifecycle.Lifecycle; import androidx.test.core.app.ActivityScenario; Loading @@ -50,6 +51,7 @@ import com.android.bluetooth.BluetoothMethodProxy; import com.android.bluetooth.TestUtils; import org.junit.After; import org.junit.Assume; import org.junit.Before; import org.junit.Ignore; import org.junit.Rule; Loading Loading @@ -81,6 +83,8 @@ public class BluetoothOppLauncherActivityTest { @Before public void setUp() throws Exception { Assume.assumeTrue(BluetoothProperties.isProfileOppEnabled().orElse(false)); mTargetContext = spy(new ContextWrapper( ApplicationProvider.getApplicationContext())); mMethodProxy = spy(BluetoothMethodProxy.getInstance()); Loading @@ -97,6 +101,9 @@ public class BluetoothOppLauncherActivityTest { @After public void tearDown() throws Exception { if (!BluetoothProperties.isProfileOppEnabled().orElse(false)) { return; } TestUtils.tearDownUiTest(); BluetoothMethodProxy.setInstanceForTesting(null); BluetoothOppManager.setInstance(null); Loading android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppReceiverTest.java +6 −2 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.platform.test.flag.junit.SetFlagsRule; import android.sysprop.BluetoothProperties; import androidx.test.core.app.ActivityScenario; import androidx.test.espresso.intent.Intents; Loading @@ -56,6 +57,7 @@ import com.android.bluetooth.flags.Flags; import com.google.common.base.Objects; import org.junit.After; import org.junit.Assume; import org.junit.Before; import org.junit.Ignore; import org.junit.Rule; Loading Loading @@ -106,6 +108,8 @@ public class BluetoothOppReceiverTest { @Ignore("b/262201478") @Test public void onReceive_withActionDeviceSelected_callsStartTransfer() { Assume.assumeTrue(BluetoothProperties.isProfileOppEnabled().orElse(false)); BluetoothOppManager bluetoothOppManager = spy(BluetoothOppManager.getInstance(mContext)); BluetoothOppManager.setInstance(bluetoothOppManager); String address = "AA:BB:CC:DD:EE:FF"; Loading @@ -116,8 +120,6 @@ public class BluetoothOppReceiverTest { intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device); try { BluetoothOppTestUtils.enableActivity( BluetoothOppBtEnableActivity.class, true, mContext); ActivityScenario<BluetoothOppBtEnableActivity> activityScenario = ActivityScenario.launch(BluetoothOppBtEnableActivity.class); activityScenario.onActivity( Loading Loading @@ -337,6 +339,8 @@ public class BluetoothOppReceiverTest { @Test public void onReceive_withActionTransferComplete_noBroadcastSent() throws Exception { Assume.assumeTrue(BluetoothProperties.isProfileOppEnabled().orElse(false)); List<BluetoothOppTestUtils.CursorMockData> cursorMockDataList; Cursor cursor = mock(Cursor.class); int idValue = 1234; Loading Loading
android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppBtEnableActivityTest.java +7 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import static org.mockito.Mockito.mock; import android.content.Context; import android.content.Intent; import android.sysprop.BluetoothProperties; import androidx.test.core.app.ActivityScenario; import androidx.test.espresso.action.ViewActions; Loading @@ -39,6 +40,7 @@ import com.android.bluetooth.R; import com.android.bluetooth.TestUtils; import org.junit.After; import org.junit.Assume; import org.junit.Before; import org.junit.Rule; import org.junit.Test; Loading @@ -55,6 +57,8 @@ public class BluetoothOppBtEnableActivityTest { @Before public void setUp() throws Exception { Assume.assumeTrue(BluetoothProperties.isProfileOppEnabled().orElse(false)); mTargetContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); mIntent = new Intent(); mIntent.setClass(mTargetContext, BluetoothOppBtEnableActivity.class); Loading @@ -64,6 +68,9 @@ public class BluetoothOppBtEnableActivityTest { @After public void tearDown() throws Exception { if (!BluetoothProperties.isProfileOppEnabled().orElse(false)) { return; } TestUtils.tearDownUiTest(); Intents.release(); } Loading
android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppBtEnablingActivityTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.bluetooth.BluetoothAdapter; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.sysprop.BluetoothProperties; import android.view.KeyEvent; import androidx.lifecycle.Lifecycle; Loading @@ -42,6 +43,7 @@ import com.android.bluetooth.BluetoothMethodProxy; import com.android.bluetooth.TestUtils; import org.junit.After; import org.junit.Assume; import org.junit.Before; import org.junit.Ignore; import org.junit.Rule; Loading Loading @@ -73,6 +75,8 @@ public class BluetoothOppBtEnablingActivityTest { @Before public void setUp() throws Exception { Assume.assumeTrue(BluetoothProperties.isProfileOppEnabled().orElse(false)); mBluetoothMethodProxy = Mockito.spy(BluetoothMethodProxy.getInstance()); BluetoothMethodProxy.setInstanceForTesting(mBluetoothMethodProxy); Loading
android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppLauncherActivityTest.java +7 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import android.content.Context; import android.content.ContextWrapper; import android.content.Intent; import android.net.Uri; import android.sysprop.BluetoothProperties; import androidx.lifecycle.Lifecycle; import androidx.test.core.app.ActivityScenario; Loading @@ -50,6 +51,7 @@ import com.android.bluetooth.BluetoothMethodProxy; import com.android.bluetooth.TestUtils; import org.junit.After; import org.junit.Assume; import org.junit.Before; import org.junit.Ignore; import org.junit.Rule; Loading Loading @@ -81,6 +83,8 @@ public class BluetoothOppLauncherActivityTest { @Before public void setUp() throws Exception { Assume.assumeTrue(BluetoothProperties.isProfileOppEnabled().orElse(false)); mTargetContext = spy(new ContextWrapper( ApplicationProvider.getApplicationContext())); mMethodProxy = spy(BluetoothMethodProxy.getInstance()); Loading @@ -97,6 +101,9 @@ public class BluetoothOppLauncherActivityTest { @After public void tearDown() throws Exception { if (!BluetoothProperties.isProfileOppEnabled().orElse(false)) { return; } TestUtils.tearDownUiTest(); BluetoothMethodProxy.setInstanceForTesting(null); BluetoothOppManager.setInstance(null); Loading
android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppReceiverTest.java +6 −2 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.platform.test.flag.junit.SetFlagsRule; import android.sysprop.BluetoothProperties; import androidx.test.core.app.ActivityScenario; import androidx.test.espresso.intent.Intents; Loading @@ -56,6 +57,7 @@ import com.android.bluetooth.flags.Flags; import com.google.common.base.Objects; import org.junit.After; import org.junit.Assume; import org.junit.Before; import org.junit.Ignore; import org.junit.Rule; Loading Loading @@ -106,6 +108,8 @@ public class BluetoothOppReceiverTest { @Ignore("b/262201478") @Test public void onReceive_withActionDeviceSelected_callsStartTransfer() { Assume.assumeTrue(BluetoothProperties.isProfileOppEnabled().orElse(false)); BluetoothOppManager bluetoothOppManager = spy(BluetoothOppManager.getInstance(mContext)); BluetoothOppManager.setInstance(bluetoothOppManager); String address = "AA:BB:CC:DD:EE:FF"; Loading @@ -116,8 +120,6 @@ public class BluetoothOppReceiverTest { intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device); try { BluetoothOppTestUtils.enableActivity( BluetoothOppBtEnableActivity.class, true, mContext); ActivityScenario<BluetoothOppBtEnableActivity> activityScenario = ActivityScenario.launch(BluetoothOppBtEnableActivity.class); activityScenario.onActivity( Loading Loading @@ -337,6 +339,8 @@ public class BluetoothOppReceiverTest { @Test public void onReceive_withActionTransferComplete_noBroadcastSent() throws Exception { Assume.assumeTrue(BluetoothProperties.isProfileOppEnabled().orElse(false)); List<BluetoothOppTestUtils.CursorMockData> cursorMockDataList; Cursor cursor = mock(Cursor.class); int idValue = 1234; Loading