Home
last modified time | relevance | path

Searched refs:spyContext (Results 1 – 14 of 14) sorted by relevance

/packages/modules/OnDevicePersonalization/tests/servicetests/src/com/android/ondevicepersonalization/services/data/user/
DUserDataCollectionJobServiceTest.java158 Context spyContext = getSpyContext(); in testSchedule_scheduleSuccessful_resultCodeSuccess() local
160 doReturn(mockJobScheduler).when(spyContext).getSystemService(JobScheduler.class); in testSchedule_scheduleSuccessful_resultCodeSuccess()
166 int resultCode = mService.schedule(spyContext, /* forceSchedule */ false); in testSchedule_scheduleSuccessful_resultCodeSuccess()
173 Context spyContext = getSpyContext(); in testSchedule_scheduleFailure_resultCodeFailed() local
175 doReturn(mockJobScheduler).when(spyContext).getSystemService(JobScheduler.class); in testSchedule_scheduleFailure_resultCodeFailed()
181 int resultCode = mService.schedule(spyContext, /* forceSchedule */ false); in testSchedule_scheduleFailure_resultCodeFailed()
188 Context spyContext = getSpyContext(); in testSchedule_pendingJobForceSchedule_resultCodeSuccess() local
190 doReturn(mockJobScheduler).when(spyContext).getSystemService(JobScheduler.class); in testSchedule_pendingJobForceSchedule_resultCodeSuccess()
197 int resultCode = mService.schedule(spyContext, /* forceSchedule */ true); in testSchedule_pendingJobForceSchedule_resultCodeSuccess()
204 Context spyContext = getSpyContext(); in testSchedule_nullJobScheduler_resultCodeFailed() local
[all …]
/packages/apps/Launcher3/tests/src/com/android/launcher3/model/
DLoaderTaskTest.kt283 val spyContext = context in <lambda>() constant
296 spyContext, in <lambda>()
302 Settings.Secure.putInt(spyContext.contentResolver, "launcher_broadcast_installed_apps", 0) in <lambda>()
303 RestoreDbTask.setPending(spyContext) in <lambda>()
313 verify(spyContext).sendBroadcast(argumentCaptor.capture()) in <lambda>()
354 val spyContext = context in <lambda>() constant
367 spyContext, in <lambda>()
373 Settings.Secure.putInt(spyContext.contentResolver, "launcher_broadcast_installed_apps", 0) in <lambda>()
382 verify(spyContext, times(0)).sendBroadcast(any()) in <lambda>()
390 val spyContext = context in <lambda>() constant
[all …]
/packages/apps/Settings/tests/robotests/src/com/android/settings/applications/
DApplicationFeatureProviderImplTest.java308 Context spyContext = spy(RuntimeEnvironment.application); in getKeepEnabledPackages_shouldContainDefaultPhoneAndSmsAndLocationHistory() local
310 when(spyContext.getSystemService(Context.LOCATION_SERVICE)).thenReturn(mLocationManager); in getKeepEnabledPackages_shouldContainDefaultPhoneAndSmsAndLocationHistory()
312 ReflectionHelpers.setField(mProvider, "mContext", spyContext); in getKeepEnabledPackages_shouldContainDefaultPhoneAndSmsAndLocationHistory()
339 Context spyContext = spy(RuntimeEnvironment.application); in getKeepEnabledPackages_hasEuiccComponent_shouldContainEuiccPackage() local
341 when(spyContext.getSystemService(Context.LOCATION_SERVICE)).thenReturn(mLocationManager); in getKeepEnabledPackages_hasEuiccComponent_shouldContainEuiccPackage()
343 ReflectionHelpers.setField(mProvider, "mContext", spyContext); in getKeepEnabledPackages_hasEuiccComponent_shouldContainEuiccPackage()
361 Context spyContext = spy(RuntimeEnvironment.application); in getKeepEnabledPackages_shouldContainSettingsIntelligence() local
363 when(spyContext.getSystemService(Context.LOCATION_SERVICE)).thenReturn(mLocationManager); in getKeepEnabledPackages_shouldContainSettingsIntelligence()
365 ReflectionHelpers.setField(mProvider, "mContext", spyContext); in getKeepEnabledPackages_shouldContainSettingsIntelligence()
392 Context spyContext = spy(RuntimeEnvironment.application); in getKeepEnabledPackages_shouldContainPackageInstaller() local
[all …]
/packages/modules/AdServices/adservices/tests/unittest/service-core/measurement/src/com/android/adservices/service/measurement/reporting/
DDebugReportingJobServiceTest.java247 final Context spyContext = spy(ApplicationProvider.getApplicationContext()); in scheduleIfNeeded_killSwitchOff_previouslyExecuted_dontForceSchedule_dontSchedule() local
249 .when(spyContext) in scheduleIfNeeded_killSwitchOff_previouslyExecuted_dontForceSchedule_dontSchedule()
255 spyContext, DebugReportingJobService.class)) in scheduleIfNeeded_killSwitchOff_previouslyExecuted_dontForceSchedule_dontSchedule()
264 spyContext, /* forceSchedule= */ false); in scheduleIfNeeded_killSwitchOff_previouslyExecuted_dontForceSchedule_dontSchedule()
280 final Context spyContext = spy(ApplicationProvider.getApplicationContext()); in scheduleIfNeeded_withDifferentJobInfo_doesSchedule() local
282 .when(spyContext) in scheduleIfNeeded_withDifferentJobInfo_doesSchedule()
288 spyContext, DebugReportingJobService.class)) in scheduleIfNeeded_withDifferentJobInfo_doesSchedule()
298 spyContext, /* forceSchedule= */ false); in scheduleIfNeeded_withDifferentJobInfo_doesSchedule()
DDebugReportingFallbackJobServiceTest.java205 final Context spyContext = spy(ApplicationProvider.getApplicationContext()); in scheduleIfNeeded_killSwitchOff_previouslyExecuted_dontForceSchedule_dontSchedule() local
207 .when(spyContext) in scheduleIfNeeded_killSwitchOff_previouslyExecuted_dontForceSchedule_dontSchedule()
213 spyContext, in scheduleIfNeeded_killSwitchOff_previouslyExecuted_dontForceSchedule_dontSchedule()
225 spyContext, /* forceSchedule= */ false); in scheduleIfNeeded_killSwitchOff_previouslyExecuted_dontForceSchedule_dontSchedule()
242 final Context spyContext = spy(ApplicationProvider.getApplicationContext()); in scheduleIfNeeded_diffJobInfo_doesSchedule() local
244 .when(spyContext) in scheduleIfNeeded_diffJobInfo_doesSchedule()
250 spyContext, in scheduleIfNeeded_diffJobInfo_doesSchedule()
263 spyContext, /* forceSchedule= */ false); in scheduleIfNeeded_diffJobInfo_doesSchedule()
/packages/apps/Settings/tests/robotests/src/com/android/settings/network/
DSatelliteRepositoryTest.kt55 var spyContext: Context = ApplicationProvider.getApplicationContext() in <lambda>() variable in com.android.settings.network.SatelliteRepositoryTest
68 `when`(this.spyContext.getSystemService(SatelliteManager::class.java)) in <lambda>()
71 repository = SatelliteRepository(spyContext) in <lambda>()
150 `when`(spyContext.getSystemService(SatelliteManager::class.java)).thenReturn(null) in <lambda>()
209 `when`(spyContext.getSystemService(SatelliteManager::class.java)).thenReturn(null) in <lambda>()
254 `when`(spyContext.getSystemService(SatelliteManager::class.java)).thenReturn(null) in <lambda>()
/packages/apps/Settings/tests/spa_unit/src/com/android/settings/datausage/
DDataUsageListTest.kt46 private val spyContext: Context = spy(ApplicationProvider.getApplicationContext()) { in <lambda>() constant
50 private val spyResources = spy(spyContext.resources)
59 spyContext.stub { in setUp()
186 override fun getContext() = spyContext
/packages/modules/AdServices/adservices/tests/unittest/service-core/measurement/src/com/android/adservices/service/measurement/registration/
DAsyncRegistrationQueueJobServiceTest.java385 final Context spyContext = spy(ApplicationProvider.getApplicationContext()); in scheduleIfNeeded_killSwitchOff_previouslyExecuted_dontForceSchedule_dontSchedule() local
387 .when(spyContext) in scheduleIfNeeded_killSwitchOff_previouslyExecuted_dontForceSchedule_dontSchedule()
393 spyContext, in scheduleIfNeeded_killSwitchOff_previouslyExecuted_dontForceSchedule_dontSchedule()
413 spyContext, /* forceSchedule= */ false); in scheduleIfNeeded_killSwitchOff_previouslyExecuted_dontForceSchedule_dontSchedule()
428 final Context spyContext = spy(ApplicationProvider.getApplicationContext()); in scheduleIfNeeded_diffJobInfo_doesSchedule() local
430 .when(spyContext) in scheduleIfNeeded_diffJobInfo_doesSchedule()
436 spyContext, in scheduleIfNeeded_diffJobInfo_doesSchedule()
457 spyContext, /* forceSchedule= */ false); in scheduleIfNeeded_diffJobInfo_doesSchedule()
/packages/modules/AppSearch/testing/contactsindexertests/src/com/android/server/appsearch/contactsindexer/
DContactsIndexerImplTest.java475 Context spyContext = new ContextWrapper(ApplicationProvider.getApplicationContext()) { in testContactsIndexerImpl_batchUpdateContactsNullCursor_shouldContinueOnError() local
481 ContactsIndexerImpl contactsIndexerImpl = new ContactsIndexerImpl(spyContext, in testContactsIndexerImpl_batchUpdateContactsNullCursor_shouldContinueOnError()
522 Context spyContext = new ContextWrapper(ApplicationProvider.getApplicationContext()) { in testContactsIndexerImpl_batchUpdateContactsNullCursor_shouldNotContinueOnError() local
528 ContactsIndexerImpl contactsIndexerImpl = new ContactsIndexerImpl(spyContext, in testContactsIndexerImpl_batchUpdateContactsNullCursor_shouldNotContinueOnError()
564 Context spyContext = new ContextWrapper(ApplicationProvider.getApplicationContext()) { in testContactsIndexerImpl_batchUpdateContactsThrows_shouldContinueOnError() local
570 ContactsIndexerImpl contactsIndexerImpl = new ContactsIndexerImpl(spyContext, in testContactsIndexerImpl_batchUpdateContactsThrows_shouldContinueOnError()
611 Context spyContext = new ContextWrapper(ApplicationProvider.getApplicationContext()) { in testContactsIndexerImpl_batchUpdateContactsThrows_shouldNotContinueOnError() local
617 ContactsIndexerImpl contactsIndexerImpl = new ContactsIndexerImpl(spyContext, in testContactsIndexerImpl_batchUpdateContactsThrows_shouldNotContinueOnError()
/packages/modules/AdServices/sdksandbox/tests/testutils/device-side/com/android/server/sdksandbox/
DFakeInjector.java48 public FakeInjector(Context spyContext) { in FakeInjector() argument
49 super(spyContext); in FakeInjector()
/packages/services/Car/experimental/tests/experimentalcarservice_unit_test/src/com/android/experimentalcar/
DDriverDistractionExperimentalFeatureServiceTest.java218 Context spyContext = spy(InstrumentationRegistry.getInstrumentation().getTargetContext()); in testInit_bindsToServicesInXmlConfig() local
221 Resources spyResources = spy(spyContext.getResources()); in testInit_bindsToServicesInXmlConfig()
222 doReturn(spyResources).when(spyContext).getResources(); in testInit_bindsToServicesInXmlConfig()
227 doReturn(mInputManager).when(spyContext).getSystemService(Context.INPUT_SERVICE); in testInit_bindsToServicesInXmlConfig()
236 ServiceLauncherContext serviceLauncherContext = new ServiceLauncherContext(spyContext); in testInit_bindsToServicesInXmlConfig()
239 spyContext.getMainLooper(), mHandler); in testInit_bindsToServicesInXmlConfig()
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/common/
DPackageChangedReceiverTest.java1054 Context spyContext = Mockito.spy(ApplicationProvider.getApplicationContext()); in testReceive_onT_onExtServices() local
1056 .when(spyContext) in testReceive_onT_onExtServices()
1058 receiver.onReceive(spyContext, intent); in testReceive_onT_onExtServices()
1071 Context spyContext = Mockito.spy(ApplicationProvider.getApplicationContext()); in testReceive_onS_onExtServices() local
1073 .when(spyContext) in testReceive_onS_onExtServices()
1075 receiver.onReceive(spyContext, intent); in testReceive_onS_onExtServices()
/packages/modules/AdServices/adservices/tests/unittest/service-core/appsearch/src/com/android/adservices/service/appsearch/
DAppSearchConsentStorageManagerTest.java510 Context spyContext = Mockito.spy(appContext.get()); in testMigrateConsentData_FromExtServices() local
513 .when(spyContext) in testMigrateConsentData_FromExtServices()
515 appContext.set(spyContext); in testMigrateConsentData_FromExtServices()
/packages/apps/Settings/tests/robotests/src/com/android/settings/accessibility/
DToggleScreenMagnificationPreferenceFragmentTest.java156 Context spyContext = spy(mContext); in setUpTestFragment() local
157 when(spyContext.getResources()).thenReturn(mSpyResources); in setUpTestFragment()
166 fragment.setContext(spyContext); in setUpTestFragment()