Home
last modified time | relevance | path

Searched refs:when (Results 1 – 25 of 3542) sorted by relevance

12345678910>>...142

/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/consent/
DDeviceRegionProviderTest.java55 doReturn(Flags.UI_EEA_COUNTRIES).when(mMockFlags).getUiEeaCountries(); in setup()
62 doReturn("").when(mMockFlags).getUiEeaCountries(); in testGbEmptyEeaCountriesList()
64 doReturn("gb").when(mTelephonyManager).getSimCountryIso(); in testGbEmptyEeaCountriesList()
65 doReturn(true).when(mPackageManager).hasSystemFeature(anyString()); in testGbEmptyEeaCountriesList()
66 doReturn(mPackageManager).when(mContext).getPackageManager(); in testGbEmptyEeaCountriesList()
67 doReturn(mTelephonyManager).when(mContext).getSystemService(TelephonyManager.class); in testGbEmptyEeaCountriesList()
75 doReturn("").when(mMockFlags).getUiEeaCountries(); in testChEmptyEeaCountriesList()
77 doReturn("ch").when(mTelephonyManager).getSimCountryIso(); in testChEmptyEeaCountriesList()
78 doReturn(true).when(mPackageManager).hasSystemFeature(anyString()); in testChEmptyEeaCountriesList()
79 doReturn(mPackageManager).when(mContext).getPackageManager(); in testChEmptyEeaCountriesList()
[all …]
/packages/apps/Settings/tests/unit/src/com/android/settings/safetycenter/
DBiometricsSafetySourceTest.java31 import static org.mockito.Mockito.when;
91 when(mApplicationContext.getPackageManager()).thenReturn(mPackageManager); in setUp()
92 when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)).thenReturn(true); in setUp()
93 when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FACE)).thenReturn(true); in setUp()
94 when(mDevicePolicyManager.getProfileOwnerOrDeviceOwnerSupervisionComponent(USER_HANDLE)) in setUp()
96 when(mApplicationContext.getSystemService(Context.FINGERPRINT_SERVICE)) in setUp()
98 when(mApplicationContext.getSystemService(Context.DEVICE_POLICY_SERVICE)) in setUp()
100 when(mApplicationContext.getSystemService(Context.FACE_SERVICE)).thenReturn(mFaceManager); in setUp()
102 when(featureFactory.securityFeatureProvider.getLockPatternUtils(mApplicationContext)) in setUp()
104 doReturn(true).when(mLockPatternUtils).isSecure(anyInt()); in setUp()
[all …]
/packages/services/AlternativeNetworkAccess/tests/src/com/android/ons/
DONSProfileActivatorTest.java93 doReturn(mMockResources).when(mMockContext).getResources(); in setUp()
95 doReturn(mMockConnectivityManager).when(mMockContext).getSystemService( in setUp()
99 doNothing().when(mMockConnectivityManager).registerNetworkCallback(request, in setUp()
105 doReturn(persistableBundle).when(mMockCarrierConfigManager).getConfigForSubId(TEST_SUBID_1); in setUp()
122 doReturn(mMockEuiccManagerCard1).when(mMockEuiccManager).createForCardId(1); in setUp()
123 doReturn(true).when(mMockEuiccManagerCard1).isEnabled(); in setUp()
124 doReturn(uiccCardInfoList).when(mMockTeleManager).getUiccCardsInfo(); in setUp()
167 doReturn(false).when(mMockResources).getBoolean(R.bool.enable_ons_auto_provisioning); in testONSAutoProvisioningDisabled()
181 doReturn(true).when(mMockResources).getBoolean(R.bool.enable_ons_auto_provisioning); in testESIMNotSupported()
182 doReturn(false).when(mMockEuiccManager).isEnabled(); in testESIMNotSupported()
[all …]
/packages/modules/Wifi/service/tests/wifitests/src/com/android/server/wifi/
DWifiKeyStoreTest.java33 import static org.mockito.Mockito.when;
83 when(mWifiEnterpriseConfig.getClientCertificateAlias()).thenReturn(USER_CERT_ALIAS); in setUp()
84 when(mWifiEnterpriseConfig.getCaCertificateAlias()).thenReturn(USER_CA_CERT_ALIAS); in setUp()
85 when(mWifiEnterpriseConfig.getCaCertificateAliases()) in setUp()
87 when(mWifiEnterpriseConfig.getClientPrivateKey()).thenReturn(FakeKeys.RSA_KEY1); in setUp()
88 when(mWifiEnterpriseConfig.getClientCertificate()).thenReturn(FakeKeys.CLIENT_CERT); in setUp()
89 when(mWifiEnterpriseConfig.getCaCertificate()).thenReturn(FakeKeys.CA_CERT0); in setUp()
90 when(mWifiEnterpriseConfig.getClientCertificateChain()) in setUp()
92 when(mWifiEnterpriseConfig.getCaCertificates()) in setUp()
94 when(mWifiEnterpriseConfig.getKeyId(any())).thenReturn(TEST_KEY_ID); in setUp()
[all …]
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/measurement/inputverification/
DClickVerifierTest.java26 import static org.mockito.Mockito.when;
67 when(mFlags.getMeasurementRegistrationInputEventValidWindowMs()).thenReturn(100L); in before()
68 when(mFlags.getMeasurementIsClickDeduplicationEnabled()).thenReturn(false); in before()
69 when(mFlags.getMeasurementIsClickDeduplicationEnforced()).thenReturn(false); in before()
76 when(mFlags.getMeasurementIsClickVerifiedByInputEvent()).thenReturn(true); in testInputEventOutsideTimeRangeReturnsFalse()
77 when(mInputManager.verifyInputEvent(eventOutsideRange)).thenReturn(mVerifiedMotionEvent); in testInputEventOutsideTimeRangeReturnsFalse()
91 when(mFlags.getMeasurementIsClickVerifiedByInputEvent()).thenReturn(true); in testVerifiedInputEventInsideTimeRangeReturnsTrue()
92 when(mInputManager.verifyInputEvent(eventInsideRange)).thenReturn(mVerifiedMotionEvent); in testVerifiedInputEventInsideTimeRangeReturnsTrue()
96 when(mFlags.getMeasurementRegistrationInputEventValidWindowMs()) in testVerifiedInputEventInsideTimeRangeReturnsTrue()
110 when(mFlags.getMeasurementRegistrationInputEventValidWindowMs()) in testInputEventNotValidatedBySystem()
[all …]
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/qc/
DWifiTileTest.java26 import static org.mockito.Mockito.when;
55 when(mContext.getSystemService(WifiManager.class)).thenReturn(mWifiManager); in setUp()
62 when(mWifiManager.isWifiEnabled()).thenReturn(false); in getQCItem_wifiDisabled_returnsTile()
63 when(mWifiManager.getWifiState()).thenReturn(WifiManager.WIFI_STATE_DISABLED); in getQCItem_wifiDisabled_returnsTile()
72 when(mWifiManager.isWifiEnabled()).thenReturn(true); in getQCItem_wifiNotConnected_returnsTile()
73 when(mWifiManager.getWifiState()).thenReturn(WifiManager.WIFI_STATE_ENABLED); in getQCItem_wifiNotConnected_returnsTile()
75 when(wifiInfo.getSSID()).thenReturn(WifiManager.UNKNOWN_SSID); in getQCItem_wifiNotConnected_returnsTile()
76 when(wifiInfo.getNetworkId()).thenReturn(-1); in getQCItem_wifiNotConnected_returnsTile()
77 when(mWifiManager.getConnectionInfo()).thenReturn(wifiInfo); in getQCItem_wifiNotConnected_returnsTile()
87 when(mWifiManager.isWifiEnabled()).thenReturn(true); in getQCItem_wifiConnected_returnsTile()
[all …]
DWifiRowTest.java26 import static org.mockito.Mockito.when;
57 when(mContext.getSystemService(WifiManager.class)).thenReturn(mWifiManager); in setUp()
64 when(mWifiManager.isWifiEnabled()).thenReturn(false); in getQCItem_setsTitle()
65 when(mWifiManager.getWifiState()).thenReturn(WifiManager.WIFI_STATE_DISABLED); in getQCItem_setsTitle()
72 when(mWifiManager.isWifiEnabled()).thenReturn(false); in getQCItem_wifiDisabled_returnsRow()
73 when(mWifiManager.getWifiState()).thenReturn(WifiManager.WIFI_STATE_DISABLED); in getQCItem_wifiDisabled_returnsRow()
83 when(mWifiManager.isWifiEnabled()).thenReturn(true); in getQCItem_wifiNotConnected_returnsRow()
84 when(mWifiManager.getWifiState()).thenReturn(WifiManager.WIFI_STATE_ENABLED); in getQCItem_wifiNotConnected_returnsRow()
86 when(wifiInfo.getSSID()).thenReturn(WifiManager.UNKNOWN_SSID); in getQCItem_wifiNotConnected_returnsRow()
87 when(wifiInfo.getNetworkId()).thenReturn(-1); in getQCItem_wifiNotConnected_returnsRow()
[all …]
/packages/modules/AdServices/adservices/tests/unittest/ui/src/com/android/adservices/service/ui/util/
DUxEngineUtilTest.java103 doReturn(true).when(mConsentManager).isEntryPointEnabled(); in setup()
104 doReturn(true).when(mUxStatesManager).getFlag(KEY_ADSERVICES_ENABLED); in setup()
105 doReturn(true).when(mUxStatesManager).getFlag(KEY_IS_U18_UX_DETENTION_CHANNEL_ENABLED); in setup()
109 ExtendedMockito.doReturn(mConsentManager).when(() -> ConsentManager.getInstance()); in setup()
111 ExtendedMockito.doReturn(mFlags).when(FlagsFactory::getFlags); in setup()
114 ExtendedMockito.doReturn(true).when( in setup()
117 ExtendedMockito.doNothing().when( in setup()
134 doReturn(false).when(mUxStatesManager).getFlag(KEY_ADSERVICES_ENABLED); in getEligibleUxCollectionTest_adServicesDisabled()
142 doReturn(false).when(mConsentManager).isEntryPointEnabled(); in getEligibleUxCollectionTest_entryPointDisabled()
150 doReturn(true).when(mUxStatesManager).getFlag(KEY_GA_UX_FEATURE_ENABLED); in getEligibleUxCollectionTest_adultUserGaFlagOn()
[all …]
/packages/apps/Settings/tests/unit/src/com/android/settings/network/
DSubscriptionUtilTest.java33 import static org.mockito.Mockito.when;
88 when(mContext.getResources()).thenReturn(mResources); in setUp()
89 when(mContext.getSystemService(SubscriptionManager.class)).thenReturn(mSubMgr); in setUp()
90 when(mContext.getSystemService(TelephonyManager.class)).thenReturn(mTelMgr); in setUp()
91 when(mContext.getSystemService(ConnectivityManager.class)).thenReturn(mConnectivityManager); in setUp()
92 when(mTelMgr.getUiccSlotsInfo()).thenReturn(null); in setUp()
98 when(mSubMgr.getAvailableSubscriptionInfoList()).thenReturn(null); in getAvailableSubscriptions_nullInfoFromSubscriptionManager_nonNullResult()
109 when(mSubMgr.getAvailableSubscriptionInfoList()).thenReturn(Arrays.asList(info)); in getAvailableSubscriptions_oneSubscription_oneResult()
119 when(mResources.getIntArray(anyInt())).thenReturn(CARRIERS_THAT_USE_RAC); in hasSubscriptionWithRacCarrier_containsRac_returnTrue()
121 when(info.getCarrierId()).thenReturn(RAC_CARRIER_ID); in hasSubscriptionWithRacCarrier_containsRac_returnTrue()
[all …]
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/common/
DAdServicesCommonServiceImplTest.java48 import static org.mockito.Mockito.when;
147 doReturn(true).when(mFlags).getAdServicesEnabled(); in setup()
150 .when(() -> BackgroundJobsManager.scheduleAllBackgroundJobs(any(Context.class))); in setup()
152 ExtendedMockito.doReturn(mUxStatesManager).when(() -> UxStatesManager.getInstance()); in setup()
155 .when( in setup()
162 doReturn(mSharedPreferences).when(mContext).getSharedPreferences(anyString(), anyInt()); in setup()
163 doReturn(mPackageManager).when(mContext).getPackageManager(); in setup()
164 doReturn(mEditor).when(mSharedPreferences).edit(); in setup()
165 doReturn(mEditor).when(mEditor).putInt(anyString(), anyInt()); in setup()
166 doReturn(true).when(mEditor).commit(); in setup()
[all …]
/packages/apps/Settings/tests/robotests/src/com/android/settings/bluetooth/
DSavedBluetoothDeviceUpdaterTest.java26 import static org.mockito.Mockito.when;
103 doReturn(mContext).when(mDashboardFragment).getContext(); in setUp()
104 when(mCachedBluetoothDevice.getDevice()).thenReturn(mBluetoothDevice); in setUp()
105 when(mCachedBluetoothDevice.getAddress()).thenReturn(MAC_ADDRESS); in setUp()
106 when(mBluetoothDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDED); in setUp()
107 when(mCachedBluetoothDevice.getDrawableWithDescription()).thenReturn(pairs); in setUp()
108 when(mContext.getPackageManager()).thenReturn(mPackageManager); in setUp()
117 doNothing().when(mBluetoothDeviceUpdater).addPreference(any()); in setUp()
118 doNothing().when(mBluetoothDeviceUpdater).removePreference(any()); in setUp()
120 when(mBluetoothManager.getCachedDeviceManager()).thenReturn(mDeviceManager); in setUp()
[all …]
/packages/apps/Settings/tests/robotests/src/com/android/settings/accounts/
DAccountPreferenceControllerTest.java30 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/Car/Launcher/app/tests/src/com/android/car/carlauncher/recents/view/
DRecentsRecyclerViewTest.java29 import static org.mockito.Mockito.when;
123 when(mWindowMetrics.getBounds()).thenReturn(windowBounds); in setup()
139 when(mRecentTasksViewModel.getRecentTasksSize()).thenReturn(0); in resetPadding_setsStartPadding_toZero_whenNoRecentTasksPresent()
149 when(mRecentTasksViewModel.getRecentTasksSize()).thenReturn(0); in resetPadding_setsEndPadding_toZero_whenNoRecentTasksPresent()
159 when(mGridLayoutManager.getReverseLayout()).thenReturn(false); in resetPadding_setsStartPadding_toStart_noReverseLayout_noRTL()
160 when(mRecentTasksViewModel.getRecentTasksSize()).thenReturn(5); in resetPadding_setsStartPadding_toStart_noReverseLayout_noRTL()
171 when(mGridLayoutManager.getReverseLayout()).thenReturn(false); in resetPadding_setsEndPadding_toEnd_noReverseLayout_noRTL()
172 when(mRecentTasksViewModel.getRecentTasksSize()).thenReturn(5); in resetPadding_setsEndPadding_toEnd_noReverseLayout_noRTL()
183 when(mGridLayoutManager.getReverseLayout()).thenReturn(false); in resetPadding_setsStartPadding_toEnd_noReverseLayout_RTL()
184 when(mRecentTasksViewModel.getRecentTasksSize()).thenReturn(5); in resetPadding_setsStartPadding_toEnd_noReverseLayout_RTL()
[all …]
/packages/apps/Settings/tests/unit/src/com/android/settings/biometrics/combination/
DCombinedBiometricStatusUtilsTest.java26 import static org.mockito.Mockito.when;
83 when(mApplicationContext.getPackageManager()).thenReturn(mPackageManager); in setUp()
84 when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)).thenReturn(true); in setUp()
85 when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FACE)).thenReturn(true); in setUp()
86 when(mDevicePolicyManager.getProfileOwnerOrDeviceOwnerSupervisionComponent(USER_HANDLE)) in setUp()
88 when(mApplicationContext.getSystemService(Context.FINGERPRINT_SERVICE)) in setUp()
90 when(mApplicationContext.getSystemService(Context.DEVICE_POLICY_SERVICE)) in setUp()
92 when(mApplicationContext.getSystemService(Context.FACE_SERVICE)).thenReturn(mFaceManager); in setUp()
99 when(mFingerprintManager.isHardwareDetected()).thenReturn(false); in isAvailable_withoutFingerprint_withoutFace_returnsFalse()
100 when(mFaceManager.isHardwareDetected()).thenReturn(false); in isAvailable_withoutFingerprint_withoutFace_returnsFalse()
[all …]
/packages/modules/Uwb/service/tests/src/com/android/server/uwb/
DDeviceConfigFacadeTest.java29 import static org.mockito.Mockito.when;
74 when(DeviceConfig.getBoolean(anyString(), anyString(), anyBoolean())) in setUp()
80 when(DeviceConfig.getInt(anyString(), anyString(), anyInt())) in setUp()
86 when(DeviceConfig.getLong(anyString(), anyString(), anyLong())) in setUp()
92 when(DeviceConfig.getString(anyString(), anyString(), anyString())) in setUp()
99 when(mResources.getBoolean(R.bool.enable_filters)).thenReturn(true); in setUp()
100 when(mResources.getBoolean(R.bool.enable_primer_est_elevation)).thenReturn(true); in setUp()
101 when(mResources.getBoolean(R.bool.enable_primer_aoa)).thenReturn(true); in setUp()
102 when(mResources.getInteger(R.integer.filter_distance_inliers_percent)) in setUp()
104 when(mResources.getInteger(R.integer.filter_distance_window)) in setUp()
[all …]
DUwbMetricsTest.java25 import static org.mockito.Mockito.when;
134 when(mRangingData.getSessionId()).thenReturn(1L); in setUp()
135 when(mRangingData.getNoOfRangingMeasures()).thenReturn(1); in setUp()
136 when(mRangingData.getRangingMeasuresType()).thenReturn( in setUp()
138 when(mTwoWayMeasurement.isStatusCodeOk()).thenReturn(IS_STATUS_CODE_OK_DEFAULT); in setUp()
139 when(mDlTDoAMeasurement.getStatus()).thenReturn(FiraParams.STATUS_CODE_OK); in setUp()
140 when(mOwrAoaMeasurement.getRangingStatus()).thenReturn(FiraParams.STATUS_CODE_OK); in setUp()
141 when(mRangingData.getRangingTwoWayMeasures()).thenReturn(mTwoWayMeasurements); in setUp()
142 when(mRangingData.getUwbDlTDoAMeasurements()).thenReturn(mDlTDoAMeasurements); in setUp()
143 when(mRangingData.getRangingOwrAoaMeasure()).thenReturn(mOwrAoaMeasurement); in setUp()
[all …]
/packages/modules/Bluetooth/android/app/tests/unit/src/com/android/bluetooth/telephony/
DBluetoothInCallServiceTest.java148 doReturn(null).when(mMockCallInfo).getActiveCall(); in setUp()
149 doReturn(null).when(mMockCallInfo).getRingingOrSimulatedRingingCall(); in setUp()
150 doReturn(null).when(mMockCallInfo).getHeldCall(); in setUp()
151 doReturn(null).when(mMockCallInfo).getOutgoingCall(); in setUp()
152 doReturn(0).when(mMockCallInfo).getNumHeldCalls(); in setUp()
153 doReturn(false).when(mMockCallInfo).hasOnlyDisconnectedCalls(); in setUp()
154 doReturn(true).when(mMockCallInfo).isNullCall(null); in setUp()
155 doReturn(false).when(mMockCallInfo).isNullCall(notNull()); in setUp()
182 when(mMockCallInfo.getRingingOrSimulatedRingingCall()).thenReturn(null); in testHeadsetAnswerCallNull()
200 when(mMockCallInfo.getForegroundCall()).thenReturn(null); in testHeadsetHangupCallNull()
[all …]
/packages/apps/CellBroadcastReceiver/tests/unit/src/com/android/cellbroadcastreceiver/unit/
DCellBroadcastReceiverTest.java131 doReturn(mConfiguration).when(mResources).getConfiguration(); in setUp()
132 doReturn(MCC_TABLE).when(mResources).getStringArray(R.array.iso_country_code_mcc_table); in setUp()
134 doReturn(mResources).when(mCellBroadcastReceiver).getResourcesMethod(); in setUp()
135 doNothing().when(mCellBroadcastReceiver).startConfigServiceToEnableChannels(); in setUp()
136 doReturn(mContext).when(mContext).getApplicationContext(); in setUp()
137 doReturn(mPackageName).when(mContext).getPackageName(); in setUp()
138 doReturn(mFakeSharedPreferences).when(mContext).getSharedPreferences(anyString(), anyInt()); in setUp()
139 doReturn(mUserManager).when(mContext).getSystemService(Context.USER_SERVICE); in setUp()
140 doReturn(false).when(mUserManager).isSystemUser(); in setUp()
146 doReturn(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED).when(mIntent).getAction(); in testOnReceive_actionCarrierConfigChanged()
[all …]
/packages/modules/HealthFitness/tests/unittests/src/com/android/server/healthconnect/storage/datatypehelpers/aggregation/
DValuePriorityAggregationTest.java24 import static org.mockito.Mockito.when;
75 when(HealthConnectDeviceConfigManager.getInitialisedInstance()) in setUp()
77 when(mHealthConnectDeviceConfigManager.isAggregationSourceControlsEnabled()) in setUp()
84 .when(mOneGroupAggregator) in testOneStepsRecord_equalToWindow()
86 when(mCursor.moveToNext()).thenReturn(true, false); in testOneStepsRecord_equalToWindow()
94 .when(mOneGroupAggregator) in testOneStepsRecord_doesNotHavePriority_noneAccountedForAggregation()
96 when(mCursor.moveToNext()).thenReturn(true, false); in testOneStepsRecord_doesNotHavePriority_noneAccountedForAggregation()
103 doReturn(createStepsData(10, 10, 10, 1, 1)).when(mOneGroupAggregator).readNewData(mCursor); in testOneStepsRecord_startAndEndEqualToWindowStart_accountedForAggregation()
104 when(mCursor.moveToNext()).thenReturn(true, false); in testOneStepsRecord_startAndEndEqualToWindowStart_accountedForAggregation()
111 doReturn(createStepsData(20, 20, 10, 1, 1)).when(mOneGroupAggregator).readNewData(mCursor); in testOneStepsRecord_startAndEndEqualToWindowEnd_notAccountedForAggregation()
[all …]
/packages/providers/MediaProvider/tests/src/com/android/providers/media/photopicker/util/
DDateTimeUtilsTest.java49 final long when = generateDateTimeMillis(FAKE_DATE); in testGetDateHeaderString_today() local
51 String result = DateTimeUtils.getDateHeaderString(when, FAKE_DATE); in testGetDateHeaderString_today()
59 final long when = generateDateTimeMillis(whenDate); in testGetDateHeaderString_yesterday() local
61 final String result = DateTimeUtils.getDateHeaderString(when, FAKE_DATE); in testGetDateHeaderString_yesterday()
69 final long when = generateDateTimeMillis(whenDate); in testGetDateHeaderString_weekday() local
71 final String result = DateTimeUtils.getDateHeaderString(when, FAKE_DATE); in testGetDateHeaderString_weekday()
79 final long when = generateDateTimeMillis(whenDate); in testGetDateHeaderString_weekdayAndDate() local
81 final String result = DateTimeUtils.getDateHeaderString(when, FAKE_DATE); in testGetDateHeaderString_weekdayAndDate()
89 long when = generateDateTimeMillis(whenDate); in testGetDateHeaderString_weekdayDateAndYear() local
91 final String result = DateTimeUtils.getDateHeaderString(when, FAKE_DATE); in testGetDateHeaderString_weekdayDateAndYear()
[all …]
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/download/
DEnrollmentDataDownloadManagerTest.java36 import static org.mockito.Mockito.when;
130 doReturn(mMockFileStorage).when(() -> (MobileDataDownloadFactory.getFileStorage())); in testReadFileAndInsertIntoDatabaseSuccess()
131 doReturn(mMockMdd).when(() -> (MobileDataDownloadFactory.getMdd(any()))); in testReadFileAndInsertIntoDatabaseSuccess()
132 doReturn(mMockEnrollmentDao).when(() -> (EnrollmentDao.getInstance())); in testReadFileAndInsertIntoDatabaseSuccess()
133 doReturn(mMockEncryptionKeyDao).when(EncryptionKeyDao::getInstance); in testReadFileAndInsertIntoDatabaseSuccess()
134 when(mMockFileStorage.open(any(), any())) in testReadFileAndInsertIntoDatabaseSuccess()
141 when(mMockMdd.getFileGroup(any())) in testReadFileAndInsertIntoDatabaseSuccess()
152 when(mMockFlags.getEnrollmentMddRecordDeletionEnabled()).thenReturn(false); in testReadFileAndInsertIntoDatabaseSuccess()
153 when(mMockFlags.getEncryptionKeyNewEnrollmentFetchKillSwitch()).thenReturn(false); in testReadFileAndInsertIntoDatabaseSuccess()
154 when(mMockFlags.getEncryptionKeyNetworkConnectTimeoutMs()) in testReadFileAndInsertIntoDatabaseSuccess()
[all …]
/packages/apps/Car/SystemUI/tests/src/com/android/systemui/car/window/
DOverlayViewGlobalStateControllerTest.java29 import static org.mockito.Mockito.when;
83 when(mBaseLayout.getWindowInsetsController()).thenReturn(mWindowInsetsController); in setUp()
85 when(mSystemUIOverlayWindowController.getBaseLayout()).thenReturn(mBaseLayout); in setUp()
110 when(mOverlayViewController1.shouldFocusWindow()).thenReturn(false); in showView_nothingVisible_windowNotFocusable_shouldShowNavBar_navBarsVisible()
111 when(mOverlayViewController1.shouldShowNavigationBarInsets()).thenReturn(true); in showView_nothingVisible_windowNotFocusable_shouldShowNavBar_navBarsVisible()
121 when(mOverlayViewController1.shouldFocusWindow()).thenReturn(false); in showView_nothingVisible_windowNotFocusable_shouldHideNavBar_notHidden()
122 when(mOverlayViewController1.shouldShowNavigationBarInsets()).thenReturn(false); in showView_nothingVisible_windowNotFocusable_shouldHideNavBar_notHidden()
132 when(mOverlayViewController1.shouldFocusWindow()).thenReturn(false); in showView_nothingVisible_windowNotFocusable_shouldShowStatusBar_statusBarsVisible()
133 when(mOverlayViewController1.shouldShowStatusBarInsets()).thenReturn(true); in showView_nothingVisible_windowNotFocusable_shouldShowStatusBar_statusBarsVisible()
143 when(mOverlayViewController1.shouldFocusWindow()).thenReturn(false); in showView_nothingVisible_windowNotFocusable_shouldHideStatusBar_notHidden()
[all …]
/packages/services/Telecomm/tests/src/com/android/server/telecom/tests/
DInCallControllerTests.java44 import static org.mockito.Mockito.when;
216 when(mMockCall.getAnalytics()).thenReturn(new Analytics.CallInfo()); in setUp()
217 when(mMockCall.getAssociatedUser()).thenReturn(mUserHandle); in setUp()
218 when(mMockCall.getId()).thenReturn("TC@1"); in setUp()
219 doReturn(mMockResources).when(mMockContext).getResources(); in setUp()
220 doReturn(mMockAppOpsManager).when(mMockContext).getSystemService(AppOpsManager.class); in setUp()
221 doReturn(SYS_PKG).when(mMockResources).getString( in setUp()
223 doReturn(SYS_CLASS).when(mMockResources).getString(R.string.incall_default_class); in setUp()
224 doReturn(true).when(mMockResources).getBoolean(R.bool.grant_location_permission_enabled); in setUp()
225 when(mDefaultDialerCache.getSystemDialerApplication()).thenReturn(SYS_PKG); in setUp()
[all …]
/packages/modules/HealthFitness/tests/unittests/src/com/android/server/healthconnect/migration/
DMigrationBroadcastSchedulingTest.java34 import static org.mockito.Mockito.when;
99 when(mContext.getSystemService(JobScheduler.class)).thenReturn(mJobScheduler); in setUp()
100 when(mContext.getPackageName()).thenReturn("packageName"); in setUp()
101 when(mJobScheduler.forNamespace(MIGRATION_BROADCAST_NAMESPACE)).thenReturn(mJobScheduler); in setUp()
102 when(HealthConnectDeviceConfigManager.getInitialisedInstance()) in setUp()
104 when(mHealthConnectDeviceConfigManager.getMigrationStateAllowedCount()) in setUp()
106 when(mHealthConnectDeviceConfigManager.getMigrationStateInProgressCount()) in setUp()
108 when(mHealthConnectDeviceConfigManager.getNonIdleStateTimeoutPeriod()) in setUp()
116 when(MigrationStateManager.initializeInstance(anyInt())).thenCallRealMethod(); in testPrescheduleNewJobs_updateMigrationState_newJobsScheduled()
117 when(PreferenceHelper.getInstance()).thenReturn(mPreferenceHelper); in testPrescheduleNewJobs_updateMigrationState_newJobsScheduled()
[all …]
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/measurement/registration/
DAsyncSourceFetcherTest.java46 import static org.mockito.Mockito.when;
208 .when( in setup()
212 when(mFlags.getMeasurementEnableXNA()).thenReturn(false); in setup()
213 when(mFlags.getMeasurementDebugJoinKeyEnrollmentAllowlist()) in setup()
215 when(mFlags.getMeasurementPlatformDebugAdIdMatchingEnrollmentBlocklist()).thenReturn(""); in setup()
216 when(mFlags.getMeasurementMinimumAggregatableReportWindowInSeconds()) in setup()
219 .when(mFlags).getMeasurementMinimumEventReportWindowInSeconds(); in setup()
221 .when(mFlags).getMeasurementFlexApiMaxEventReports(); in setup()
223 .when(mFlags).getMeasurementFlexApiMaxEventReportWindows(); in setup()
224 when(mFlags.getMeasurementMaxAggregateKeysPerSourceRegistration()).thenReturn( in setup()
[all …]

12345678910>>...142