/aosp14/frameworks/base/packages/Shell/tests/src/com/android/shell/ |
H A D | BugreportProgressServiceTest.java | 91 private final MyContext mTestContext = new MyContext(); field in BugreportProgressServiceTest 114 when(mTestContext.userManager.getUserProfiles()).thenReturn( in findSendToAccount_noWorkProfile() 121 assertNull(findSendToAccount(mTestContext, null)); in findSendToAccount_noWorkProfile() 122 assertNull(findSendToAccount(mTestContext, "")); in findSendToAccount_noWorkProfile() 123 assertNull(findSendToAccount(mTestContext, "android.com")); in findSendToAccount_noWorkProfile() 124 assertNull(findSendToAccount(mTestContext, "@android.com")); in findSendToAccount_noWorkProfile() 177 when(mTestContext.userManager.getUserProfiles()).thenReturn( in findSendToAccount_withWorkProfile_noAccounts() 188 assertNull(findSendToAccount(mTestContext, null)); in findSendToAccount_withWorkProfile_noAccounts() 189 assertNull(findSendToAccount(mTestContext, "")); in findSendToAccount_withWorkProfile_noAccounts() 190 assertNull(findSendToAccount(mTestContext, "android.com")); in findSendToAccount_withWorkProfile_noAccounts() [all …]
|
/aosp14/frameworks/base/services/tests/servicestests/src/com/android/server/appwidget/ |
H A D | AppWidgetServiceImplTest.java | 89 private TestContext mTestContext; field in AppWidgetServiceImplTest 108 mTestContext = new TestContext(); in setUp() 109 mPkgName = mTestContext.getOpPackageName(); in setUp() 110 mService = new AppWidgetServiceImpl(mTestContext); in setUp() 111 mManager = new AppWidgetManager(mTestContext, mService); in setUp() 129 assertEquals(info.loadDescription(mTestContext), "widget description string"); in testLoadDescription() 155 if (!provider.provider.getPackageName().equals(mTestContext.getPackageName())) { in testRequestPinAppWidget_otherProvider() 296 testAppWidgetProvider.onReceive(mTestContext, intent); in testReceiveBroadcastBehavior_enableAndUpdate() 408 new Handler(mTestContext.getMainLooper()).post(latch::countDown); in flushMainThread() 413 return mTestContext.getResources().getDimensionPixelSize(resId); in getDimensionResource() [all …]
|
/aosp14/frameworks/base/services/tests/mockingservicestests/src/com/android/server/appop/ |
H A D | AppOpsUpgradeTest.java | 102 private Context mTestContext; field in AppOpsUpgradeTest 159 mTestContext = spy(sContext); in setUp() 162 doNothing().when(mTestContext).enforcePermission(anyString(), anyInt(), anyInt(), in setUp() 165 doReturn(mPackageManager).when(mTestContext).getPackageManager(); in setUp() 199 mHandler, mTestContext, mSwitchedOps); in upgradeRunAnyInBackground() 262 mHandler, mTestContext, mSwitchedOps); in upgradeScheduleExactAlarm() 322 mHandler, mTestContext, mSwitchedOps); in resetUseFullScreenIntent() 346 mLock, mHandler, mTestContext, mSwitchedOps)); in upgradeFromNoFile() 377 mLock, mHandler, mTestContext, mSwitchedOps)); in upgradeFromNoVersion() 404 mLock, mHandler, mTestContext, mSwitchedOps)); in upgradeFromVersion1() [all …]
|
/aosp14/frameworks/base/test-base/src/android/test/ |
H A D | AndroidTestCase.java | 42 private Context mTestContext; field in AndroidTestCase 76 mTestContext = context; in setTestContext() 83 return mTestContext; in getTestContext()
|
/aosp14/frameworks/base/services/tests/servicestests/src/com/android/server/job/ |
H A D | JobStoreTest.java | 71 Context mTestContext; field in JobStoreTest 79 mTestContext = new RenamingDelegatingContext(getContext(), TEST_PREFIX); in setUp() 80 Log.d(TAG, "Saving tasks to '" + mTestContext.getFilesDir() + "'"); in setUp() 82 JobStore.initAndGetForTesting(mTestContext, mTestContext.getFilesDir()); in setUp() 242 File file = new File(mTestContext.getFilesDir(), "randomName"); in testExtractUidFromJobFileName() 245 file = new File(mTestContext.getFilesDir(), "jobs.xml"); in testExtractUidFromJobFileName() 248 file = new File(mTestContext.getFilesDir(), ".xml"); in testExtractUidFromJobFileName() 251 file = new File(mTestContext.getFilesDir(), "1000.xml"); in testExtractUidFromJobFileName() 254 file = new File(mTestContext.getFilesDir(), "10000"); in testExtractUidFromJobFileName() 257 file = new File(mTestContext.getFilesDir(), JobStore.JOB_FILE_SPLIT_PREFIX); in testExtractUidFromJobFileName() [all …]
|
/aosp14/frameworks/base/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/ |
H A D | StartingSurfaceDrawerTests.java | 105 private final TestableContext mTestContext = new TestContext( field in StartingSurfaceDrawerTests 130 final WindowManager realWindowManager = mTestContext.getSystemService(WindowManager.class); in setUp() 132 mTestContext.addMockSystemService(WindowManager.class, mMockWindowManager); in setUp() 137 mStartingSurfaceDrawer = new StartingSurfaceDrawer(mTestContext, mTestExecutor, in setUp() 140 new StartingSurfaceDrawer(mTestContext, mTestExecutor, mIconProvider, in setUp() 187 final String packageName = mTestContext.getPackageName(); in testColorCache() 208 colorCache.onReceive(mTestContext, packageRemoved); in testColorCache()
|
/aosp14/frameworks/base/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/onehanded/ |
H A D | OneHandedTestCase.java | 48 public TestableContext mTestContext = new TestableContext( field in OneHandedTestCase 70 return mTestContext; in getTestContext()
|
/aosp14/frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/ |
H A D | OverlayPackagesProviderTest.java | 85 private @Mock Context mTestContext; field in OverlayPackagesProviderTest 98 when(mTestContext.getResources()).thenReturn(mResources); in setUp() 99 when(mTestContext.getPackageManager()).thenReturn(mPackageManager); in setUp() 100 when(mTestContext.getFilesDir()).thenReturn( in setUp() 118 mHelper = new OverlayPackagesProvider(mTestContext, mInjector); in setUp()
|
/aosp14/frameworks/base/services/tests/servicestests/src/com/android/server/accounts/ |
H A D | AccountManagerServiceTest.java | 390 Context originalContext = ((MyMockContext)getContext()).mTestContext; in testRemovedAccountSync() 417 Context originalContext = ((MyMockContext) getContext()).mTestContext; in testPreNDatabaseMigration() 3475 private Context mTestContext; field in AccountManagerServiceTest.MyMockContext 3479 this.mTestContext = testContext; in MyMockContext() 3491 return mTestContext.bindServiceAsUser(service, conn, flags, user); in bindServiceAsUser() 3496 mTestContext.unbindService(conn); in unbindService() 3506 return mTestContext.getPackageName(); in getPackageName() 3540 return mTestContext.openOrCreateDatabase(file, mode, factory,errorHandler); in openOrCreateDatabase() 3545 return mTestContext.getDatabasePath(name); in getDatabasePath()
|