Home
last modified time | relevance | path

Searched refs:mContextSpy (Results 1 – 25 of 36) sorted by relevance

12

/frameworks/base/core/tests/coretests/src/com/android/internal/accessibility/util/
DShortcutUtilsTest.java87 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/
DWindowWakeUpPolicyTests.java92 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/
DInvisibleToggleAccessibilityServiceTargetTest.java84 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/
DSliceManagerServiceTest.java72 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/
DDreamManagerServiceMockingTest.java57 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/
DBiometricDisplayListenerTest.java66 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/
DLogcatManagerServiceTest.java70 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/
DLowPowerStandbyControllerTest.java122 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 …]
DNotifierTest.java88 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/
DActiveSourceActionTest.java52 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()
DArcInitiationActionFromAvrTest.java51 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()
DSetAudioVolumeLevelDiscoveryActionTest.java68 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()
DArcTerminationActionFromAvrTest.java54 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()
DHdmiCecAtomLoggingTvTest.java72 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()
DPowerStatusMonitorActionTest.java56 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()
DDevicePowerStatusActionTest.java60 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()
DHdmiCecAtomLoggingTest.java79 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/
DAmbientFilterTest.java39 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/
DVibrationSettingsTest.java136 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 …]
DInputDeviceDelegateTest.java71 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()
DVibrationScalerTest.java85 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/
DToastUITest.java103 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/
DTaskSnapshotPersisterTestBase.java68 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/
DAmbientSensorTest.java64 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/
DVibratorTest.java62 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()

12