/frameworks/base/core/tests/coretests/src/com/android/internal/accessibility/util/ |
D | ShortcutUtilsTest.java | 87 private ContextWrapper mContextSpy; field in ShortcutUtilsTest 92 mContextSpy = spy( in setUp() 95 ContentResolver contentResolver = mSettingsProviderRule.mockContentResolver(mContextSpy); in setUp() 96 when(mContextSpy.getContentResolver()).thenReturn(contentResolver); in setUp() 100 mContextSpy, mock(Handler.class), in setUp() 103 when(mContextSpy.getSystemService(Context.ACCESSIBILITY_SERVICE)) in setUp() 113 mContextSpy, in getShortcutTargets_softwareShortcutNoService_emptyResult() 122 mContextSpy, ShortcutConstants.UserShortcutType.HARDWARE, in getShortcutTargets_volumeKeyShortcutNoService_emptyResult() 134 mContextSpy, ShortcutConstants.UserShortcutType.SOFTWARE, in getShortcutTargets_softwareShortcut1Service_return1Service() 146 mContextSpy, ShortcutConstants.UserShortcutType.HARDWARE, in getShortcutTargets_volumeShortcut2Service_return2Service() [all …]
|
/frameworks/base/services/tests/wmtests/src/com/android/server/policy/ |
D | WindowWakeUpPolicyTests.java | 92 private Context mContextSpy; field in WindowWakeUpPolicyTests 99 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getContext())); in setUp() 100 mResourcesSpy = spy(mContextSpy.getResources()); in setUp() 101 when(mContextSpy.getResources()).thenReturn(mResourcesSpy); in setUp() 102 when(mContextSpy.getSystemService(PowerManager.class)).thenReturn(mPowerManager); in setUp() 103 when(mContextSpy.getSystemService(WindowManager.class)).thenReturn(mWindowManager); in setUp() 113 mPolicy = new WindowWakeUpPolicy(mContextSpy, mClock); in testSupportsInputWakeDelegatse_publishesLocalService() 122 mPolicy = new WindowWakeUpPolicy(mContextSpy, mClock); in testDoesNotSupportInputWakeDelegatse_doesNotPublishLocalService() 131 mPolicy = new WindowWakeUpPolicy(mContextSpy, mClock); in testMotionWakeUpDelegation_wakePowerManagerIfDelegateDoesNotHandleWake() 156 mPolicy = new WindowWakeUpPolicy(mContextSpy, mClock); in testKeyWakeUpDelegation_wakePowerManagerIfDelegateDoesNotHandleWake() [all …]
|
/frameworks/base/core/tests/coretests/src/com/android/internal/accessibility/dialog/ |
D | InvisibleToggleAccessibilityServiceTargetTest.java | 84 private ContextWrapper mContextSpy; field in InvisibleToggleAccessibilityServiceTargetTest 90 mContextSpy = spy( in setUp() 93 ContentResolver contentResolver = mSettingsProviderRule.mockContentResolver(mContextSpy); in setUp() 94 when(mContextSpy.getContentResolver()).thenReturn(contentResolver); in setUp() 98 mContextSpy, mock(Handler.class), in setUp() 101 when(mContextSpy.getSystemService(Context.ACCESSIBILITY_SERVICE)) in setUp() 115 mContextSpy, in setUp() 198 mContextSpy.getContentResolver(), in enableA11yService() 205 mContextSpy.getContentResolver(), in addShortcutForA11yService() 214 mContextSpy.getContentResolver(), in assertA11yServiceState() [all …]
|
/frameworks/base/services/tests/uiservicestests/src/com/android/server/slice/ |
D | SliceManagerServiceTest.java | 72 private TestableContext mContextSpy; field in SliceManagerServiceTest 80 mContextSpy = spy(mContext); in setUp() 81 mService = spy(new SliceManagerService(mContextSpy, TestableLooper.get(this).getLooper())); in setUp() 122 when(mContextSpy.checkUriPermission(any(), anyInt(), anyInt(), anyInt())) in testCheckAutoGrantPermissions() 124 when(mContextSpy.checkPermission("perm1", Process.myPid(), Process.myUid())) in testCheckAutoGrantPermissions() 126 when(mContextSpy.checkPermission("perm2", Process.myPid(), Process.myUid())) in testCheckAutoGrantPermissions() 131 verify(mContextSpy).checkPermission(eq("perm1"), eq(Process.myPid()), eq(Process.myUid())); in testCheckAutoGrantPermissions() 132 verify(mContextSpy).checkPermission(eq("perm2"), eq(Process.myPid()), eq(Process.myUid())); in testCheckAutoGrantPermissions()
|
/frameworks/base/services/tests/dreamservicetests/src/com/android/server/dreams/ |
D | DreamManagerServiceMockingTest.java | 57 private ContextWrapper mContextSpy; field in DreamManagerServiceMockingTest 79 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getContext())); in setUp() 80 mResourcesSpy = spy(mContextSpy.getResources()); in setUp() 81 when(mContextSpy.getResources()).thenReturn(mResourcesSpy); in setUp() 88 when(mContextSpy.getSystemService(UserManager.class)).thenReturn(mUserManagerMock); in setUp() 102 return new DreamManagerService(mContextSpy, mTestHandler); in createService()
|
/frameworks/base/packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/ |
D | BiometricDisplayListenerTest.java | 66 private Context mContextSpy; field in BiometricDisplayListenerTest 76 mContextSpy = spy(mContext); in setUp() 77 when(mContextSpy.getDisplay()).thenReturn(mDisplay); in setUp() 87 mContextSpy, mDisplayManager, mHandler, mUdfpsType, mOnChangedCallback); in registersDisplayListener_whenEnabled() 97 mContextSpy, mDisplayManager, mHandler, mUdfpsType, mOnChangedCallback); in unregistersDisplayListener_whenDisabled() 110 mContextSpy, mDisplayManager, mHandler, mSidefpsType, mOnChangedCallback); in callsOnChanged_forSideFingerprint_whenAnythingDisplayChanges()
|
/frameworks/base/services/tests/servicestests/src/com/android/server/logcat/ |
D | LogcatManagerServiceTest.java | 70 private Context mContextSpy; field in LogcatManagerServiceTest 92 when(mContextSpy.getPackageManager()).thenReturn(mPackageManagerMock); in setUp() 102 mService = new LogcatManagerService(mContextSpy, new Injector() { in setUp() 144 verify(mContextSpy, never()).startActivityAsUser(any(), any()); in test_RequestFromBackground_DeclinedWithoutPrompt() 158 verify(mContextSpy, never()).startActivityAsUser(any(), any()); in test_RequestFromBackground_ApprovedIfInstrumented() 170 verify(mContextSpy, never()).startActivityAsUser(any(), any()); in test_RequestFromForegroundService_DeclinedWithoutPrompt() 182 verify(mContextSpy, times(1)).startActivityAsUser(any(), eq(UserHandle.SYSTEM)); in test_RequestFromTop_ShowsPrompt() 205 verify(mContextSpy, times(1)).startActivityAsUser(any(), eq(UserHandle.SYSTEM)); in test_RequestFromTop_Approved() 220 verify(mContextSpy, times(1)).startActivityAsUser(any(), eq(UserHandle.SYSTEM)); in test_RequestFromTop_Declined() 236 verify(mContextSpy, times(1)).startActivityAsUser(any(), eq(UserHandle.SYSTEM)); in test_RequestFromTop_MultipleRequestsApprovedTogether() [all …]
|
/frameworks/base/services/tests/powerservicetests/src/com/android/server/power/ |
D | LowPowerStandbyControllerTest.java | 122 private BroadcastInterceptingContext mContextSpy; field in LowPowerStandbyControllerTest 153 mContextSpy = spy(new BroadcastInterceptingContext(InstrumentationRegistry in setUp() 155 when(mContextSpy.getPackageManager()).thenReturn(mPackageManagerMock); in setUp() 156 when(mContextSpy.getSystemService(AlarmManager.class)).thenReturn(mAlarmManagerMock); in setUp() 157 when(mContextSpy.getSystemService(UserManager.class)).thenReturn(mUserManagerMock); in setUp() 158 PowerManager powerManager = new PowerManager(mContextSpy, mIPowerManagerMock, null, null); in setUp() 159 when(mContextSpy.getSystemService(PowerManager.class)).thenReturn(powerManager); in setUp() 169 mResourcesSpy = spy(mContextSpy.getResources()); in setUp() 170 when(mContextSpy.getResources()).thenReturn(mResourcesSpy); in setUp() 182 MockContentResolver cr = new MockContentResolver(mContextSpy); in setUp() [all …]
|
D | NotifierTest.java | 88 private Context mContextSpy; field in NotifierTest 101 mContextSpy = spy(new TestableContext(InstrumentationRegistry.getContext())); in setUp() 102 mResourcesSpy = spy(mContextSpy.getResources()); in setUp() 103 when(mContextSpy.getResources()).thenReturn(mResourcesSpy); in setUp() 105 when(mContextSpy.getSystemService(Vibrator.class)).thenReturn(mVibrator); in setUp() 107 mService = new PowerManagerService(mContextSpy, mInjector); in setUp() 334 mContextSpy.getContentResolver(), in enableChargingFeedback() 341 mContextSpy.getContentResolver(), in enableChargingFeedback() 351 mContextSpy.getContentResolver(), in enableChargingVibration() 372 mContextSpy, in createNotifier()
|
/frameworks/base/services/tests/servicestests/src/com/android/server/hdmi/ |
D | ActiveSourceActionTest.java | 52 private Context mContextSpy; field in ActiveSourceActionTest 63 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getTargetContext())); in setUp() 66 mHdmiControlService = new HdmiControlService(mContextSpy, Collections.emptyList(), in setUp() 86 mHdmiControlService.setHdmiCecConfig(new FakeHdmiCecConfig(mContextSpy)); in setUp() 97 mPowerManager = new FakePowerManagerWrapper(mContextSpy); in setUp()
|
D | ArcInitiationActionFromAvrTest.java | 51 private Context mContextSpy; field in ArcInitiationActionFromAvrTest 62 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getTargetContext())); in setUp() 67 new HdmiControlService(mContextSpy, Collections.emptyList(), in setUp() 105 hdmiControlService.setHdmiCecConfig(new FakeHdmiCecConfig(mContextSpy)); in setUp() 113 mPowerManager = new FakePowerManagerWrapper(mContextSpy); in setUp()
|
D | SetAudioVolumeLevelDiscoveryActionTest.java | 68 private Context mContextSpy; field in SetAudioVolumeLevelDiscoveryActionTest 82 mContextSpy = spy(new ContextWrapper( in setUp() 87 mHdmiControlServiceSpy = spy(new HdmiControlService(mContextSpy, in setUp() 97 mHdmiControlServiceSpy.setHdmiCecConfig(new FakeHdmiCecConfig(mContextSpy)); in setUp() 110 mPowerManager = new FakePowerManagerWrapper(mContextSpy); in setUp()
|
D | ArcTerminationActionFromAvrTest.java | 54 private Context mContextSpy; field in ArcTerminationActionFromAvrTest 69 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getTargetContext())); in setUp() 74 new HdmiControlService(mContextSpy, Collections.emptyList(), in setUp() 104 hdmiControlService.setHdmiCecConfig(new FakeHdmiCecConfig(mContextSpy)); in setUp() 112 mPowerManager = new FakePowerManagerWrapper(mContextSpy); in setUp()
|
D | HdmiCecAtomLoggingTvTest.java | 72 private Context mContextSpy; field in HdmiCecAtomLoggingTvTest 85 mContextSpy = spy(new ContextWrapper( in setUp() 90 mHdmiControlServiceSpy = spy(new HdmiControlService(mContextSpy, in setUp() 99 HdmiCecConfig hdmiCecConfig = new FakeHdmiCecConfig(mContextSpy); in setUp() 139 mPowerManager = new FakePowerManagerWrapper(mContextSpy); in setUp()
|
D | PowerStatusMonitorActionTest.java | 56 private Context mContextSpy; field in PowerStatusMonitorActionTest 67 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getTargetContext())); in setUp() 71 mHdmiControlService = new HdmiControlService(mContextSpy, in setUp() 92 mHdmiControlService.setHdmiCecConfig(new FakeHdmiCecConfig(mContextSpy)); in setUp() 118 mPowerManager = new FakePowerManagerWrapper(mContextSpy); in setUp()
|
D | DevicePowerStatusActionTest.java | 60 private Context mContextSpy; field in DevicePowerStatusActionTest 78 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getTargetContext())); in setUp() 82 mHdmiControlService = new HdmiControlService(mContextSpy, in setUp() 104 mHdmiControlService.setHdmiCecConfig(new FakeHdmiCecConfig(mContextSpy)); in setUp() 115 mPowerManager = new FakePowerManagerWrapper(mContextSpy); in setUp()
|
D | HdmiCecAtomLoggingTest.java | 79 private Context mContextSpy; field in HdmiCecAtomLoggingTest 92 mContextSpy = spy(new ContextWrapper( in setUp() 97 mHdmiControlServiceSpy = spy(new HdmiControlService(mContextSpy, in setUp() 105 HdmiCecConfig hdmiCecConfig = new FakeHdmiCecConfig(mContextSpy); in setUp() 144 mPowerManager = new FakePowerManagerWrapper(mContextSpy); in setUp()
|
/frameworks/base/services/tests/displayservicetests/src/com/android/server/display/utils/ |
D | AmbientFilterTest.java | 39 private ContextWrapper mContextSpy; field in AmbientFilterTest 45 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getContext())); in setUp() 46 mResourcesSpy = spy(mContextSpy.getResources()); in setUp() 47 when(mContextSpy.getResources()).thenReturn(mResourcesSpy); in setUp()
|
/frameworks/base/services/tests/vibrator/src/com/android/server/vibrator/ |
D | VibrationSettingsTest.java | 136 private ContextWrapper mContextSpy; field in VibrationSettingsTest 144 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getContext())); in setUp() 146 ContentResolver contentResolver = mSettingsProviderRule.mockContentResolver(mContextSpy); in setUp() 147 when(mContextSpy.getContentResolver()).thenReturn(contentResolver); in setUp() 148 when(mContextSpy.getSystemService(eq(Context.AUDIO_SERVICE))).thenReturn(mAudioManagerMock); in setUp() 168 mVibrationSettings = new VibrationSettings(mContextSpy, in createSystemReadyVibrationSettings() 206 VibrationSettings minimalVibrationSettings = new VibrationSettings(mContextSpy, in create_withOnlyRequiredSystemServices() 227 mVibrationSettings.mSettingChangeReceiver.onReceive(mContextSpy, in addListener_ringerModeChangeTriggerListener() 229 mVibrationSettings.mSettingChangeReceiver.onReceive(mContextSpy, in addListener_ringerModeChangeTriggerListener() 271 mVibrationSettings.mSettingChangeReceiver.onReceive(mContextSpy, in removeListener_noMoreCallbacksToListener() [all …]
|
D | InputDeviceDelegateTest.java | 71 private ContextWrapper mContextSpy; field in InputDeviceDelegateTest 81 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getContext())); in setUp() 83 mInputManager = new InputManager(mContextSpy); in setUp() 84 when(mContextSpy.getSystemService(eq(Context.INPUT_SERVICE))) in setUp() 90 mContextSpy, new Handler(mTestLooper.getLooper())); in setUp() 105 mContextSpy, new Handler(mTestLooper.getLooper())); in beforeSystemReady_ignoresAnyUpdate()
|
D | VibrationScalerTest.java | 85 private ContextWrapper mContextSpy; field in VibrationScalerTest 92 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getContext())); in setUp() 94 ContentResolver contentResolver = mSettingsProviderRule.mockContentResolver(mContextSpy); in setUp() 95 when(mContextSpy.getContentResolver()).thenReturn(contentResolver); in setUp() 108 mContextSpy, new Handler(mTestLooper.getLooper()), mVibrationConfigMock); in setUp() 109 mVibrationScaler = new VibrationScaler(mContextSpy, mVibrationSettings); in setUp() 380 mContextSpy.getContentResolver(), settingName, value, UserHandle.USER_CURRENT);
|
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/toast/ |
D | ToastUITest.java | 103 private Context mContextSpy; field in ToastUITest 127 mContextSpy = spy(mContext); in setUp() 128 when(mContextSpy.getPackageManager()).thenReturn(mPackageManager); in setUp() 129 doReturn(mContextSpy).when(mContextSpy).createContextAsUser(any(), anyInt()); in setUp() 130 doReturn(mContextSpy).when(mContextSpy).createDisplayContext(any()); in setUp() 132 mContextSpy, in setUp() 169 assertThat(windowParams.packageName).isEqualTo(mContextSpy.getPackageName()); in testShowToast_addsViewWithCorrectLayoutParamsToWindowManager() 238 when(mContextSpy.getUserId()).thenReturn(USER_ID); in testShowToast_accessibilityManagerClientIsRemoved() 449 ViewGroup parent = new FrameLayout(mContextSpy); in verifyWmAddViewAndAttachToParent()
|
/frameworks/base/services/tests/wmtests/src/com/android/server/wm/ |
D | TaskSnapshotPersisterTestBase.java | 68 private ContextWrapper mContextSpy; field in TaskSnapshotPersisterTestBase 103 mContextSpy = spy(new ContextWrapper(mWm.mContext)); in setUp() 104 mResourcesSpy = spy(mContextSpy.getResources()); in setUp() 105 when(mContextSpy.getResources()).thenReturn(mResourcesSpy); in setUp()
|
/frameworks/base/services/tests/displayservicetests/src/com/android/server/display/whitebalance/ |
D | AmbientSensorTest.java | 64 private ContextWrapper mContextSpy; field in AmbientSensorTest 74 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getContext())); in setUp() 75 mResourcesSpy = spy(mContextSpy.getResources()); in setUp() 76 when(mContextSpy.getResources()).thenReturn(mResourcesSpy); in setUp()
|
/frameworks/base/core/tests/vibrator/src/android/os/ |
D | VibratorTest.java | 62 private Context mContextSpy; field in VibratorTest 68 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getContext())); in setUp() 70 ContentResolver contentResolver = mSettingsProviderRule.mockContentResolver(mContextSpy); in setUp() 71 when(mContextSpy.getContentResolver()).thenReturn(contentResolver); in setUp() 72 mVibratorSpy = spy(new SystemVibrator(mContextSpy)); in setUp()
|