OSDN Git Service

remove unnecessary mock in BluetoothDeviceUpdaterTest
authortimhypeng <timhypeng@google.com>
Fri, 3 Aug 2018 08:53:26 +0000 (16:53 +0800)
committertim peng <timhypeng@google.com>
Tue, 7 Aug 2018 08:21:51 +0000 (08:21 +0000)
Bug: 111848213
Test: make -j50 RunSettingsRoboTests
Change-Id: If1c46614ec6e40c66eb121cc48caa1fbc9c39871

tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceUpdaterTest.java

index a5422e7..9f81711 100644 (file)
@@ -30,11 +30,8 @@ import com.android.settings.SettingsActivity;
 import com.android.settings.connecteddevice.DevicePreferenceCallback;
 import com.android.settings.dashboard.DashboardFragment;
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
-import com.android.settingslib.bluetooth.A2dpProfile;
 import com.android.settingslib.bluetooth.CachedBluetoothDevice;
-import com.android.settingslib.bluetooth.HeadsetProfile;
 import com.android.settingslib.bluetooth.LocalBluetoothManager;
-import com.android.settingslib.bluetooth.LocalBluetoothProfileManager;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -61,12 +58,6 @@ public class BluetoothDeviceUpdaterTest {
     private SettingsActivity mSettingsActivity;
     @Mock
     private LocalBluetoothManager mLocalManager;
-    @Mock
-    private LocalBluetoothProfileManager mLocalBluetoothProfileManager;
-    @Mock
-    private HeadsetProfile mHeadsetProfile;
-    @Mock
-    private A2dpProfile mA2dpProfile;
 
     private Context mContext;
     private BluetoothDeviceUpdater mBluetoothDeviceUpdater;
@@ -79,9 +70,6 @@ public class BluetoothDeviceUpdaterTest {
         mContext = RuntimeEnvironment.application;
         doReturn(mContext).when(mDashboardFragment).getContext();
         when(mCachedBluetoothDevice.getDevice()).thenReturn(mBluetoothDevice);
-        when(mLocalManager.getProfileManager()).thenReturn(mLocalBluetoothProfileManager);
-        when(mLocalBluetoothProfileManager.getHeadsetProfile()).thenReturn(mHeadsetProfile);
-        when(mLocalBluetoothProfileManager.getA2dpProfile()).thenReturn(mA2dpProfile);
 
         mPreference = new BluetoothDevicePreference(mContext, mCachedBluetoothDevice, false);
         mBluetoothDeviceUpdater =