OSDN Git Service

2nd attempt handle BT is not supported on emulator
[android-x86/packages-apps-Settings.git] / tests / robotests / src / com / android / settings / sound / AudioOutputSwitchPreferenceControllerTest.java
index 2455f16..bd11a15 100644 (file)
@@ -186,6 +186,8 @@ public class AudioOutputSwitchPreferenceControllerTest {
 
         AudioSwitchPreferenceController controller = new AudioSwitchPreferenceControllerTestable(
                 mContext, TEST_KEY);
+        controller.onStart();
+        controller.onStop();
 
         assertThat(mLocalBluetoothManager).isNull();
     }
@@ -230,6 +232,7 @@ public class AudioOutputSwitchPreferenceControllerTest {
         verify(mLocalBluetoothManager.getEventManager()).registerCallback(
                 any(BluetoothCallback.class));
         verify(mContext).registerReceiver(any(BroadcastReceiver.class), any(IntentFilter.class));
+        verify(mLocalBluetoothManager).setForegroundActivity(mContext);
     }
 
     @Test
@@ -240,6 +243,7 @@ public class AudioOutputSwitchPreferenceControllerTest {
         verify(mLocalBluetoothManager.getEventManager()).unregisterCallback(
                 any(BluetoothCallback.class));
         verify(mContext).unregisterReceiver(any(BroadcastReceiver.class));
+        verify(mLocalBluetoothManager).setForegroundActivity(null);
     }
 
     @Test