/packages/apps/Settings/tests/robotests/src/com/android/settings/media/ |
D | MediaOutputSliceTest.java | 33 import static org.mockito.Mockito.when; 109 doReturn(false).when(mMediaDeviceUpdateWorker).hasAdjustVolumeUserRestriction(); in setUp() 153 when(device.getName()).thenReturn(TEST_DEVICE_1_NAME); in getSlice_shouldHaveActiveDeviceName() 154 when(device.getIcon()).thenReturn(mTestDrawable); in getSlice_shouldHaveActiveDeviceName() 155 when(device.getMaxVolume()).thenReturn(100); in getSlice_shouldHaveActiveDeviceName() 156 when(device.isConnected()).thenReturn(true); in getSlice_shouldHaveActiveDeviceName() 157 when(device.getDeviceType()).thenReturn(MediaDevice.MediaDeviceType.TYPE_CAST_DEVICE); in getSlice_shouldHaveActiveDeviceName() 158 when(device.getId()).thenReturn(TEST_DEVICE_1_ID); in getSlice_shouldHaveActiveDeviceName() 160 when(device2.getName()).thenReturn(TEST_DEVICE_2_NAME); in getSlice_shouldHaveActiveDeviceName() 161 when(device2.getIcon()).thenReturn(mTestDrawable); in getSlice_shouldHaveActiveDeviceName() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/deviceinfo/simstatus/ |
D | SimStatusDialogControllerTest.java | 46 import static org.mockito.Mockito.when; 136 when(mDialog.getContext()).thenReturn(mContext); in setup() 146 doReturn(2).when(mTelephonyManager).getCardIdForDefaultEuicc(); in setup() 147 doReturn(TelephonyManager.NETWORK_TYPE_LTE).when(mTelephonyManager).getDataNetworkType(); in setup() 149 doReturn(mEuiccManager).when(mContext).getSystemService(EuiccManager.class); in setup() 154 doReturn(0).when(mCellSignalStrengthCdma).getDbm(); in setup() 155 doReturn(0).when(mCellSignalStrengthCdma).getAsuLevel(); in setup() 156 doReturn(0).when(mCellSignalStrengthLte).getDbm(); in setup() 157 doReturn(0).when(mCellSignalStrengthLte).getAsuLevel(); in setup() 158 doReturn(0).when(mCellSignalStrengthWcdma).getDbm(); in setup() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/accounts/ |
D | AccountPreferenceControllerTest.java | 30 import static org.mockito.Mockito.when; 97 when(mFragment.getPreferenceScreen()).thenReturn(mScreen); in setUp() 98 when(mFragment.getPreferenceManager().getContext()).thenReturn(mContext); in setUp() 99 when(mAccountManager.getAuthenticatorTypesAsUser(anyInt())) in setUp() 101 when(mAccountManager.getAccountsAsUser(anyInt())).thenReturn(new Account[0]); in setUp() 113 when(mUserManager.isManagedProfile()).thenReturn(true); in onResume_managedProfile_shouldNotAddAccountCategory() 122 when(mUserManager.isManagedProfile()).thenReturn(false); in onResume_linkedUser_shouldAddOneAccountCategory() 123 when(mUserManager.isRestrictedProfile()).thenReturn(true); in onResume_linkedUser_shouldAddOneAccountCategory() 124 when(mUserManager.getUserInfo(anyInt())).thenReturn(info); in onResume_linkedUser_shouldAddOneAccountCategory() 135 when(mUserManager.isManagedProfile()).thenReturn(false); in onResume_oneProfile_shouldAddOneAccountCategory() [all …]
|
/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/btservice/ |
D | PhonePolicyTest.java | 73 when(mHeadsetService.connect(any(BluetoothDevice.class))).thenReturn(true); in setUp() 74 when(mA2dpService.connect(any(BluetoothDevice.class))).thenReturn(true); in setUp() 78 doReturn(MAX_CONNECTED_AUDIO_DEVICES).when(mAdapterService).getMaxConnectedAudioDevices(); in setUp() 80 doReturn(mHeadsetService).when(mServiceFactory).getHeadsetService(); in setUp() 81 doReturn(mA2dpService).when(mServiceFactory).getA2dpService(); in setUp() 86 doReturn(mHandlerThread.getLooper()).when(mAdapterService).getMainLooper(); in setUp() 88 doReturn(true).when(mAdapterService).isMock(); in setUp() 110 when(mHeadsetService.getConnectionPolicy(device)) in testProcessInitProfilePriorities() 114 when(mA2dpService.getConnectionPolicy(device)) in testProcessInitProfilePriorities() 117 when(mAdapterService.getDatabase()).thenReturn(mDatabaseManager); in testProcessInitProfilePriorities() [all …]
|
/packages/services/Telecomm/tests/src/com/android/server/telecom/tests/ |
D | BluetoothPhoneServiceTest.java | 68 import static org.mockito.Mockito.when; 113 doNothing().when(mMockCallsManager).addListener(any( in setUp() 115 doReturn(null).when(mMockCallsManager).getActiveCall(); in setUp() 116 doReturn(null).when(mMockCallsManager).getRingingOrSimulatedRingingCall(); in setUp() 117 doReturn(null).when(mMockCallsManager).getHeldCall(); in setUp() 118 doReturn(null).when(mMockCallsManager).getOutgoingCall(); in setUp() 119 doReturn(0).when(mMockCallsManager).getNumHeldCalls(); in setUp() 120 doReturn(false).when(mMockCallsManager).hasOnlyDisconnectedCalls(); in setUp() 150 when(mMockCallsManager.getRingingOrSimulatedRingingCall()).thenReturn(null); in testHeadsetAnswerCallNull() 172 when(mMockCallsManager.getForegroundCall()).thenReturn(null); in testHeadsetHangupCallNull() [all …]
|
D | InCallControllerTests.java | 39 import static org.mockito.Mockito.when; 149 when(mMockCall.getAnalytics()).thenReturn(new Analytics.CallInfo()); in setUp() 150 doReturn(mMockResources).when(mMockContext).getResources(); in setUp() 151 doReturn(SYS_PKG).when(mMockResources).getString( in setUp() 153 doReturn(SYS_CLASS).when(mMockResources).getString(R.string.incall_default_class); in setUp() 154 doReturn(true).when(mMockResources).getBoolean(R.bool.grant_location_permission_enabled); in setUp() 155 when(mDefaultDialerCache.getSystemDialerApplication()).thenReturn(SYS_PKG); in setUp() 156 when(mDefaultDialerCache.getSystemDialerComponent()).thenReturn( in setUp() 160 when(mMockCallsManager.getRoleManagerAdapter()).thenReturn(mMockRoleManagerAdapter); in setUp() 164 when(mMockContext.getSystemService(eq(Context.NOTIFICATION_SERVICE))) in setUp() [all …]
|
D | CallsManagerTest.java | 41 import static org.mockito.Mockito.when; 210 when(mInCallWakeLockControllerFactory.create(any(), any())).thenReturn( in setUp() 212 when(mHeadsetMediaButtonFactory.create(any(), any(), any())).thenReturn( in setUp() 214 when(mProximitySensorManagerFactory.create(any(), any())).thenReturn( in setUp() 216 when(mInCallControllerFactory.create(any(), any(), any(), any(), any(), any(), in setUp() 218 when(mCallAudioRouteStateMachineFactory.create(any(), any(), any(), any(), any(), any(), in setUp() 220 when(mCallAudioModeStateMachineFactory.create(any(), any())) in setUp() 222 when(mIncomingCallFilterFactory.create(any(), any(), any(), any(), any(), any())) in setUp() 224 when(mClockProxy.currentTimeMillis()).thenReturn(System.currentTimeMillis()); in setUp() 225 when(mClockProxy.elapsedRealtime()).thenReturn(SystemClock.elapsedRealtime()); in setUp() [all …]
|
D | TelecomServiceImplTest.java | 99 import static org.mockito.Mockito.when; 201 when(mockTelephonyManager.isVoiceCapable()).thenReturn(true); in setUp() 203 doReturn(mContext).when(mContext).getApplicationContext(); in setUp() 204 doNothing().when(mContext).sendBroadcastAsUser(any(Intent.class), any(UserHandle.class), in setUp() 209 }).when(mDefaultDialerCache).observeDefaultDialerApplication(any(Executor.class), in setUp() 228 when(mTelecomManager.getDefaultDialerPackage()).thenReturn(DEFAULT_DIALER_PACKAGE); in setUp() 229 when(mTelecomManager.getSystemDialerPackage()).thenReturn(DEFAULT_DIALER_PACKAGE); in setUp() 234 when(mDefaultDialerCache.getDefaultDialerApplication(anyInt())) in setUp() 236 when(mDefaultDialerCache.isDefaultOrSystemDialer(eq(DEFAULT_DIALER_PACKAGE), anyInt())) in setUp() 251 when(mFakePhoneAccountRegistrar in testGetDefaultOutgoingPhoneAccount() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/notification/ |
D | WorkSoundPreferenceControllerTest.java | 27 import static org.mockito.Mockito.when; 77 when(mContext.getSystemService(Context.TELEPHONY_SERVICE)).thenReturn(mTelephonyManager); in setUp() 78 when(mTelephonyManager.isVoiceCapable()).thenReturn(true); in setUp() 79 when(mScreen.findPreference(KEY_WORK_CATEGORY)) in setUp() 81 when(mWorkCategory.findPreference(KEY_WORK_USE_PERSONAL_SOUNDS)) in setUp() 83 when(mWorkCategory.findPreference(KEY_WORK_PHONE_RINGTONE)) in setUp() 85 when(mWorkCategory.findPreference(KEY_WORK_NOTIFICATION_RINGTONE)) in setUp() 87 when(mWorkCategory.findPreference(KEY_WORK_ALARM_RINGTONE)) in setUp() 95 when(mAudioHelper.getManagedProfileId(nullable(UserManager.class))) in isAvailable_managedProfileAndNotSingleVolume_shouldReturnTrue() 97 when(mAudioHelper.isUserUnlocked(nullable(UserManager.class), anyInt())).thenReturn(true); in isAvailable_managedProfileAndNotSingleVolume_shouldReturnTrue() [all …]
|
/packages/apps/CellBroadcastReceiver/tests/unit/src/com/android/cellbroadcastreceiver/unit/ |
D | CellBroadcastReceiverTest.java | 119 doReturn(mConfiguration).when(mResources).getConfiguration(); in setUp() 121 doReturn(mResources).when(mCellBroadcastReceiver).getResourcesMethod(); in setUp() 122 doNothing().when(mCellBroadcastReceiver).startConfigService(); in setUp() 123 doReturn(mContext).when(mContext).getApplicationContext(); in setUp() 124 doReturn(mPackageName).when(mContext).getPackageName(); in setUp() 129 doReturn(CellBroadcastReceiver.ACTION_MARK_AS_READ).when(mIntent).getAction(); in testOnReceive_actionMarkAsRead() 130 doNothing().when(mCellBroadcastReceiver).getCellBroadcastTask(anyLong()); in testOnReceive_actionMarkAsRead() 138 doReturn(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED).when(mIntent).getAction(); in testOnReceive_actionCarrierConfigChanged() 139 doNothing().when(mCellBroadcastReceiver).initializeSharedPreference(); in testOnReceive_actionCarrierConfigChanged() 140 doNothing().when(mCellBroadcastReceiver).enableLauncher(); in testOnReceive_actionCarrierConfigChanged() [all …]
|
/packages/apps/TvSettings/Settings/tests/robotests/src/com/android/tv/settings/ |
D | MainFragmentTest.java | 68 doReturn(RuntimeEnvironment.application).when(mMainFragment).getContext(); in setUp() 74 doReturn(networkPref).when(mMainFragment).findPreference(MainFragment.KEY_NETWORK); in testUpdateConnectivity_NoNetwork() 78 doReturn(false).when(listener).isEthernetAvailable(); in testUpdateConnectivity_NoNetwork() 79 doReturn(false).when(listener).isCellConnected(); in testUpdateConnectivity_NoNetwork() 80 doReturn(false).when(listener).isEthernetConnected(); in testUpdateConnectivity_NoNetwork() 81 doReturn(false).when(listener).isWifiEnabledOrEnabling(); in testUpdateConnectivity_NoNetwork() 91 doReturn(networkPref).when(mMainFragment).findPreference(MainFragment.KEY_NETWORK); in testUpdateConnectivity_hasEthernet() 95 doReturn(true).when(listener).isEthernetAvailable(); in testUpdateConnectivity_hasEthernet() 96 doReturn(false).when(listener).isCellConnected(); in testUpdateConnectivity_hasEthernet() 97 doReturn(false).when(listener).isEthernetConnected(); in testUpdateConnectivity_hasEthernet() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/enterprise/ |
D | EnterprisePrivacyFeatureProviderImplTest.java | 29 import static org.mockito.Mockito.when; 95 when(mContext.getApplicationContext()).thenReturn(mContext); in setUp() 97 when(mUserManager.getProfiles(MY_USER_ID)).thenReturn(mProfiles); in setUp() 107 when(mDevicePolicyManager.getDeviceOwnerComponentOnAnyUser()).thenReturn(null); in testHasDeviceOwner() 110 when(mDevicePolicyManager.getDeviceOwnerComponentOnAnyUser()).thenReturn(OWNER); in testHasDeviceOwner() 116 when(mDevicePolicyManager.getDeviceOwnerComponentOnAnyUser()).thenReturn(OWNER); in testIsInCompMode() 125 when(mDevicePolicyManager.getDeviceOwnerOrganizationName()).thenReturn(null); in testGetDeviceOwnerOrganizationName() 128 when(mDevicePolicyManager.getDeviceOwnerOrganizationName()).thenReturn(OWNER_ORGANIZATION); in testGetDeviceOwnerOrganizationName() 134 when(mDevicePolicyManager.getDeviceOwnerComponentOnAnyUser()).thenReturn(null); in testGetDeviceOwnerDisclosure() 142 when(mDevicePolicyManager.getDeviceOwnerComponentOnAnyUser()).thenReturn(OWNER); in testGetDeviceOwnerDisclosure() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/bluetooth/ |
D | SavedBluetoothDeviceUpdaterTest.java | 25 import static org.mockito.Mockito.when; 82 doReturn(mContext).when(mDashboardFragment).getContext(); in setUp() 83 when(mCachedBluetoothDevice.getDevice()).thenReturn(mBluetoothDevice); in setUp() 84 when(mCachedBluetoothDevice.getAddress()).thenReturn(MAC_ADDRESS); in setUp() 85 when(mBluetoothDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDED); in setUp() 94 doNothing().when(mBluetoothDeviceUpdater).addPreference(any()); in setUp() 95 doNothing().when(mBluetoothDeviceUpdater).removePreference(any()); in setUp() 100 doReturn(BluetoothDevice.BOND_BONDED).when(mBluetoothDevice).getBondState(); in update_filterMatch_addPreference() 101 doReturn(false).when(mBluetoothDevice).isConnected(); in update_filterMatch_addPreference() 111 doReturn(BluetoothDevice.BOND_NONE).when(mBluetoothDevice).getBondState(); in update_filterNotMatch_removePreference() [all …]
|
D | BluetoothPairingDialogTest.java | 28 import static org.mockito.Mockito.when; 70 doNothing().when(dialogActivity).dismiss(); in setUp() 76 when(controller.getDialogType()).thenReturn(BluetoothPairingController.USER_ENTRY_DIALOG); in dialogUpdatesControllerWithUserInput() 79 when(controller.getDeviceVariantMessageId()) in dialogUpdatesControllerWithUserInput() 81 when(controller.getDeviceVariantMessageHintId()) in dialogUpdatesControllerWithUserInput() 95 when(controller.getDialogType()).thenReturn(BluetoothPairingController.USER_ENTRY_DIALOG); in dialogEnablesSubmitButtonOnValidationFromController() 98 when(controller.getDeviceVariantMessageId()) in dialogEnablesSubmitButtonOnValidationFromController() 100 when(controller.getDeviceVariantMessageHintId()) in dialogEnablesSubmitButtonOnValidationFromController() 104 when(controller.isPasskeyValid(any())).thenReturn(true); in dialogEnablesSubmitButtonOnValidationFromController() 119 when(controller.getDialogType()).thenReturn(BluetoothPairingController.CONFIRMATION_DIALOG); in dialogDoesNotAskForPairCodeOnConsentVariant() [all …]
|
/packages/apps/ManagedProvisioning/tests/instrumentation/src/com/android/managedprovisioning/preprovisioning/ |
D | PreProvisioningControllerTest.java | 36 import static org.mockito.Mockito.when; 137 when(mContext.getSystemServiceName(DevicePolicyManager.class)) in setUp() 139 when(mContext.getSystemService(DevicePolicyManager.class)) in setUp() 142 when(mContext.getSystemServiceName(UserManager.class)) in setUp() 144 when(mContext.getSystemService(UserManager.class)) in setUp() 147 when(mContext.getPackageManager()).thenReturn(mPackageManager); in setUp() 148 when(mContext.getSystemService(Context.ACTIVITY_SERVICE)).thenReturn(mActivityManager); in setUp() 149 when(mContext.getSystemService(Context.KEYGUARD_SERVICE)).thenReturn(mKeyguardManager); in setUp() 150 when(mContext.getSystemService(Context.PERSISTENT_DATA_BLOCK_SERVICE)) in setUp() 152 when(mContext.getPackageName()).thenReturn(MP_PACKAGE_NAME); in setUp() [all …]
|
/packages/apps/Car/Settings/tests/robotests/src/com/android/car/settings/wifi/ |
D | AccessPointListPreferenceControllerTest.java | 27 import static org.mockito.Mockito.when; 94 when(mMockAccessPoint1.getSecurity()).thenReturn(AccessPoint.SECURITY_NONE); in setUp() 95 when(mMockAccessPoint1.getLevel()).thenReturn(SIGNAL_LEVEL); in setUp() 96 when(mMockAccessPoint2.getSecurity()).thenReturn(AccessPoint.SECURITY_NONE); in setUp() 97 when(mMockAccessPoint2.getLevel()).thenReturn(SIGNAL_LEVEL); in setUp() 109 when(mMockCarWifiManager.getAllAccessPoints()).thenReturn(new ArrayList<>()); in refreshUi_emptyList_notVisible() 118 when(mMockCarWifiManager.getAllAccessPoints()).thenReturn(accessPointList); in refreshUi_notEmpty_visible() 127 when(mMockCarWifiManager.getAllAccessPoints()).thenReturn(accessPointList); in refreshUi_notEmpty_listCount() 135 when(mMockAccessPoint1.isSaved()).thenReturn(false); in refreshUi_notSavedAccessPoint_noForgetButton() 137 when(mMockCarWifiManager.getAllAccessPoints()).thenReturn(accessPointList); in refreshUi_notSavedAccessPoint_noForgetButton() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/wifi/details2/ |
D | WifiDetailPreferenceController2Test.java | 33 import static org.mockito.Mockito.when; 265 when(mContext.getPackageManager()).thenReturn(mMockPackageManager); in setUp() 266 when(mMockWifiEntry.getLevel()).thenReturn(LEVEL); in setUp() 267 when(mMockWifiEntry.getSecurityString(false /* concise */)).thenReturn(SECURITY); in setUp() 268 when(mMockWifiEntry.getTitle()).thenReturn(SSID); in setUp() 269 when(mMockWifiEntry.getWifiConfiguration()).thenReturn(mMockWifiConfig); in setUp() 270 when(mMockConnectivityManager.getNetworkInfo(any(Network.class))) in setUp() 272 doNothing().when(mMockConnectivityManager).registerNetworkCallback( in setUp() 275 when(mMockButtonsPref.setButton1OnClickListener(mForgetClickListener.capture())) in setUp() 278 when(mMockWifiInfo.getTxLinkSpeedMbps()).thenReturn(TX_LINK_SPEED); in setUp() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/backup/ |
D | BackupSettingsHelperTest.java | 26 import static org.mockito.Mockito.when; 81 when(mBackupManager.getCurrentTransport()).thenReturn("test_transport"); in setUp() 89 when(mBackupManager.isBackupEnabled()).thenReturn(true); in testGetSummary_backupEnabledOnlyOneProfile_showsOn() 99 when(mBackupManager.isBackupEnabled()).thenReturn(false); in testGetSummary_backupDisabledOnlyOneProfile_showsOff() 110 when(mBackupManager.isBackupEnabled()).thenReturn(true); in testGetSummary_TwoProfiles_returnsNull() 121 when(mBackupManager.getDataManagementIntent(anyString())).thenReturn(intent); in testGetIntentFromBackupTransport() 134 when(mBackupManager.getDataManagementIntent(anyString())).thenReturn(intent); in testGetIntentFromBackupTransport_WithIntent() 143 when(mBackupManager.getDataManagementIntent(anyString())).thenReturn(null); in testGetIntentFromBackupTransport_WithNullIntent() 152 when(mBackupManager.getDataManagementIntent(anyString())).thenThrow(new RemoteException()); in testGetIntentFromBackupTransport_RemoteException() 163 when(mBackupManager.getDataManagementIntent(anyString())).thenReturn(intent); in testGetIntentFromBackupTransport_BackupEnabled() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/applications/appinfo/ |
D | AppButtonsPreferenceControllerTest.java | 36 import static org.mockito.Mockito.when; 135 doReturn(mDpm).when(mSettingsActivity).getSystemService(Context.DEVICE_POLICY_SERVICE); in setUp() 136 doReturn(mUserManager).when(mSettingsActivity).getSystemService(Context.USER_SERVICE); in setUp() 137 doReturn(mPackageManger).when(mSettingsActivity).getPackageManager(); in setUp() 138 doReturn(mAm).when(mSettingsActivity).getSystemService(Context.ACTIVITY_SERVICE); in setUp() 139 doReturn(mOverlayManager).when(mSettingsActivity). in setUp() 141 doReturn(mAppEntry).when(mState).getEntry(anyString(), anyInt()); in setUp() 142 doReturn(mContext).when(mSettingsActivity).getApplicationContext(); in setUp() 143 when(mSettingsActivity.getResources().getString(anyInt())).thenReturn(RESOURCE_STRING); in setUp() 163 doAnswer(callable).when(mFragment).startActivityForResult(captor.capture(), anyInt()); in setUp() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/applications/ |
D | DefaultAppsPreferenceControllerTest.java | 23 import static org.mockito.Mockito.when; 67 when(mContext.getPackageManager()).thenReturn(mPackageManager); in setUp() 68 when(mContext.getSystemService(RoleManager.class)).thenReturn(mRoleManager); in setUp() 70 when(mBrowserApplicationInfo.loadLabel(mPackageManager)).thenReturn("Browser1"); in setUp() 71 when(mPackageManager.getApplicationInfo(eq(BROWSER_PACKAGE_NAME), anyInt())).thenReturn( in setUp() 73 when(mDialerApplicationInfo.loadLabel(mPackageManager)).thenReturn("Phone1"); in setUp() 74 when(mPackageManager.getApplicationInfo(eq(DIALER_PACKAGE_NAME), anyInt())).thenReturn( in setUp() 76 when(mSmsApplicationInfo.loadLabel(mPackageManager)).thenReturn("Sms1"); in setUp() 77 when(mPackageManager.getApplicationInfo(eq(SMS_PACKAGE_NAME), anyInt())).thenReturn( in setUp() 90 when(mRoleManager.getRoleHolders(RoleManager.ROLE_BROWSER)).thenReturn( in getSummary_allAvailable_shouldReturnAll() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/wifi/details/ |
D | WifiDetailPreferenceControllerTest.java | 33 import static org.mockito.Mockito.when; 268 when(mContext.getPackageManager()).thenReturn(mockPackageManager); in setUp() 269 when(mockAccessPoint.getConfig()).thenReturn(mockWifiConfig); in setUp() 270 when(mockAccessPoint.getLevel()).thenReturn(LEVEL); in setUp() 271 when(mockAccessPoint.getSecurityString(false)).thenReturn(SECURITY); in setUp() 272 when(mockAccessPoint.getSsidStr()).thenReturn(SSID); in setUp() 273 when(mockConnectivityManager.getNetworkInfo(any(Network.class))) in setUp() 275 doNothing().when(mockConnectivityManager).registerNetworkCallback( in setUp() 278 when(mockButtonsPref.setButton1OnClickListener(mForgetClickListener.capture())) in setUp() 281 when(mockWifiInfo.getTxLinkSpeedMbps()).thenReturn(TX_LINK_SPEED); in setUp() [all …]
|
/packages/apps/ManagedProvisioning/tests/instrumentation/src/com/android/managedprovisioning/task/ |
D | AddWifiNetworkTaskTest.java | 27 import static org.mockito.Mockito.when; 89 when(mContext.getSystemService(Context.WIFI_SERVICE)).thenReturn(mWifiManager); in setUp() 90 when(mContext.getSystemService(Context.CONNECTIVITY_SERVICE)) in setUp() 115 when(mContext.getSystemService(Context.WIFI_SERVICE)).thenReturn(null); in testWifiManagerNull() 131 when(mWifiManager.isWifiEnabled()).thenReturn(false); in testFailToEnableWifi() 134 when(mWifiManager.setWifiEnabled(true)).thenReturn(false); in testFailToEnableWifi() 150 when(mWifiManager.isWifiEnabled()).thenReturn(true); in testIsConnectedToSpecifiedWifiTrue() 153 … when(mUtils.isNetworkTypeConnected(mContext, ConnectivityManager.TYPE_WIFI)).thenReturn(true); in testIsConnectedToSpecifiedWifiTrue() 156 when(mWifiManager.getConnectionInfo()).thenReturn(mWifiInfo); in testIsConnectedToSpecifiedWifiTrue() 157 when(mWifiInfo.getSSID()).thenReturn(TEST_SSID); in testIsConnectedToSpecifiedWifiTrue() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/display/darkmode/ |
D | DarkModeActivationPreferenceControllerTest.java | 29 import static org.mockito.Mockito.when; 84 when(mContext.getResources()).thenReturn(res); in setUp() 85 when(res.getConfiguration()).thenReturn(mConfigNightNo); in setUp() 86 when(mContext.getSystemService(UiModeManager.class)).thenReturn(mService); in setUp() 87 when(mContext.getSystemService(PowerManager.class)).thenReturn(mPM); in setUp() 88 when(mScreen.findPreference(anyString())).thenReturn(mPreference); in setUp() 89 when(mPreference.findViewById( in setUp() 91 when(mPreference.findViewById( in setUp() 93 when(mService.setNightModeActivated(anyBoolean())).thenReturn(true); in setUp() 94 when(mFormat.of(any())).thenReturn("10:00 AM"); in setUp() [all …]
|
/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/hearingaid/ |
D | HearingAidServiceTest.java | 118 doReturn(BluetoothDevice.BOND_BONDED).when(mAdapterService) in setUp() 120 doReturn(new ParcelUuid[]{BluetoothUuid.HEARING_AID}).when(mAdapterService) in setUp() 219 when(mAdapterService.getDatabase()).thenReturn(mDatabaseManager); in testGetSetPriority() 220 when(mDatabaseManager.getProfileConnectionPolicy(mLeftDevice, BluetoothProfile.HEARING_AID)) in testGetSetPriority() 226 when(mAdapterService.getDatabase()).thenReturn(mDatabaseManager); in testGetSetPriority() 227 when(mDatabaseManager.getProfileConnectionPolicy(mLeftDevice, BluetoothProfile.HEARING_AID)) in testGetSetPriority() 233 when(mAdapterService.getDatabase()).thenReturn(mDatabaseManager); in testGetSetPriority() 234 when(mDatabaseManager.getProfileConnectionPolicy(mLeftDevice, BluetoothProfile.HEARING_AID)) in testGetSetPriority() 288 when(mAdapterService.getDatabase()).thenReturn(mDatabaseManager); in testOutgoingConnectMissingHearingAidUuid() 289 when(mDatabaseManager.getProfileConnectionPolicy(mLeftDevice, BluetoothProfile.HEARING_AID)) in testOutgoingConnectMissingHearingAidUuid() [all …]
|
/packages/apps/StorageManager/robotests/src/com/android/storagemanager/automatic/ |
D | AutomaticStorageManagementJobServiceTest.java | 28 import static org.mockito.Mockito.when; 82 when(mJobParameters.getJobId()).thenReturn(0); in setUp() 88 when(mBatteryManager.isCharging()).thenReturn(true); in setUp() 90 when(mVolumeInfo.getPath()).thenReturn(mFile); in setUp() 91 when(mVolumeInfo.getType()).thenReturn(VolumeInfo.TYPE_PRIVATE); in setUp() 92 when(mVolumeInfo.getFsUuid()).thenReturn(StorageManager.UUID_PRIMARY_PHYSICAL); in setUp() 93 when(mVolumeInfo.isMountedReadable()).thenReturn(true); in setUp() 98 when(mStorageVolumeProvider.getPrimaryStorageSize()).thenReturn(100L); in setUp() 99 when(mStorageVolumeProvider.getVolumes()).thenReturn(mVolumes); in setUp() 100 when(mStorageVolumeProvider.getFreeBytes( in setUp() [all …]
|