/packages/modules/DeviceLock/DeviceLockController/tests/robolectric/src/com/android/devicelockcontroller/ |
D | WorkManagerExceptionHandlerTest.java | 51 private TestDeviceLockControllerApplication mTestApp; field in WorkManagerExceptionHandlerTest 61 mTestApp = ApplicationProvider.getApplicationContext(); in setUp() 68 new WorkManagerExceptionHandler(mTestApp, mTerminationRunnableMock); in handleException_whenUnprovisioned_shouldTerminateNoWipe() 69 ProvisionStateController provisionStateController = mTestApp.getProvisionStateController(); in handleException_whenUnprovisioned_shouldTerminateNoWipe() 70 DeviceStateController deviceStateController = mTestApp.getDeviceStateController(); in handleException_whenUnprovisioned_shouldTerminateNoWipe() 71 DevicePolicyController devicePolicyController = mTestApp.getPolicyController(); in handleException_whenUnprovisioned_shouldTerminateNoWipe() 77 workManagerExceptionHandler.handleException(mTestApp, new RuntimeException()).get(); in handleException_whenUnprovisioned_shouldTerminateNoWipe() 87 new WorkManagerExceptionHandler(mTestApp, mTerminationRunnableMock); in handleException_whenProvisionInProgress_shouldWipeNoTerminate() 88 ProvisionStateController provisionStateController = mTestApp.getProvisionStateController(); in handleException_whenProvisionInProgress_shouldWipeNoTerminate() 89 DeviceStateController deviceStateController = mTestApp.getDeviceStateController(); in handleException_whenProvisionInProgress_shouldWipeNoTerminate() [all …]
|
D | DeviceLockControllerServiceTest.java | 71 private TestDeviceLockControllerApplication mTestApp; field in DeviceLockControllerServiceTest 75 mTestApp = ApplicationProvider.getApplicationContext(); in setUp() 77 (StatsLoggerProvider) mTestApp.getApplicationContext(); in setUp() 82 ShadowPackageManager packageManager = Shadows.shadowOf(mTestApp.getPackageManager()); in setUp() 84 final ShadowApplication shadowApplication = Shadows.shadowOf(mTestApp); in setUp() 90 new ComponentName(mTestApp, DeviceLockControllerService.class), in setUp() 98 Intent serviceIntent = new Intent(mTestApp, DeviceLockControllerService.class); in lockDevice_shouldLogKioskRequest_andLogLockSuccess() 100 when(mTestApp.getDeviceStateController().lockDevice()).thenReturn( in lockDevice_shouldLogKioskRequest_andLogLockSuccess() 115 DeviceStateController deviceStateController = mTestApp.getDeviceStateController(); in lockDevice_failure_shouldLogToStatsLogger() 116 Intent serviceIntent = new Intent(mTestApp, DeviceLockControllerService.class); in lockDevice_failure_shouldLogToStatsLogger() [all …]
|
D | DeviceLockControllerPermissionsTest.java | 47 private TestDeviceLockControllerApplication mTestApp; field in DeviceLockControllerPermissionsTest 53 mTestApp = ApplicationProvider.getApplicationContext(); in setUp() 54 String packageName = mTestApp.getPackageName(); in setUp() 55 PackageManager packageManager = mTestApp.getPackageManager(); in setUp()
|
/packages/modules/DeviceLock/DeviceLockController/tests/robolectric/src/com/android/devicelockcontroller/schedule/ |
D | DeviceLockControllerSchedulerImplTest.java | 89 TestDeviceLockControllerApplication mTestApp; field in DeviceLockControllerSchedulerImplTest 93 mTestApp = ApplicationProvider.getApplicationContext(); in setUp() 94 mScheduler = new DeviceLockControllerSchedulerImpl(mTestApp, TEST_CLOCK, in setUp() 95 mTestApp.getProvisionStateController()); in setUp() 100 WorkManagerTestInitHelper.initializeTestWorkManager(mTestApp, config); in setUp() 106 UserParameters.setNextCheckInTimeMillis(mTestApp, TEST_NEXT_CHECK_IN_TIME_MILLIS); in correctExpectedToRunTime_retryCheckInExpected_positiveDelta_shouldUpdate() 109 UserParameters.setBootTimeMillis(mTestApp, in correctExpectedToRunTime_retryCheckInExpected_positiveDelta_shouldUpdate() 121 assertThat(UserParameters.getNextCheckInTimeMillis(mTestApp)).isEqualTo( in correctExpectedToRunTime_retryCheckInExpected_positiveDelta_shouldUpdate() 130 UserParameters.setNextCheckInTimeMillis(mTestApp, TEST_NEXT_CHECK_IN_TIME_MILLIS); in correctExpectedToRunTime_retryCheckInExpected_negativeDelta_shouldUpdate() 133 UserParameters.setBootTimeMillis(mTestApp, in correctExpectedToRunTime_retryCheckInExpected_negativeDelta_shouldUpdate() [all …]
|
/packages/modules/DeviceLock/DeviceLockController/tests/robolectric/src/com/android/devicelockcontroller/receivers/ |
D | NextProvisionFailedStepReceiverTest.java | 69 private TestDeviceLockControllerApplication mTestApp; field in NextProvisionFailedStepReceiverTest 75 mTestApp = ApplicationProvider.getApplicationContext(); in setUp() 83 mIntent = new Intent(mTestApp, NextProvisionFailedStepReceiver.class); in setUp() 89 WorkManagerTestInitHelper.initializeTestWorkManager(mTestApp, config); in setUp() 98 mReceiver.onReceive(mTestApp, mIntent); in onReceive_nextProvisionStateDismissibleUI_shouldReportState() 101 verifyReportProvisionStateWorkScheduled(WorkManager.getInstance(mTestApp)); in onReceive_nextProvisionStateDismissibleUI_shouldReportState() 109 mReceiver.onReceive(mTestApp, mIntent); in onReceive_nextProvisionStatePersistentUI_shouldReportState() 112 verifyReportProvisionStateWorkScheduled(WorkManager.getInstance(mTestApp)); in onReceive_nextProvisionStatePersistentUI_shouldReportState() 125 mReceiver.onReceive(mTestApp, mIntent); in onReceive_nextProvisionStateUnspecified_shouldNotReportState() 128 verifyReportProvisionStateWorkNotScheduled(WorkManager.getInstance(mTestApp)); in onReceive_nextProvisionStateUnspecified_shouldNotReportState() [all …]
|
D | ResetDeviceReceiverTest.java | 46 private TestDeviceLockControllerApplication mTestApp; field in ResetDeviceReceiverTest 52 mTestApp = ApplicationProvider.getApplicationContext(); in setUp() 54 mIntent = new Intent(mTestApp, ResetDeviceReceiver.class); in setUp() 57 (StatsLoggerProvider) mTestApp.getApplicationContext(); in setUp() 68 mReceiver.onReceive(mTestApp, mIntent); in onReceive_shouldLogToStatsLoggerWhenCalled_whenProvisionIsMandatory() 80 mReceiver.onReceive(mTestApp, mIntent); in onReceive_shouldLogToStatsLoggerWhenCalled_whenProvisionIsNotMandatory()
|
D | TimeChangedBroadcastReceiverTest.java | 34 private TestDeviceLockControllerApplication mTestApp; field in TimeChangedBroadcastReceiverTest 39 mTestApp = ApplicationProvider.getApplicationContext(); in setUp() 46 mReceiver.onReceive(mTestApp, new Intent(Intent.ACTION_TIME_CHANGED)); in onReceive_shouldNotifySchedulerTimeChanged() 49 verify(mTestApp.getDeviceLockControllerScheduler()).notifyTimeChanged(); in onReceive_shouldNotifySchedulerTimeChanged()
|
D | CheckInBootCompletedReceiverTest.java | 54 private TestDeviceLockControllerApplication mTestApp; field in CheckInBootCompletedReceiverTest 63 mTestApp = ApplicationProvider.getApplicationContext(); in setUp() 64 mScheduler = mTestApp.getDeviceLockControllerScheduler(); in setUp() 83 mReceiver.onReceive(mTestApp, INTENT); in onReceive_shouldCallMaybeScheduleInitialCheckIn() 90 Context secondaryUserContext = mTestApp.createContextAsUser( in onReceive_notSystemUser_disablesReceiver()
|
D | WorkFailureAlarmReceiverTest.java | 62 private TestDeviceLockControllerApplication mTestApp; field in WorkFailureAlarmReceiverTest 71 mTestApp = ApplicationProvider.getApplicationContext(); in setUp() 72 mScheduler = mTestApp.getDeviceLockControllerScheduler(); in setUp() 164 final Intent intent = new Intent(mTestApp, in getIntentForAlarmReason() 176 mTestApp.sendOrderedBroadcast( in sendBroadcastToWorkFailureAlarmReceiver()
|
/packages/modules/DeviceLock/DeviceLockController/tests/robolectric/src/com/android/devicelockcontroller/provision/worker/ |
D | ReportDeviceProvisionStateWorkerTest.java | 92 private TestDeviceLockControllerApplication mTestApp; field in ReportDeviceProvisionStateWorkerTest 98 mTestApp = ApplicationProvider.getApplicationContext(); in setUp() 99 WorkManagerTestInitHelper.initializeTestWorkManager(mTestApp, in setUp() 108 mTestApp, ReportDeviceProvisionStateWorker.class) in setUp() 125 (StatsLoggerProvider) mTestApp.getApplicationContext(); in setUp() 127 mSetupParametersClient = SetupParametersClient.getInstance(mTestApp, mExecutorService); in setUp() 148 verify(mTestApp.getDeviceLockControllerScheduler()).scheduleNextProvisionFailedStepAlarm(); in doWork_responseHasFatalError_returnFailureAndNotLogged() 166 () -> assertThat(UserParameters.getDaysLeftUntilReset(mTestApp)).isEqualTo( in doWork_responseIsSuccessful_globalParametersSetAndEventLogged() 181 mTestApp.getSystemService(NotificationManager.class)); in doWork_mandatory_doesNotSendNotificationOrScheduleAlarm() 184 verify(mTestApp.getDeviceLockControllerScheduler(), never()) in doWork_mandatory_doesNotSendNotificationOrScheduleAlarm() [all …]
|
D | SetupWizardCompletionTimeoutWorkerTest.java | 60 private TestDeviceLockControllerApplication mTestApp; field in SetupWizardCompletionTimeoutWorkerTest 66 mTestApp = ApplicationProvider.getApplicationContext(); in setUp() 67 mMockProvisionStateController = mTestApp.getProvisionStateController(); in setUp() 69 mTestApp, SetupWizardCompletionTimeoutWorker.class) in setUp() 89 ContentResolver contentResolver = mTestApp.getContentResolver(); in doWork_suwComplete_doesNotStartFlow() 101 ContentResolver contentResolver = mTestApp.getContentResolver(); in doWork_suwNotComplete_notUnprovisioned_doesNotStartFlow() 117 ContentResolver contentResolver = mTestApp.getContentResolver(); in doWork_suwNotComplete_unprovisioned_provisionNotReady_doesNotStartFlow() 135 ContentResolver contentResolver = mTestApp.getContentResolver(); in doWork_suwNotComplete_unprovisioned_provisionReady_startsFlow() 149 () -> assertThat(UserParameters.isSetupWizardTimedOut(mTestApp)).isTrue()).get(); in doWork_suwNotComplete_unprovisioned_provisionReady_startsFlow()
|
D | PauseProvisioningWorkerTest.java | 64 private TestDeviceLockControllerApplication mTestApp; field in PauseProvisioningWorkerTest 68 mTestApp = ApplicationProvider.getApplicationContext(); in setUp() 71 mTestApp, PauseProvisioningWorker.class) in setUp() 87 (StatsLoggerProvider) mTestApp.getApplicationContext(); in setUp()
|
/packages/modules/DeviceLock/DeviceLockController/tests/robolectric/src/com/android/devicelockcontroller/policy/ |
D | StartLockTaskModeWorkerTest.java | 86 private TestDeviceLockControllerApplication mTestApp; field in StartLockTaskModeWorkerTest 94 mTestApp = ApplicationProvider.getApplicationContext(); in setUp() 95 mPackageManager = mTestApp.getPackageManager(); in setUp() 96 mWorker = TestListenableWorkerBuilder.from(mTestApp, StartLockTaskModeWorker.class) in setUp() 105 ? new StartLockTaskModeWorker(mTestApp, in setUp() 115 shadowOf(mTestApp.getSystemService(ActivityManager.class)).setLockTaskModeState( in setUp() 119 mDevicePolicyController = mTestApp.getPolicyController(); in setUp() 139 Intent launchedIntent = shadowOf(mTestApp).getNextStartedActivity(); in doWork_launchesActivityInLockedTaskMode() 145 eq(new ComponentName(mTestApp, LockedHomeActivity.class))); in doWork_launchesActivityInLockedTaskMode() 147 new ComponentName(mTestApp, LockedHomeActivity.class))).isEqualTo( in doWork_launchesActivityInLockedTaskMode() [all …]
|
D | ProvisionStateControllerImplTest.java | 71 private TestDeviceLockControllerApplication mTestApp; field in ProvisionStateControllerImplTest 77 mTestApp = ApplicationProvider.getApplicationContext(); in setUp() 78 WorkManagerTestInitHelper.initializeTestWorkManager(mTestApp); in setUp() 79 mProvisionStateController = new ProvisionStateControllerImpl(mTestApp, in setUp() 82 mStatsLogger = mTestApp.getStatsLogger(); in setUp() 112 new ComponentName(mTestApp, LockedBootCompletedReceiver.class); in setNextStateForEvent_shouldSetExpectedNextProvisionState() 113 PackageManager packageManager = mTestApp.getPackageManager(); in setNextStateForEvent_shouldSetExpectedNextProvisionState() 148 assertThat(UserParameters.getProvisioningStartTimeMillis(mTestApp)) in setNextStateForEvent_shouldWriteStartTimeToUserParameters_whenProvisonReady() 157 UserParameters.setProvisionState(mTestApp, ProvisionState.KIOSK_PROVISIONED); in setNextStateForEvent_shouldLogSuccessfulProvisioning_whenProvisionSuccess() 233 ContentResolver contentResolver = mTestApp.getContentResolver(); in notifyProvisioningReady_whenSetupIsComplete_shouldSetExpectedProvisionState() [all …]
|
D | ProvisionHelperImplTest.java | 125 private TestDeviceLockControllerApplication mTestApp; field in ProvisionHelperImplTest 133 mTestApp = ApplicationProvider.getApplicationContext(); in setUp() 134 mMockStateController = mTestApp.getProvisionStateController(); in setUp() 136 ProvisionHelperImpl.getSharedPreferences(mTestApp).edit().clear().commit(); in setUp() 137 mProvisionHelper = new ProvisionHelperImpl(mTestApp, mMockStateController, executor); in setUp() 139 WorkManagerTestInitHelper.initializeTestWorkManager(mTestApp, in setUp() 142 mTestDriver = WorkManagerTestInitHelper.getTestDriver(mTestApp); in setUp() 206 WorkManager.getInstance(mTestApp).getWorkInfosForUniqueWork( in checkGeoEligibility_workTimeout_thenProceedToFailure() 282 ProvisionHelperImpl.setPreinstalledKioskAllowed(mTestApp, false); in installKiosk_whenFlagIsDisabledOnDebuggableBuild_thenInstallFromPlay() 321 ProvisionHelperImpl.setPreinstalledKioskAllowed(mTestApp, true); in installKiosk_whenFlagIsEnabledOnNonDebuggableBuild_thenInstallFromPlay() [all …]
|
D | DevicePolicyControllerImplTest.java | 113 private TestDeviceLockControllerApplication mTestApp; field in DevicePolicyControllerImplTest 117 mTestApp = ApplicationProvider.getApplicationContext(); in setUp() 118 WorkManagerTestInitHelper.initializeTestWorkManager(mTestApp); in setUp() 129 mTestApp, mMockDpm, bgExecutor); in setUp() 130 PackagePolicyHandler packagePolicyHandler = new PackagePolicyHandler(mTestApp, mMockDpm, in setUp() 144 new DevicePolicyControllerImpl(mTestApp, in setUp() 385 verify(mTestApp.getDeviceLockControllerScheduler()).scheduleMandatoryResetDeviceAlarm(); in getLaunchIntent_withUnProvisionState_forCriticalFailure_shouldHaveExpectedIntent() 406 verify(mTestApp.getDeviceLockControllerScheduler()).scheduleMandatoryResetDeviceAlarm(); in getLaunchIntent_withProvisionPausedState_forCriticalFailure_shouldHaveExpectedIntent() 427 verify(mTestApp.getDeviceLockControllerScheduler()).scheduleMandatoryResetDeviceAlarm(); in getLaunchIntent_withProvisionSucceededSt_forCriticalFailure_shouldHaveExpectedIntent() 448 verify(mTestApp.getDeviceLockControllerScheduler()).scheduleMandatoryResetDeviceAlarm(); in getLaunchIntent_withKioskProvisionedState_forCriticalFailure_shouldHaveExpectedIntent() [all …]
|
/packages/apps/TV/tests/robotests/src/com/android/tv/data/epg/ |
D | EpgFetcherImplTest.java | 135 private TestApp mTestApp; field in EpgFetcherImplTest 141 mTestApp = (TestApp) RuntimeEnvironment.application; in setup() 168 mTestApp.flagsModule.cloudEpgFlags, in setup() 169 mTestApp.flagsModule.legacyFlags), in setup() 230 mTestApp.flagsModule.cloudEpgFlags.setThirdPartyEpgInput( in fetchImmediately_epgChannel()
|
/packages/modules/DeviceLock/DeviceLockController/tests/robolectric/src/com/android/devicelockcontroller/activities/ |
D | ProvisionInfoListAdapterTest.java | 53 private TestDeviceLockControllerApplication mTestApp; field in ProvisionInfoListAdapterTest 60 mTestApp = ApplicationProvider.getApplicationContext(); in setUp() 71 new ViewGroup(mTestApp) { in onCreateViewHolder_viewHolderContainsExpectedView()
|