/frameworks/base/tests/vcn/java/com/android/server/vcn/ |
D | VcnTestUtils.java | 29 Context mockContext, Object service, String name, Class<?> serviceClass) { in setupSystemService() argument 30 doReturn(name).when(mockContext).getSystemServiceName(serviceClass); in setupSystemService() 31 doReturn(service).when(mockContext).getSystemService(name); in setupSystemService() 35 public static IpSecManager setupIpSecManager(Context mockContext, IpSecService service) { in setupIpSecManager() argument 36 doReturn(Context.IPSEC_SERVICE).when(mockContext).getSystemServiceName(IpSecManager.class); in setupIpSecManager() 38 final IpSecManager ipSecMgr = new IpSecManager(mockContext, service); in setupIpSecManager() 39 doReturn(ipSecMgr).when(mockContext).getSystemService(Context.IPSEC_SERVICE); in setupIpSecManager()
|
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/globalactions/ |
D | GlobalActionsInfoProviderTest.kt | 62 @Mock private lateinit var mockContext: Context in eq() variable in com.google.android.systemui.globalactions.GlobalActionsInfoProviderTest 72 mockContext = spy(context) in eq() 74 whenever(mockContext.resources).thenReturn(mockResources) in eq() 77 whenever(mockContext.getSharedPreferences(eq(PREFERENCE), anyInt())) in eq() 85 mockContext, in eq() 123 infoProvider.addPanel(mockContext, parent, 5, { }) in eq()
|
/frameworks/base/services/tests/uiservicestests/src/com/android/server/notification/ |
D | ValidateNotificationPeopleTest.java | 191 final Context mockContext = mock(Context.class); in testSearchContacts_workContact_queriesWorkContactProvider() local 192 when(mockContext.getUserId()).thenReturn(personalUserId); in testSearchContacts_workContact_queriesWorkContactProvider() 194 when(mockContext.getSystemService(UserManager.class)).thenReturn(mockUserManager); in testSearchContacts_workContact_queriesWorkContactProvider() 199 when(mockContext.getContentResolver()).thenReturn(mockContentResolver); in testSearchContacts_workContact_queriesWorkContactProvider() 204 new ValidateNotificationPeople().searchContacts(mockContext, lookupUri); in testSearchContacts_workContact_queriesWorkContactProvider() 222 final Context mockContext = mock(Context.class); in testSearchContacts_personalContact_queriesPersonalContactProvider() local 223 when(mockContext.getUserId()).thenReturn(personalUserId); in testSearchContacts_personalContact_queriesPersonalContactProvider() 225 when(mockContext.getSystemService(UserManager.class)).thenReturn(mockUserManager); in testSearchContacts_personalContact_queriesPersonalContactProvider() 227 when(mockContext.getContentResolver()).thenReturn(mockContentResolver); in testSearchContacts_personalContact_queriesPersonalContactProvider() 231 new ValidateNotificationPeople().searchContacts(mockContext, lookupUri); in testSearchContacts_personalContact_queriesPersonalContactProvider()
|
/frameworks/base/core/tests/coretests/src/android/app/timezone/ |
D | RulesUpdaterContractTest.java | 60 Context mockContext = mock(Context.class); in sendBroadcast() local 62 RulesUpdaterContract.sendBroadcast(mockContext, packageName, tokenBytes); in sendBroadcast() 64 verify(mockContext).sendBroadcastAsUser( in sendBroadcast()
|
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/media/ |
D | MediaResumeListenerTest.kt | 88 @Mock private lateinit var mockContext: Context in capture() variable in com.android.systemui.media.MediaResumeListenerTest 117 whenever(mockContext.getSharedPreferences(eq(MEDIA_PREFERENCES), anyInt())) in capture() 122 whenever(mockContext.packageManager).thenReturn(context.packageManager) in capture() 123 whenever(mockContext.contentResolver).thenReturn(context.contentResolver) in capture() 126 resumeListener = MediaResumeListener(mockContext, broadcastDispatcher, executor, in capture() 190 whenever(mockContext.packageManager).thenReturn(pm) in capture() 225 whenever(mockContext.packageManager).thenReturn(pm) in capture() 300 whenever(mockContext.packageManager).thenReturn(pm) in capture()
|
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/broadcast/ |
D | BroadcastDispatcherTest.kt | 66 private lateinit var mockContext: Context in capture() variable in com.android.systemui.broadcast.BroadcastDispatcherTest 101 mockContext, in capture() 112 setUserMock(mockContext, user0) in capture() 241 private fun setUserMock(mockContext: Context, user: UserHandle) { in setUserMock() 242 `when`(mockContext.user).thenReturn(user) in setUserMock() 243 `when`(mockContext.userId).thenReturn(user.identifier) in setUserMock()
|
D | UserBroadcastDispatcherTest.kt | 65 private lateinit var mockContext: Context in capture() variable in com.android.systemui.broadcast.UserBroadcastDispatcherTest 84 mockContext, USER_ID, testableLooper.looper, mock(Executor::class.java), logger) { in capture()
|
/frameworks/base/wifi/tests/src/android/net/wifi/ |
D | WifiNetworkScoreCacheTest.java | 66 @Mock private Context mockContext; // isn't used, can be null field in WifiNetworkScoreCacheTest 102 when(mockContext.getApplicationContext()).thenReturn(mockApplicationContext); in setUp() 105 mScoreCache = new WifiNetworkScoreCache(mockContext); in setUp() 193 mScoreCache = new WifiNetworkScoreCache(mockContext, mCacheListener); in updateScoresShouldInvokeCacheListener_networkCacheUpdated() 208 mScoreCache = new WifiNetworkScoreCache(mockContext, mCacheListener, 2 /* maxCacheSize */); in leastRecentlyUsedScore_shouldBeEvictedFromCache()
|
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/qs/external/ |
D | CustomTileStatePersisterTest.kt | 68 private lateinit var mockContext: Context variable in com.android.systemui.qs.external.CustomTileStatePersisterTest 82 `when`(mockContext.getSharedPreferences(anyString(), anyInt())) in setUp() 87 customTileStatePersister = CustomTileStatePersister(mockContext) in setUp()
|
/frameworks/base/services/tests/servicestests/src/com/android/server/search/ |
D | SearchablesTest.java | 102 MyMockContext mockContext = new MyMockContext(mContext, mockPM); in testSearchablesListReal() local 106 Searchables searchables = new Searchables(mockContext, 0); in testSearchablesListReal() 122 MyMockContext mockContext = new MyMockContext(mContext, mockPM); in testSearchablesListEmpty() local 125 Searchables searchables = new Searchables(mockContext, 0); in testSearchablesListEmpty()
|
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/ |
D | BluetoothEventManagerTest.java | 106 Context mockContext = mock(Context.class); in ifUserHandleIsNull_registerReceiverIsCalled() local 108 new BluetoothEventManager(mLocalAdapter, mCachedDeviceManager, mockContext, in ifUserHandleIsNull_registerReceiverIsCalled() 111 verify(mockContext).registerReceiver(any(BroadcastReceiver.class), any(IntentFilter.class), in ifUserHandleIsNull_registerReceiverIsCalled() 117 Context mockContext = mock(Context.class); in ifUserHandleSpecified_registerReceiverAsUserIsCalled() local 119 new BluetoothEventManager(mLocalAdapter, mCachedDeviceManager, mockContext, in ifUserHandleSpecified_registerReceiverAsUserIsCalled() 122 verify(mockContext).registerReceiverAsUser(any(BroadcastReceiver.class), eq(UserHandle.ALL), in ifUserHandleSpecified_registerReceiverAsUserIsCalled()
|
/frameworks/base/core/tests/coretests/src/android/os/ |
D | VibrationEffectTest.java | 70 Context context = mockContext(r); in getRingtones_noPrebakedRingtones() 78 Context context = mockContext(r); in getRingtones_noPrebakedRingtoneForUri() 86 Context context = mockContext(r); in getRingtones_getPrebakedRingtone() 330 private Context mockContext(Resources resources) { in mockContext() method in VibrationEffectTest
|
/frameworks/base/services/tests/servicestests/src/com/android/server/people/prediction/ |
D | ShareTargetPredictorTest.java | 423 Context mockContext = mock(Context.class); in buildShortcut() local 424 when(mockContext.getPackageName()).thenReturn(packageName); in buildShortcut() 425 when(mockContext.getUserId()).thenReturn(USER_ID); in buildShortcut() 426 when(mockContext.getUser()).thenReturn(UserHandle.of(USER_ID)); in buildShortcut() 427 ShortcutInfo.Builder builder = new ShortcutInfo.Builder(mockContext, shortcutId) in buildShortcut()
|
/frameworks/base/core/tests/coretests/src/android/content/pm/ |
D | CrossProfileAppsTest.java | 74 public void mockContext() { in mockContext() method in CrossProfileAppsTest
|
/frameworks/base/services/tests/mockingservicestests/src/com/android/server/pm/dex/ |
D | DexManagerTests.java | 151 Context mockContext = ExtendedMockito.mock(Context.class); in setup() local 153 .when(mockContext) in setup() 156 .when(mockContext) in setup() 159 .when(mockContext) in setup() 162 mDexManager = new DexManager(mockContext, mPM, /*PackageDexOptimizer*/ null, in setup()
|
/frameworks/base/services/tests/PackageManagerComponentOverrideTests/src/com/android/server/pm/test/override/ |
D | PackageManagerComponentLabelIconOverrideTest.kt | 356 val mockContext: Context = mockThrowOnUnmocked { in <lambda>() constant 374 whenever(this.context) { mockContext } in <lambda>()
|
/frameworks/base/services/tests/servicestests/src/com/android/server/people/data/ |
D | DataManagerTest.java | 1557 Context mockContext = mock(Context.class); in buildShortcutInfo() local 1558 when(mockContext.getPackageName()).thenReturn(packageName); in buildShortcutInfo() 1559 when(mockContext.getUserId()).thenReturn(userId); in buildShortcutInfo() 1560 when(mockContext.getUser()).thenReturn(UserHandle.of(userId)); in buildShortcutInfo() 1561 ShortcutInfo.Builder builder = new ShortcutInfo.Builder(mockContext, id) in buildShortcutInfo()
|
/frameworks/base/services/tests/servicestests/src/com/android/server/accounts/ |
D | AccountManagerServiceTest.java | 165 MyMockContext mockContext = new MyMockContext(realTestContext, mMockContext); in setUp() local 166 setContext(mockContext); in setUp() 167 mTestInjector = new TestInjector(realTestContext, mockContext, mMockNotificationManager); in setUp() 3342 MyMockContext(Context testContext, Context mockContext) { in MyMockContext() argument 3344 this.mMockContext = mockContext; in MyMockContext() 3443 Context mockContext, in TestInjector() argument 3445 super(mockContext); in TestInjector()
|