/frameworks/base/services/tests/servicestests/src/com/android/server/timezonedetector/ |
D | TimeZoneDetectorServiceTest.java | 59 private Context mMockContext; field in TimeZoneDetectorServiceTest 70 mMockContext = mock(Context.class); in setUp() 83 mMockContext, mTestHandler, mTestCallerIdentityInjector, in setUp() 96 .when(mMockContext).enforceCallingPermission(anyString(), any()); in testGetCapabilitiesAndConfig_withoutPermission() 102 verify(mMockContext).enforceCallingPermission( in testGetCapabilitiesAndConfig_withoutPermission() 110 doNothing().when(mMockContext).enforceCallingPermission(anyString(), any()); in testGetCapabilitiesAndConfig() 119 verify(mMockContext).enforceCallingPermission( in testGetCapabilitiesAndConfig() 127 .when(mMockContext).enforceCallingPermission(anyString(), any()); in testAddListener_withoutPermission() 134 verify(mMockContext).enforceCallingPermission( in testAddListener_withoutPermission() 143 .when(mMockContext).enforceCallingPermission(anyString(), any()); in testRemoveListener_withoutPermission() [all …]
|
/frameworks/opt/telephony/tests/telephonytests/src/com/android/internal/telephony/ |
D | TelephonyPermissionsTest.java | 71 private Context mMockContext; field in TelephonyPermissionsTest 100 when(mMockContext.getSystemService(Context.TELEPHONY_SERVICE)).thenReturn( in setUp() 104 when(mMockContext.getSystemService(Context.APP_OPS_SERVICE)).thenReturn(mMockAppOps); in setUp() 105 when(mMockContext.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE)).thenReturn( in setUp() 112 when(mMockContext.getSystemService(Context.LEGACY_PERMISSION_SERVICE)).thenReturn( in setUp() 116 doThrow(new SecurityException()).when(mMockContext) in setUp() 118 doThrow(new SecurityException()).when(mMockContext) in setUp() 128 when(mMockContext.checkPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, in setUp() 137 mMockContext, SUB_ID, PID, UID, PACKAGE, FEATURE, MSG); in testCheckReadPhoneState_noPermissions() 146 doNothing().when(mMockContext).enforcePermission( in testCheckReadPhoneState_hasPrivilegedPermission() [all …]
|
D | SmsPermissionsTest.java | 56 private Context mMockContext; field in SmsPermissionsTest 75 mMockPhone, mMockContext, mMockAppOps) { in setUp() 111 Mockito.doThrow(new SecurityException(MESSAGE)).when(mMockContext) in testCheckCallingSendTextPermissions_persist_noGrant() 137 Mockito.doThrow(new SecurityException(MESSAGE)).when(mMockContext) in testCheckCallingSendTextPermissions_noPersist_grantViaCarrierApp() 139 Mockito.doThrow(new SecurityException(MESSAGE)).when(mMockContext) in testCheckCallingSendTextPermissions_noPersist_grantViaCarrierApp() 158 Mockito.doThrow(new SecurityException(MESSAGE)).when(mMockContext) in testCheckCallingSendTextPermissions_noPersist_noModify() 172 Mockito.doThrow(new SecurityException(MESSAGE)).when(mMockContext) in testCheckCallingSendTextPermissions_noPersist_noSendSmsPermission() 198 Mockito.when(mMockContext.checkCallingOrSelfPermission( in testCheckCallingOrSelfCanGetSmscAddressPermissions_defaultSmsApp() 206 Mockito.when(mMockContext.checkCallingOrSelfPermission( in testCheckCallingOrSelfCanGetSmscAddressPermissions_hasReadPrivilegedPhoneState() 214 Mockito.when(mMockContext.getSystemService(Context.TELEPHONY_SERVICE)).thenReturn( in testCheckCallingOrSelfCanGetSmscAddressPermissions_noPermissions() [all …]
|
D | GbaManagerTest.java | 78 @Mock Context mMockContext; field in GbaManagerTest 93 when(mMockContext.bindService(any(), any(), anyInt())).thenReturn(true); in setUp() 95 mTestGbaManager = new GbaManager(mMockContext, TEST_SUB_ID, null, 0); in setUp() 121 verify(mMockContext, never()).bindService(any(), any(), anyInt()); in testFailOnRequest() 144 when(mMockContext.bindService(any(), any(), anyInt())).thenReturn(false); in testFailAndRetryOnRequest() 152 verify(mMockContext, times(i + 1)).bindService(any(), any(), anyInt()); in testFailAndRetryOnRequest() 203 verify(mMockContext, never()).bindService(any(), any(), anyInt()); in testDontBindServiceWhenPackageNameChanged() 215 verify(mMockContext, never()).bindService(any(), any(), anyInt()); in testDontBindServiceWhenReleaseTimeChanged() 233 verify(mMockContext, atLeastOnce()).bindService(intentCaptor.capture(), in bindService() 243 verify(mMockContext).unbindService(eq(conn)); in unbindService()
|
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/fuelgauge/ |
D | BatterySaverUtilsTest.java | 49 private Context mMockContext; field in BatterySaverUtilsTest 61 when(mMockContext.getContentResolver()).thenReturn(mMockResolver); in setUp() 62 when(mMockContext.getSystemService(eq(PowerManager.class))).thenReturn(mMockPowerManager); in setUp() 71 assertThat(BatterySaverUtils.setPowerSaveMode(mMockContext, true, true)).isFalse(); in testSetPowerSaveMode_enable_firstCall_needWarning() 73 verify(mMockContext, times(1)).sendBroadcast(any(Intent.class)); in testSetPowerSaveMode_enable_firstCall_needWarning() 88 assertThat(BatterySaverUtils.setPowerSaveMode(mMockContext, true, true)).isTrue(); in testSetPowerSaveMode_enable_secondCall_needWarning() 90 verify(mMockContext, times(0)).sendBroadcast(any(Intent.class)); in testSetPowerSaveMode_enable_secondCall_needWarning() 102 assertThat(BatterySaverUtils.setPowerSaveMode(mMockContext, true, true)).isTrue(); in testSetPowerSaveMode_enable_thridCall_needWarning() 104 verify(mMockContext, times(0)).sendBroadcast(any(Intent.class)); in testSetPowerSaveMode_enable_thridCall_needWarning() 116 assertThat(BatterySaverUtils.setPowerSaveMode(mMockContext, true, false)).isTrue(); in testSetPowerSaveMode_enable_firstCall_noWarning() [all …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/timedetector/ |
D | TimeDetectorServiceTest.java | 57 private Context mMockContext; field in TimeDetectorServiceTest 67 mMockContext = mock(Context.class); in setUp() 77 mMockContext, mTestHandler, mStubbedTimeDetectorStrategy); in setUp() 89 .when(mMockContext).enforceCallingPermission(anyString(), any()); in testSuggestTelephonyTime_withoutPermission() 96 verify(mMockContext).enforceCallingPermission( in testSuggestTelephonyTime_withoutPermission() 104 doNothing().when(mMockContext).enforceCallingPermission(anyString(), any()); in testSuggestTelephonyTime() 110 verify(mMockContext).enforceCallingPermission( in testSuggestTelephonyTime() 121 .when(mMockContext).enforceCallingOrSelfPermission(anyString(), any()); in testSuggestManualTime_withoutPermission() 128 verify(mMockContext).enforceCallingOrSelfPermission( in testSuggestManualTime_withoutPermission() 136 doNothing().when(mMockContext).enforceCallingOrSelfPermission(anyString(), any()); in testSuggestManualTime() [all …]
|
D | GnssTimeUpdateServiceTest.java | 58 @Mock private Context mMockContext; field in GnssTimeUpdateServiceTest 70 when(mMockContext.createAttributionContext(anyString())) in setUp() 71 .thenReturn(mMockContext); in setUp() 73 when(mMockContext.getSystemServiceName(TimeDetector.class)) in setUp() 75 when(mMockContext.getSystemService(TimeDetector.class)) in setUp() 78 when(mMockContext.getSystemServiceName(LocationManager.class)) in setUp() 80 when(mMockContext.getSystemService(LocationManager.class)) in setUp() 83 when(mMockContext.getSystemServiceName(AlarmManager.class)) in setUp() 85 when(mMockContext.getSystemService(AlarmManager.class)) in setUp() 91 new GnssTimeUpdateService(mMockContext); in setUp()
|
/frameworks/base/services/tests/uiservicestests/src/com/android/server/notification/ |
D | NotificationRecordTest.java | 91 private final Context mMockContext = mock(Context.class); field in NotificationRecordTest 126 when(mMockContext.getSystemService(eq(Vibrator.class))).thenReturn(mVibrator); in setUp() 127 when(mMockContext.getResources()).thenReturn(getContext().getResources()); in setUp() 128 when(mMockContext.getPackageManager()).thenReturn(mPm); in setUp() 129 when(mMockContext.getContentResolver()).thenReturn(mContentResolver); in setUp() 132 when(mMockContext.getApplicationInfo()).thenReturn(appInfo); in setUp() 138 final Builder builder = new Builder(mMockContext) in getNotification() 188 final Builder builder = new Builder(mMockContext) in getStyledNotification() 210 final Builder builder = new Builder(mMockContext) in getInsistentNotification() 233 final Builder builder = new Builder(mMockContext) in getMessagingStyleNotification() [all …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/ |
D | NetworkScorerAppManagerTest.java | 71 @Mock private Context mMockContext; field in NetworkScorerAppManagerTest 83 when(mMockContext.getPackageManager()).thenReturn(mMockPm); in setUp() 87 when(mMockContext.getResources()).thenReturn(mResources); in setUp() 88 when(mMockContext.getSystemService(Context.APP_OPS_SERVICE)).thenReturn(mAppOpsManager); in setUp() 93 mNetworkScorerAppManager = new NetworkScorerAppManager(mMockContext, mSettingsFacade); in setUp() 253 verify(mSettingsFacade).putString(mMockContext, in testSetActiveScorer_nullPackage_currentIsSet() 255 verify(mSettingsFacade).putInt(mMockContext, in testSetActiveScorer_nullPackage_currentIsSet() 278 verify(mSettingsFacade).putString(mMockContext, in testSetActiveScorer_validPackage() 280 verify(mSettingsFacade).putInt(mMockContext, in testSetActiveScorer_validPackage() 318 verify(mSettingsFacade).putInt(mMockContext, in testUpdateState_currentPackageValid() [all …]
|
/frameworks/opt/net/wifi/libs/WifiTrackerLib/tests/src/com/android/wifitrackerlib/ |
D | UtilsTest.java | 97 @Mock private Context mMockContext; field in UtilsTest 114 when(mMockContext.getResources()).thenReturn(mMockResources); in setUp() 115 when(mMockContext.getSystemService(Context.NETWORK_SCORE_SERVICE)) in setUp() 117 when(mMockContext.getSystemService(Context.CARRIER_CONFIG_SERVICE)) in setUp() 119 when(mMockContext.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE)) in setUp() 121 when(mMockContext.getSystemService(Context.TELEPHONY_SERVICE)) in setUp() 157 final String autoConnectDescription = getAutoConnectDescription(mMockContext, entry); in testGetAutoConnectDescription_autoJoinEnabled_returnEmptyString() 171 final String autoConnectDescription = getAutoConnectDescription(mMockContext, entry); in testGetAutoConnectDescription_autoJoinDisabled_returnDisable() 184 final String meteredDescription = getMeteredDescription(mMockContext, entry); in testGetMeteredDescription_noOverrideNoHint_returnEmptyString() 198 final String meteredDescription = getMeteredDescription(mMockContext, entry); in testGetMeteredDescription_overrideMetered_returnMetered() [all …]
|
D | WifiPickerTrackerTest.java | 83 private Context mMockContext; field in WifiPickerTrackerTest 119 return new WifiPickerTracker(mMockLifecycle, mMockContext, in createTestWifiPickerTracker() 156 when(mMockContext.getResources()).thenReturn(mMockResources); in setUp() 157 when(mMockContext.getSystemService(Context.NETWORK_SCORE_SERVICE)) in setUp() 159 when(mMockContext.getSystemService(Context.TELEPHONY_SERVICE)) in setUp() 171 verify(mMockContext).registerReceiver(mBroadcastReceiverCaptor.capture(), in testWifiStateChangeBroadcast_updatesWifiState() 176 mBroadcastReceiverCaptor.getValue().onReceive(mMockContext, in testWifiStateChangeBroadcast_updatesWifiState() 183 mBroadcastReceiverCaptor.getValue().onReceive(mMockContext, in testWifiStateChangeBroadcast_updatesWifiState() 197 verify(mMockContext).registerReceiver(mBroadcastReceiverCaptor.capture(), in testWifiStateChangeBroadcast_notifiesListener() 200 mBroadcastReceiverCaptor.getValue().onReceive(mMockContext, in testWifiStateChangeBroadcast_notifiesListener() [all …]
|
D | PasspointWifiEntryTest.java | 63 @Mock private Context mMockContext; field in PasspointWifiEntryTest 95 when(mMockContext.getResources()).thenReturn(mMockResources); in setUp() 109 PasspointWifiEntry passpointWifiEntry = new PasspointWifiEntry(mMockContext, mTestHandler, in testGetSummary_expiredTimeNotAvailable_notShowExpired() 122 PasspointWifiEntry passpointWifiEntry = new PasspointWifiEntry(mMockContext, mTestHandler, in testGetSummary_expired_showExpired() 142 PasspointWifiEntry entry = new PasspointWifiEntry(mMockContext, mTestHandler, in testGetMeteredChoice_afterSetMeteredChoice_getCorrectValue() 158 when(mMockContext.getResources()).thenReturn(mockResources); in testGetSummary_connectedWifiNetwork_showsConnected() 164 when(mMockContext.getSystemService(Context.CONNECTIVITY_SERVICE)) in testGetSummary_connectedWifiNetwork_showsConnected() 175 PasspointWifiEntry entry = new PasspointWifiEntry(mMockContext, mTestHandler, in testGetSummary_connectedWifiNetwork_showsConnected() 198 when(mMockContext.getResources()).thenReturn(mockResources); in testGetSummary_providerModelConnectedButNotDefault_doesNotShowConnected() 204 when(mMockContext.getSystemService(Context.CONNECTIVITY_SERVICE)) in testGetSummary_providerModelConnectedButNotDefault_doesNotShowConnected() [all …]
|
D | StandardWifiEntryTest.java | 101 @Mock private Context mMockContext; field in StandardWifiEntryTest 136 when(mMockContext.getSystemService(Context.NETWORK_SCORE_SERVICE)) in setUp() 141 when(mMockContext.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE)) in setUp() 151 new StandardWifiEntry(mMockContext, mTestHandler, in testConstructor_mismatchedSsids_throwsException() 168 final StandardWifiEntry entry = new StandardWifiEntry(mMockContext, mTestHandler, in testConstructor_scanResults_setsBestLevel() 189 final StandardWifiEntry unsecureEntry = new StandardWifiEntry(mMockContext, mTestHandler, in testConstructor_targetingNewSecurity_scanResultsSetSecurity() 194 final StandardWifiEntry secureEntry = new StandardWifiEntry(mMockContext, mTestHandler, in testConstructor_targetingNewSecurity_scanResultsSetSecurity() 209 final StandardWifiEntry entry = new StandardWifiEntry(mMockContext, mTestHandler, in testUpdateScanResultInfo_mismatchedSsids_throwsException() 228 final StandardWifiEntry entry = new StandardWifiEntry(mMockContext, mTestHandler, in testUpdateScanResultInfo_notifiesListener() 245 final StandardWifiEntry entry = new StandardWifiEntry(mMockContext, mTestHandler, in testUpdateScanResultInfo_updatesLevel() [all …]
|
D | SavedNetworkTrackerTest.java | 69 private Context mMockContext; field in SavedNetworkTrackerTest 89 return new SavedNetworkTracker(mMockLifecycle, mMockContext, in createTestSavedNetworkTracker() 112 when(mMockContext.getSystemService(Context.NETWORK_SCORE_SERVICE)) in setUp() 146 verify(mMockContext).registerReceiver(mBroadcastReceiverCaptor.capture(), in testWifiStateChangeBroadcast_updatesWifiState() 151 mBroadcastReceiverCaptor.getValue().onReceive(mMockContext, in testWifiStateChangeBroadcast_updatesWifiState() 158 mBroadcastReceiverCaptor.getValue().onReceive(mMockContext, in testWifiStateChangeBroadcast_updatesWifiState() 171 verify(mMockContext).registerReceiver(mBroadcastReceiverCaptor.capture(), in testWifiStateChangeBroadcast_notifiesListener() 174 mBroadcastReceiverCaptor.getValue().onReceive(mMockContext, in testWifiStateChangeBroadcast_notifiesListener() 189 verify(mMockContext).registerReceiver(mBroadcastReceiverCaptor.capture(), in testConfiguredNetworksChanged_notifiesListener() 192 mBroadcastReceiverCaptor.getValue().onReceive(mMockContext, in testConfiguredNetworksChanged_notifiesListener() [all …]
|
D | MergedCarrierEntryTest.java | 49 @Mock private Context mMockContext; field in MergedCarrierEntryTest 68 when(mMockContext.getMainLooper()).thenReturn(Looper.getMainLooper()); in setUp() 69 when(mMockContext.getResources()).thenReturn(mMockResources); in setUp() 79 mMockScoreCache, false, mMockContext, subId); in testGetConnectedState_wifiInfoMatches_returnsConnected() 94 mMockScoreCache, false, mMockContext, subId); in testConnect_disablesNonCarrierMergedWifi() 108 mMockScoreCache, false, mMockContext, subId); in testDisconnect_enablesNonCarrierMergedWifiAndTriggersScan() 120 mMockScoreCache, false, mMockContext, subId); in testCanConnect_cellIsDefaultRoute_returnsFalse() 134 mMockScoreCache, false, mMockContext, subId); in testGetSsid_connected_returnsSanitizedWifiInfoSsid()
|
D | StandardNetworkDetailsTrackerTest.java | 68 private Context mMockContext; field in StandardNetworkDetailsTrackerTest 87 return new StandardNetworkDetailsTracker(mMockLifecycle, mMockContext, in createTestStandardNetworkDetailsTracker() 111 when(mMockContext.getSystemService(Context.NETWORK_SCORE_SERVICE)) in setUp() 163 verify(mMockContext).registerReceiver(mBroadcastReceiverCaptor.capture(), in testScanResultsAvailableAction_updates_getLevel() 173 mBroadcastReceiverCaptor.getValue().onReceive(mMockContext, in testScanResultsAvailableAction_updates_getLevel() 183 mBroadcastReceiverCaptor.getValue().onReceive(mMockContext, in testScanResultsAvailableAction_updates_getLevel() 202 verify(mMockContext).registerReceiver(mBroadcastReceiverCaptor.capture(), in testConfiguredNetworksChangedAction_updates_isSaved() 214 mBroadcastReceiverCaptor.getValue().onReceive(mMockContext, in testConfiguredNetworksChangedAction_updates_isSaved() 222 mBroadcastReceiverCaptor.getValue().onReceive(mMockContext, in testConfiguredNetworksChangedAction_updates_isSaved() 243 verify(mMockContext).registerReceiver(mBroadcastReceiverCaptor.capture(), in testWifiStateChanged_disabled_clearsLevel() [all …]
|
/frameworks/base/core/tests/coretests/src/com/android/internal/app/ |
D | ResolverListControllerTest.java | 67 @Mock private Context mMockContext; field in ResolverListControllerTest 83 when(mMockContext.getResources()).thenReturn(mMockResources); in setUp() 84 when(mMockContext.getPackageName()).thenReturn("android"); in setUp() 85 when(mMockContext.getUserId()).thenReturn(54321); in setUp() 86 when(mMockContext.getSharedPreferences(anyString(), anyInt())).thenReturn(null); in setUp() 87 when(mMockContext.getPackageManager()).thenReturn(mMockPackageManager); in setUp() 114 when(mMockContext.getOpPackageName()).thenReturn(refererPackage); in reportChooserSelection() 115 mUsm = new UsageStatsManager(mMockContext, mMockService); in reportChooserSelection() 116 when(mMockContext.getSystemService(Context.USAGE_STATS_SERVICE)).thenReturn(mUsm); in reportChooserSelection() 117 mController = new ResolverListController(mMockContext, mMockPackageManager, sendIntent, in reportChooserSelection() [all …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/integrity/ |
D | AppIntegrityManagerServiceImplTest.java | 139 @Mock Context mMockContext; field in AppIntegrityManagerServiceImplTest 176 mMockContext, in setup() 185 when(mMockContext.getPackageManager()).thenReturn(mSpyPackageManager); in setup() 186 when(mMockContext.getResources()).thenReturn(mMockResources); in setup() 190 when(mMockContext.getContentResolver()).thenReturn(mRealContext.getContentResolver()); in setup() 300 verify(mMockContext).registerReceiver(any(), intentFilterCaptor.capture(), any(), any()); in broadcastReceiverRegistration() 315 verify(mMockContext) in handleBroadcast_correctArgs() 320 broadcastReceiverCaptor.getValue().onReceive(mMockContext, intent); in handleBroadcast_correctArgs() 352 verify(mMockContext) in handleBroadcast_correctArgs_multipleCerts() 358 broadcastReceiverCaptor.getValue().onReceive(mMockContext, intent); in handleBroadcast_correctArgs_multipleCerts() [all …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/tv/ |
D | TvRemoteProviderWatcherTest.java | 48 Context mMockContext; field in TvRemoteProviderWatcherTest 64 when(mMockContext.getPackageManager()).thenReturn(mMockPackageManager); in setUp() 65 when(mMockContext.getResources()).thenReturn(mMockResources); in setUp() 84 mTvRemoteProviderWatcher = new TvRemoteProviderWatcher(mMockContext, new Object()); in setUp() 96 mMockContext, new Object(), new Handler(Looper.getMainLooper())); in acceptsValidCsvPackageName() 109 mMockContext, new Object(), new Handler(Looper.getMainLooper())); in rejectsInvalidCsvPackageName() 155 mMockContext, new Object(), new Handler(Looper.getMainLooper())); in whitelistingPackageNameIsRequired()
|
/frameworks/base/services/tests/mockingservicestests/src/com/android/server/app/ |
D | GameManagerServiceTests.java | 62 @Mock MockContext mMockContext; field in GameManagerServiceTests 140 mMockContext = new MockContext(InstrumentationRegistry.getContext()); in setUp() 141 mPackageName = mMockContext.getPackageName(); in setUp() 157 GameManagerService gameManagerService = new GameManagerService(mMockContext); in tearDown() 165 mMockContext.setPermission(Manifest.permission.MANAGE_GAME_MODE, in mockModifyGameModeGranted() 170 mMockContext.setPermission(Manifest.permission.MANAGE_GAME_MODE, in mockModifyGameModeDenied() 271 GameManagerService gameManagerService = new GameManagerService(mMockContext); in testGameModeDefaultValue() 285 GameManagerService gameManagerService = new GameManagerService(mMockContext); in testDefaultValueForNonexistentUser() 300 GameManagerService gameManagerService = new GameManagerService(mMockContext); in testGameMode() 323 GameManagerService gameManagerService = new GameManagerService(mMockContext); in testGetGameModeInvalidPackageName() [all …]
|
/frameworks/base/services/tests/mockingservicestests/src/com/android/server/ |
D | RescuePartyTest.java | 101 private Context mMockContext; field in RescuePartyTest 131 when(mMockContext.getContentResolver()).thenReturn(mMockContentResolver); in setUp() 191 .when(() -> PackageWatchdog.getInstance(mMockContext)); in setUp() 207 RescueParty.onSettingsProviderPublished(mMockContext); in testBootLoopDetectionWithExecutionForAllRescueLevels() 218 RescuePartyObserver observer = RescuePartyObserver.getInstance(mMockContext); in testBootLoopDetectionWithExecutionForAllRescueLevels() 268 RescueParty.onSettingsProviderPublished(mMockContext); in testNonPersistentAppCrashDetectionWithScopedResets() 273 RescuePartyObserver observer = RescuePartyObserver.getInstance(mMockContext); in testNonPersistentAppCrashDetectionWithScopedResets() 323 RescueParty.onSettingsProviderPublished(mMockContext); in testNonDeviceConfigSettingsOnlyResetOncePerLevel() 328 RescuePartyObserver observer = RescuePartyObserver.getInstance(mMockContext); in testNonDeviceConfigSettingsOnlyResetOncePerLevel() 401 RescueParty.onSettingsProviderPublished(mMockContext); in testNativeRescuePartyResets() [all …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/rollback/ |
D | WatchdogRollbackLoggerTest.java | 49 private Context mMockContext = mock(Context.class); field in WatchdogRollbackLoggerTest 65 when(mMockContext.getPackageManager()).thenReturn(mMockPm); in setUp() 79 VersionedPackage logPackage = WatchdogRollbackLogger.getLogPackage(mMockContext, in testLogPackageHasNoMetadata() 97 VersionedPackage logPackage = WatchdogRollbackLogger.getLogPackage(mMockContext, in testLogPackageParentKeyIsNull() 115 VersionedPackage logPackage = WatchdogRollbackLogger.getLogPackage(mMockContext, in testLogPackageHasParentKey() 136 VersionedPackage logPackage = WatchdogRollbackLogger.getLogPackage(mMockContext, in testLogPackageNameNotFound() 160 WatchdogRollbackLogger.logApexdRevert(mMockContext, sFailingPackages, "test_process"); in testApexdLoggingCallsWithParents() 180 WatchdogRollbackLogger.logApexdRevert(mMockContext, sFailingPackages, "test_process"); in testApexdLoggingCallsWithNoParents()
|
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/ |
D | NfcTileTest.java | 57 private Context mMockContext; field in NfcTileTest 81 when(mHost.getContext()).thenReturn(mMockContext); in setUp() 82 when(mMockContext.getPackageManager()).thenReturn(mPackageManager); in setUp() 102 when(mMockContext.getString(R.string.quick_settings_tiles_stock)).thenReturn( in testIsAvailable_stockWithoutNfc_returnsFalse() 110 when(mMockContext.getString(R.string.quick_settings_tiles_stock)).thenReturn( in testIsAvailable_stockWithNfc_returnsTrue()
|
/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/ |
D | ResumeOnRebootServiceProviderTests.java | 53 Context mMockContext; field in ResumeOnRebootServiceProviderTests 65 when(mMockContext.getUserId()).thenReturn(0); in setUp() 80 assertThat(new ResumeOnRebootServiceProvider(mMockContext, in noServiceFound() 90 assertThat(new ResumeOnRebootServiceProvider(mMockContext, in serviceNotGuardedWithPermission() 101 assertThat(new ResumeOnRebootServiceProvider(mMockContext, in serviceResolved()
|
/frameworks/libs/net/common/tests/unit/src/com/android/net/module/util/ |
D | LocationPermissionCheckerTest.java | 65 @Mock private Context mMockContext; field in LocationPermissionCheckerTest 108 when(mMockContext.getPackageManager()).thenReturn(mMockPkgMgr); in setupMocks() 128 when(mMockContext.getSystemService(name)).thenReturn(service); in mockSystemService() 129 when(mMockContext.getSystemServiceName(clazz)).thenReturn(name); in mockSystemService() 131 when(mMockContext.getSystemService(clazz)).thenCallRealMethod(); in mockSystemService() 137 mChecker = new LocationPermissionChecker(mMockContext) { in setupTestCase() 165 doAnswer(mReturnPermission).when(mMockContext).checkPermission( in setupMockInterface() 170 when(mMockContext.checkPermission(mManifestStringCoarse, -1, mUid)) in setupMockInterface() 172 when(mMockContext.checkPermission(mManifestStringFine, -1, mUid)) in setupMockInterface() 174 when(mMockContext.checkPermission(NETWORK_SETTINGS, -1, mUid)) in setupMockInterface()
|