/packages/apps/ManagedProvisioning/tests/instrumentation/src/com/android/managedprovisioning/task/nonrequiredapps/ |
D | NonRequiredAppsLogicTest.java | 60 private static final int TEST_USER_ID = 123; field in NonRequiredAppsLogicTest 85 eq(mContext), eq(TEST_USER_ID))).thenReturn(TEST_MDM_COMPONENT_NAME); in setUp() 97 assertTrue(logic.getSystemAppsToRemove(TEST_USER_ID).isEmpty()); in testGetSystemAppsToRemove_NewLeave() 111 logic.getSystemAppsToRemove(TEST_USER_ID)); in testGetSystemAppsToRemove_NewDelete() 128 logic.getSystemAppsToRemove(TEST_USER_ID)); in testGetSystemAppsToRemove_deviceAdminComponentIsNotGiven() 140 when(mSnapshot.hasSnapshot(TEST_USER_ID)).thenReturn(false); in testGetSystemAppsToRemove_OtaLeave() 143 assertTrue(logic.getSystemAppsToRemove(TEST_USER_ID).isEmpty()); in testGetSystemAppsToRemove_OtaLeave() 158 assertEquals(Collections.singleton(APPS.get(4)), logic.getSystemAppsToRemove(TEST_USER_ID)); in testGetSystemAppsToRemove_OtaDelete() 168 logic.maybeTakeSystemAppsSnapshot(TEST_USER_ID); in testMaybeTakeSnapshot_NewLeave() 181 logic.maybeTakeSystemAppsSnapshot(TEST_USER_ID); in testMaybeTakeSnapshot_NewDelete() [all …]
|
D | SystemAppsSnapshotTest.java | 52 private static final int TEST_USER_ID = 123; field in SystemAppsSnapshotTest 69 when(mUserManager.getUserSerialNumber(TEST_USER_ID)).thenReturn(TEST_USER_SERIAL_NUMBER); in setUp() 86 assertFalse(mSystemAppsSnapshot.hasSnapshot(TEST_USER_ID)); in testHasSnapshot() 89 mSystemAppsSnapshot.takeNewSnapshot(TEST_USER_ID); in testHasSnapshot() 92 assertTrue(mSystemAppsSnapshot.hasSnapshot(TEST_USER_ID)); in testHasSnapshot() 101 assertTrue(mSystemAppsSnapshot.getSnapshot(TEST_USER_ID).isEmpty()); in testGetSnapshot() 104 mSystemAppsSnapshot.takeNewSnapshot(TEST_USER_ID); in testGetSnapshot() 107 assertSetEquals(mSystemAppsSnapshot.getSnapshot(TEST_USER_ID), in testGetSnapshot() 112 when(mUtils.getCurrentSystemApps(mockIPackageManager, TEST_USER_ID)) in setCurrentSystemApps()
|
/packages/apps/ManagedProvisioning/tests/instrumentation/src/com/android/managedprovisioning/task/ |
D | SetDevicePolicyTaskTest.java | 52 private static final int TEST_USER_ID = 123; field in SetDevicePolicyTaskTest 82 TEST_USER_ID)).thenReturn(true); in setUp() 83 when(mUtils.findDeviceAdmin(null, ADMIN_COMPONENT_NAME, mContext, TEST_USER_ID)) in setUp() 96 mTask.run(TEST_USER_ID); in testEnableDevicePolicyApp_DefaultToDefault() 114 mTask.run(TEST_USER_ID); in testEnableDevicePolicyApp_DisabledToDefault() 133 mTask.run(TEST_USER_ID); in testEnableDevicePolicyApp_EnabledToEnabled() 151 mTask.run(TEST_USER_ID); in testEnableDevicePolicyApp_PackageNotFound() 164 mTask.run(TEST_USER_ID); in testSetActiveAdmin() 167 verify(mDevicePolicyManager).setActiveAdmin(ADMIN_COMPONENT_NAME, true, TEST_USER_ID); in testSetActiveAdmin() 178 mTask.run(TEST_USER_ID); in testSetDeviceOwner() [all …]
|
D | DeleteNonRequiredAppsTaskTest.java | 56 private static final int TEST_USER_ID = 123; field in DeleteNonRequiredAppsTaskTest 89 when(mLogic.getSystemAppsToRemove(TEST_USER_ID)).thenReturn(Collections.emptySet()); in testNoAppsToDelete() 93 mTask.run(TEST_USER_ID); in testNoAppsToDelete() 96 verify(mLogic).maybeTakeSystemAppsSnapshot(TEST_USER_ID); in testNoAppsToDelete() 109 when(mLogic.getSystemAppsToRemove(TEST_USER_ID)) in testAppsToDelete() 115 mTask.run(TEST_USER_ID); in testAppsToDelete() 118 verify(mLogic).maybeTakeSystemAppsSnapshot(TEST_USER_ID); in testAppsToDelete() 131 when(mLogic.getSystemAppsToRemove(TEST_USER_ID)) in testAllAppsAlreadyDeleted() 135 mTask.run(TEST_USER_ID); in testAllAppsAlreadyDeleted() 138 verify(mLogic).maybeTakeSystemAppsSnapshot(TEST_USER_ID); in testAllAppsAlreadyDeleted() [all …]
|
D | ManagedProfileSettingsTaskTest.java | 55 private static final int TEST_USER_ID = 123; field in ManagedProfileSettingsTaskTest 95 mTask.run(TEST_USER_ID); in testNoMainColor() 103 .setOrganizationColorForUser(anyInt(), eq(TEST_USER_ID)); in testNoMainColor() 106 verify(mSettingsFacade).setUserSetupCompleted(mContext, TEST_USER_ID); in testNoMainColor() 108 DEFAULT_CONTACT_REMOTE_SEARCH, TEST_USER_ID); in testNoMainColor() 111 verify(mCrossProfileIntentFiltersSetter).setFilters(anyInt(), eq(TEST_USER_ID)); in testNoMainColor() 121 mTask.run(TEST_USER_ID); in testMainColor() 128 verify(mDevicePolicyManager).setOrganizationColorForUser(Color.GREEN, TEST_USER_ID); in testMainColor() 131 verify(mSettingsFacade).setUserSetupCompleted(mContext, TEST_USER_ID); in testMainColor() 133 DEFAULT_CONTACT_REMOTE_SEARCH, TEST_USER_ID); in testMainColor() [all …]
|
D | StartManagedProfileTaskTest.java | 54 private static final int TEST_USER_ID = 123; field in StartManagedProfileTaskTest 61 .putExtra(Intent.EXTRA_USER_HANDLE, TEST_USER_ID); 102 }).when(mIActivityManager).startUserInBackground(TEST_USER_ID); in testSuccess() 105 new Handler(mHandlerThread.getLooper()).post(() -> mTask.run(TEST_USER_ID)); in testSuccess() 113 eq(UserHandle.of(TEST_USER_ID)), in testSuccess() 134 when(mIActivityManager.startUserInBackground(TEST_USER_ID)).thenReturn(false); in testError() 137 mTask.run(TEST_USER_ID); in testError() 142 eq(UserHandle.of(TEST_USER_ID)), in testError() 156 when(mIActivityManager.startUserInBackground(TEST_USER_ID)) in testRemoteException() 160 mTask.run(TEST_USER_ID); in testRemoteException() [all …]
|
D | InstallExistingPackageTaskTest.java | 52 private static final int TEST_USER_ID = 123; field in InstallExistingPackageTaskTest 76 when(mPackageManager.installExistingPackageAsUser(INSTALL_PACKAGE_NAME, TEST_USER_ID)) in testSuccess() 80 mTask.run(TEST_USER_ID); in testSuccess() 83 verify(mPackageManager).installExistingPackageAsUser(INSTALL_PACKAGE_NAME, TEST_USER_ID); in testSuccess() 91 when(mPackageManager.installExistingPackageAsUser(INSTALL_PACKAGE_NAME, TEST_USER_ID)) in testPackageNotFound() 95 mTask.run(TEST_USER_ID); in testPackageNotFound() 105 when(mPackageManager.installExistingPackageAsUser(INSTALL_PACKAGE_NAME, TEST_USER_ID)) in testInstallFailed() 109 mTask.run(TEST_USER_ID); in testInstallFailed()
|
D | InstallPackageTaskTest.java | 72 private static final int TEST_USER_ID = 123; field in InstallPackageTaskTest 128 mTask.run(TEST_USER_ID); in testNoDownloadLocation() 141 mTask.run(TEST_USER_ID); in testSuccess() 165 mTask.run(TEST_USER_ID); in testSuccess_allowTestOnly() 189 mTask.run(TEST_USER_ID); in testInstallFailedVersionDowngrade() 213 mTask.run(TEST_USER_ID); in testInstallFailedOtherError() 237 mTask.run(TEST_USER_ID); in testDifferentPackageName()
|
D | CreateManagedProfileTaskTest.java | 53 private static final int TEST_USER_ID = 123; field in CreateManagedProfileTaskTest 84 .thenReturn(new UserInfo(TEST_USER_ID, null, 0)); in testSuccess() 93 verify(mLogic).maybeTakeSystemAppsSnapshot(TEST_USER_ID); in testSuccess() 95 assertEquals(TEST_USER_ID, mTask.getProfileUserId()); in testSuccess()
|
D | VerifyPackageTaskTest.java | 61 private static final int TEST_USER_ID = 123; field in VerifyPackageTaskTest 205 mTask.run(TEST_USER_ID); in runWithDownloadInfo()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/security/screenlock/ |
D | PowerButtonInstantLockPreferenceControllerTest.java | 45 private static final int TEST_USER_ID = 0; field in PowerButtonInstantLockPreferenceControllerTest 67 mContext, TEST_USER_ID, mLockPatternUtils); in setUp() 72 when(mLockPatternUtils.isSecure(TEST_USER_ID)).thenReturn(true); in isAvailable_lockSetToPattern_shouldReturnTrue() 73 when(mLockPatternUtils.getKeyguardStoredPasswordQuality(TEST_USER_ID)) in isAvailable_lockSetToPattern_shouldReturnTrue() 81 when(mLockPatternUtils.isSecure(TEST_USER_ID)).thenReturn(true); in isAvailable_lockSetToPin_shouldReturnTrue() 82 when(mLockPatternUtils.getKeyguardStoredPasswordQuality(TEST_USER_ID)) in isAvailable_lockSetToPin_shouldReturnTrue() 90 when(mLockPatternUtils.isSecure(TEST_USER_ID)).thenReturn(true); in isAvailable_lockSetToPassword_shouldReturnTrue() 91 when(mLockPatternUtils.getKeyguardStoredPasswordQuality(TEST_USER_ID)) in isAvailable_lockSetToPassword_shouldReturnTrue() 99 when(mLockPatternUtils.isSecure(TEST_USER_ID)).thenReturn(false); in isAvailable_lockSetToNone_shouldReturnFalse() 109 when(mLockPatternUtils.getPowerButtonInstantlyLocks(TEST_USER_ID)).thenReturn(true); in updateState_shouldSetPref() [all …]
|
D | PatternVisiblePreferenceControllerTest.java | 42 private static final int TEST_USER_ID = 0; field in PatternVisiblePreferenceControllerTest 55 new PatternVisiblePreferenceController(mContext, TEST_USER_ID, mLockPatternUtils); in setUp() 61 when(mLockPatternUtils.isSecure(TEST_USER_ID)).thenReturn(true); in isAvailable_lockSetToPattern_shouldReturnTrue() 62 when(mLockPatternUtils.getKeyguardStoredPasswordQuality(TEST_USER_ID)) in isAvailable_lockSetToPattern_shouldReturnTrue() 70 when(mLockPatternUtils.isSecure(TEST_USER_ID)).thenReturn(true); in isAvailable_lockSetToPin_shouldReturnFalse() 71 when(mLockPatternUtils.getKeyguardStoredPasswordQuality(TEST_USER_ID)) in isAvailable_lockSetToPin_shouldReturnFalse() 79 when(mLockPatternUtils.isSecure(TEST_USER_ID)).thenReturn(false); in isAvailable_lockSetToNone_shouldReturnFalse() 86 when(mLockPatternUtils.isVisiblePatternEnabled(TEST_USER_ID)).thenReturn(true); in updateState_shouldSetPref() 90 when(mLockPatternUtils.isVisiblePatternEnabled(TEST_USER_ID)).thenReturn(false); in updateState_shouldSetPref() 99 verify(mLockPatternUtils).setVisiblePatternEnabled(true, TEST_USER_ID); in onPreferenceChange_shouldUpdateLockPatternUtils()
|
D | LockAfterTimeoutPreferenceControllerTest.java | 55 private static final int TEST_USER_ID = 0; field in LockAfterTimeoutPreferenceControllerTest 77 mContext, TEST_USER_ID, mLockPatternUtils); in setUp() 82 when(mLockPatternUtils.isSecure(TEST_USER_ID)).thenReturn(true); in isAvailable_lockSetToPattern_shouldReturnTrue() 83 when(mLockPatternUtils.getKeyguardStoredPasswordQuality(TEST_USER_ID)) in isAvailable_lockSetToPattern_shouldReturnTrue() 91 when(mLockPatternUtils.isSecure(TEST_USER_ID)).thenReturn(true); in isAvailable_lockSetToPin_shouldReturnTrue() 92 when(mLockPatternUtils.getKeyguardStoredPasswordQuality(TEST_USER_ID)) in isAvailable_lockSetToPin_shouldReturnTrue() 100 when(mLockPatternUtils.isSecure(TEST_USER_ID)).thenReturn(true); in isAvailable_lockSetToPassword_shouldReturnTrue() 101 when(mLockPatternUtils.getKeyguardStoredPasswordQuality(TEST_USER_ID)) in isAvailable_lockSetToPassword_shouldReturnTrue() 109 when(mLockPatternUtils.isSecure(TEST_USER_ID)).thenReturn(false); in isAvailable_lockSetToNone_shouldReturnFalse()
|
/packages/apps/ManagedProvisioning/tests/instrumentation/src/com/android/managedprovisioning/common/ |
D | UtilsTest.java | 67 private static final int TEST_USER_ID = 10; field in UtilsTest 104 PackageManager.MATCH_UNINSTALLED_PACKAGES, TEST_USER_ID)) in testGetCurrentSystemApps() 107 Set<String> res = mUtils.getCurrentSystemApps(mockIPackageManager, TEST_USER_ID); in testGetCurrentSystemApps() 117 PackageManager.COMPONENT_ENABLED_STATE_DISABLED, TEST_USER_ID); in testSetComponentEnabledSetting() 122 eq(TEST_USER_ID)); in testSetComponentEnabledSetting() 227 mUtils.findDeviceAdmin(null, TEST_COMPONENT_NAME_2, mockContext, TEST_USER_ID)); in testFindDeviceAdmin_ComponentName() 237 TEST_PACKAGE_NAME_1, null, mockContext, TEST_USER_ID)); in testFindDeviceAdmin_PackageName() 244 TEST_USER_ID)) in testFindDeviceAdmin_NoPackageName() 250 TEST_PACKAGE_NAME_1, null, mockContext, TEST_USER_ID); in testFindDeviceAdmin_NoPackageName() 264 null, TEST_COMPONENT_NAME_2, mockContext, TEST_USER_ID); in testFindDeviceAdmin_AnotherComponentName() [all …]
|
/packages/apps/ManagedProvisioning/tests/instrumentation/src/com/android/managedprovisioning/ota/ |
D | TaskExecutorTest.java | 37 private final int TEST_USER_ID = 123; field in TaskExecutorTest 55 mExecutor.execute(TEST_USER_ID, mTask1); in testExecute_firstTask() 58 verify(mTask1).run(TEST_USER_ID); in testExecute_firstTask() 64 mExecutor.execute(TEST_USER_ID, mTask1); in testExecute_twoTask() 67 verify(mTask1).run(TEST_USER_ID); in testExecute_twoTask() 70 mExecutor.execute(TEST_USER_ID, mTask2); in testExecute_twoTask() 73 verify(mTask2).run(TEST_USER_ID); in testExecute_twoTask()
|
/packages/apps/Car/Settings/tests/robotests/src/com/android/car/settings/users/ |
D | UserDetailsFragmentTest.java | 53 private static final int TEST_USER_ID = 10; field in UserDetailsFragmentTest 83 UserInfo testUser = new UserInfo(TEST_USER_ID, TEST_NAME, /* flags= */ 0); in testCarUserManagerHelperUpdateListener_showsCorrectText() 84 when(mUserManager.getUserInfo(TEST_USER_ID)).thenReturn(testUser); in testCarUserManagerHelperUpdateListener_showsCorrectText() 93 UserInfo testUser = new UserInfo(TEST_USER_ID, TEST_NAME, /* flags= */ 0); in testCarUserManagerHelperUpdateListener_textChangesWithUserUpdate() 94 when(mUserManager.getUserInfo(TEST_USER_ID)).thenReturn(testUser); in testCarUserManagerHelperUpdateListener_textChangesWithUserUpdate() 101 UserInfo testUserUpdated = new UserInfo(TEST_USER_ID, TEST_UPDATED_NAME, /* flags= */ 0); in testCarUserManagerHelperUpdateListener_textChangesWithUserUpdate() 102 when(mUserManager.getUserInfo(TEST_USER_ID)).thenReturn(testUserUpdated); in testCarUserManagerHelperUpdateListener_textChangesWithUserUpdate() 110 mUserDetailsFragment = UserDetailsFragment.newInstance(TEST_USER_ID); in createUserDetailsFragment()
|
/packages/apps/Car/Settings/tests/robotests/src/com/android/car/settings/applications/defaultapps/ |
D | DefaultAssistantPickerEntryPreferenceControllerTest.java | 62 private static final int TEST_USER_ID = 10; field in DefaultAssistantPickerEntryPreferenceControllerTest 84 when(mCarUserManagerHelper.getCurrentProcessUserId()).thenReturn(TEST_USER_ID); in setUp() 101 Settings.Secure.ASSISTANT, TEST_COMPONENT, TEST_USER_ID); in getCurrentDefaultAppInfo_hasService_returnsDefaultAppInfo() local 110 TEST_USER_ID, ComponentName.unflattenFromString(TEST_COMPONENT)); in getSettingIntent_noAssistant_returnsNull() 117 Settings.Secure.ASSISTANT, TEST_COMPONENT, TEST_USER_ID); in getSettingIntent_hasAssistant_noAssistSupport_returnsNull() local 134 TEST_USER_ID, ComponentName.unflattenFromString(TEST_COMPONENT)); in getSettingIntent_hasAssistant_noAssistSupport_returnsNull() 142 Settings.Secure.ASSISTANT, TEST_COMPONENT, TEST_USER_ID); in getSettingIntent_hasAssistant_supportsAssist_noSettingsActivity_returnsNull() local 158 TEST_USER_ID, ComponentName.unflattenFromString(TEST_COMPONENT)); in getSettingIntent_hasAssistant_supportsAssist_noSettingsActivity_returnsNull() 166 Settings.Secure.ASSISTANT, TEST_COMPONENT, TEST_USER_ID); in getSettingIntent_hasAssistant_supportsAssist_hasSettingsActivity_returnsIntent() local 183 TEST_USER_ID, ComponentName.unflattenFromString(TEST_COMPONENT)); in getSettingIntent_hasAssistant_supportsAssist_hasSettingsActivity_returnsIntent()
|
D | DefaultAutofillPickerEntryPreferenceControllerTest.java | 66 private static final int TEST_USER_ID = 10; field in DefaultAutofillPickerEntryPreferenceControllerTest 155 TEST_USER_ID, ComponentName.unflattenFromString(TEST_COMPONENT)); in getSettingIntent_noServiceInterface_returnsNull() 174 TEST_USER_ID, ComponentName.unflattenFromString(TEST_COMPONENT)); in getSettingIntent_hasServiceInterface_returnsIntent()
|
/packages/apps/ManagedProvisioning/tests/instrumentation/src/com/android/managedprovisioning/preprovisioning/ |
D | EncryptionControllerTest.java | 49 private static final int TEST_USER_ID = 10; field in EncryptionControllerTest 86 verify(mUtils).enableComponent(TEST_HOME_RECEIVER, TEST_USER_ID); in testDeviceOwner() 87 verify(mPackageManager).flushPackageRestrictionsAsUser(TEST_USER_ID); in testDeviceOwner() 110 verify(mUtils).enableComponent(TEST_HOME_RECEIVER, TEST_USER_ID); in testProfileOwnerDuringSuw() 111 verify(mPackageManager).flushPackageRestrictionsAsUser(TEST_USER_ID); in testProfileOwnerDuringSuw() 145 verify(mUtils).disableComponent(TEST_HOME_RECEIVER, TEST_USER_ID); in testCancelProvisioningReminder() 176 mNotificationHelper, TEST_USER_ID); in createEncryptionController()
|
/packages/apps/Car/Settings/tests/robotests/src/com/android/car/settings/applications/assist/ |
D | AssistConfigBasePreferenceControllerTest.java | 91 private static final int TEST_USER_ID = 10; field in AssistConfigBasePreferenceControllerTest 107 when(mCarUserManagerHelper.getCurrentProcessUserId()).thenReturn(TEST_USER_ID); in setUp() 126 key, TEST_USER_ID); in getAvailabilityStatus_hasAssistComponent_isAvailable() local 140 key, TEST_USER_ID); in onStart_registersObserver() local 154 key, TEST_USER_ID); in onStop_unregistersObserver() local 169 key, TEST_USER_ID); in onChange_changeRegisteredSetting_callsRefreshUi() local
|
D | DefaultVoiceInputPickerEntryPreferenceControllerTest.java | 70 private static final int TEST_USER_ID = 10; field in DefaultVoiceInputPickerEntryPreferenceControllerTest 90 when(carUserManagerHelper.getCurrentProcessUserId()).thenReturn(TEST_USER_ID); in setUp() 225 mContext.getPackageManager(), TEST_USER_ID, info, true); in getSettingIntent_validInput_returnsIntent() 240 assist.flattenToString(), TEST_USER_ID); in setCurrentAssistant() local
|
D | TextContextPreferenceControllerTest.java | 46 private static final int TEST_USER_ID = 10; field in TextContextPreferenceControllerTest 62 when(mCarUserManagerHelper.getCurrentProcessUserId()).thenReturn(TEST_USER_ID); in setUp() 72 key, TEST_USER_ID); in setUp() local
|
D | ScreenshotContextPreferenceControllerTest.java | 46 private static final int TEST_USER_ID = 10; field in ScreenshotContextPreferenceControllerTest 62 when(mCarUserManagerHelper.getCurrentProcessUserId()).thenReturn(TEST_USER_ID); in setUp() 72 key, TEST_USER_ID); in setUp() local
|
D | DefaultVoiceInputPickerPreferenceControllerTest.java | 59 private static final int TEST_USER_ID = 10; field in DefaultVoiceInputPickerPreferenceControllerTest 76 when(mCarUserManagerHelper.getCurrentProcessUserId()).thenReturn(TEST_USER_ID); in setUp() 286 assist.flattenToString(), TEST_USER_ID); in setCurrentAssistant() local
|
/packages/apps/ManagedProvisioning/tests/instrumentation/src/com/android/managedprovisioning/provisioning/ |
D | DeviceOwnerProvisioningControllerTest.java | 52 private static final int TEST_USER_ID = 123; field in DeviceOwnerProvisioningControllerTest 240 TEST_USER_ID, in createController()
|