Merge "Add preferences in new connected device page"
This commit is contained in:
committed by
Android (Google) Code Review
commit
b5931a6624
@@ -31,7 +31,6 @@ import static org.mockito.Mockito.verify;
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.os.UserManager;
|
||||
import android.support.v7.preference.PreferenceGroup;
|
||||
|
||||
import com.android.settings.R;
|
||||
@@ -55,8 +54,6 @@ import org.robolectric.annotation.Config;
|
||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
|
||||
public class BluetoothPairingDetailTest {
|
||||
|
||||
@Mock
|
||||
private UserManager mUserManager;
|
||||
@Mock
|
||||
private Resources mResource;
|
||||
@Mock
|
||||
@@ -133,6 +130,25 @@ public class BluetoothPairingDetailTest {
|
||||
verify(mFragment).finish();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateBluetooth_bluetoothOff_turnOnBluetooth() {
|
||||
doReturn(false).when(mLocalAdapter).isEnabled();
|
||||
|
||||
mFragment.updateBluetooth();
|
||||
|
||||
verify(mLocalAdapter).enable();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateBluetooth_bluetoothOn_updateState() {
|
||||
doReturn(true).when(mLocalAdapter).isEnabled();
|
||||
doNothing().when(mFragment).updateContent(anyInt());
|
||||
|
||||
mFragment.updateBluetooth();
|
||||
|
||||
verify(mFragment).updateContent(anyInt());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOnScanningStateChanged_restartScanAfterInitialScanning() {
|
||||
mFragment.mAvailableDevicesCategory = mAvailableDevicesCategory;
|
||||
@@ -181,6 +197,4 @@ public class BluetoothPairingDetailTest {
|
||||
verify(mAvailableDevicesCategory, times(1)).removeAll();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user