Merge "Finish bluetooth detail fragment if device is BOND_NONE"
This commit is contained in:
committed by
Android (Google) Code Review
commit
08bd74c59c
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.android.settings.bluetooth;
|
||||
|
||||
import static android.bluetooth.BluetoothDevice.BOND_NONE;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
@@ -126,4 +128,13 @@ public class BluetoothDeviceDetailsFragmentTest {
|
||||
RemoteDeviceNameDialogFragment dialog = (RemoteDeviceNameDialogFragment) captor.getValue();
|
||||
assertThat(dialog).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void finishFragmentIfNecessary_deviceIsBondNone_finishFragment() {
|
||||
when(mCachedDevice.getBondState()).thenReturn(BOND_NONE);
|
||||
|
||||
mFragment.finishFragmentIfNecessary();
|
||||
|
||||
verify(mFragment).finish();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user