Home
last modified time | relevance | path

Searched refs:latch (Results 1 – 25 of 203) sorted by relevance

123456789

/aosp12/packages/modules/NetworkStack/tests/unit/src/com/android/server/connectivity/ipmemorystore/
H A DIpMemoryStoreServiceTest.java364 functor.accept(latch);
383 latch.countDown();
399 latch.countDown();
520 latch.countDown();
529 latch.countDown();
537 latch.countDown();
620 latch.countDown();
630 latch.countDown();
642 latch.countDown();
652 latch.countDown();
[all …]
/aosp12/packages/services/Car/tests/carservice_unit_test/src/android/car/test/mocks/
H A DJavaMockitoHelperTest.java51 CountDownLatch latch = new CountDownLatch(1); in testAwait_CountDownLatch() local
52 new Thread(() -> latch.countDown(), "testAwait_CountDownLatch").start(); in testAwait_CountDownLatch()
54 JavaMockitoHelper.await(latch, TIMEOUT_MS); in testAwait_CountDownLatch()
56 assertThat(latch.getCount()).isEqualTo(0); in testAwait_CountDownLatch()
61 CountDownLatch latch = new CountDownLatch(1); in testSilentAwait_notCalled() local
63 assertThat(JavaMockitoHelper.silentAwait(latch, 5L)).isFalse(); in testSilentAwait_notCalled()
64 assertThat(latch.getCount()).isEqualTo(1); in testSilentAwait_notCalled()
69 CountDownLatch latch = new CountDownLatch(1); in testSilentAwait_called() local
70 new Thread(() -> latch.countDown(), "testSilentAwait_called").start(); in testSilentAwait_called()
72 assertThat(JavaMockitoHelper.silentAwait(latch, TIMEOUT_MS)).isTrue(); in testSilentAwait_called()
[all …]
H A DBlockingAnswerTest.java42 CountDownLatch latch = new CountDownLatch(1); in testForReturn() local
48 latch.countDown(); in testForReturn()
60 latch.await(1, TimeUnit.SECONDS); in testForReturn()
66 CountDownLatch latch = new CountDownLatch(1); in testForVoidReturn() local
70 latch.countDown(); in testForVoidReturn()
82 latch.await(1, TimeUnit.SECONDS); in testForVoidReturn()
/aosp12/frameworks/base/services/tests/servicestests/src/com/android/server/accounts/
H A DAccountManagerServiceTest.java573 waitForLatch(latch); in testStartAddAccountSessionSuccessWithoutPasswordForwarding()
605 waitForLatch(latch); in testStartAddAccountSessionSuccessWithPasswordForwarding()
645 waitForLatch(latch); in testStartAddAccountSessionReturnWithInvalidIntent()
674 waitForLatch(latch); in testStartAddAccountSessionReturnWithValidIntent()
703 waitForLatch(latch); in testStartAddAccountSessionError()
758 waitForLatch(latch); in testStartUpdateCredentialsSessionSuccessWithoutPasswordForwarding()
789 waitForLatch(latch); in testStartUpdateCredentialsSessionSuccessWithPasswordForwarding()
829 waitForLatch(latch); in testStartUpdateCredentialsSessionReturnWithInvalidIntent()
858 waitForLatch(latch); in testStartUpdateCredentialsSessionReturnWithValidIntent()
887 waitForLatch(latch); in testStartUpdateCredentialsSessionError()
[all …]
/aosp12/frameworks/base/apct-tests/perftests/multiuser/src/android/multiuser/
H A DUserLifecycleTests.java161 final CountDownLatch latch = new CountDownLatch(1); in createAndStartUser() local
182 final CountDownLatch latch = new CountDownLatch(1); in startUser() local
297 registerUserSwitchObserver(null, latch, userId); in lockedBootCompleted()
323 latch.countDown(); in ephemeralUserStopped()
614 final CountDownLatch latch = new CountDownLatch(1); in switchUserNoCheck() local
615 registerUserSwitchObserver(latch, null, userId); in switchUserNoCheck()
626 final CountDownLatch latch = new CountDownLatch(1); in stopUser() local
630 latch.countDown(); in stopUser()
672 final CountDownLatch latch = new CountDownLatch(1); in installPreexistingApp() local
678 latch.countDown(); in installPreexistingApp()
[all …]
/aosp12/packages/apps/Car/Calendar/tests/unit/src/com/android/car/calendar/common/
H A DEventsLiveDataTest.java205 CountDownLatch latch = new CountDownLatch(1); in addObserver_oneEventResult() local
211 awaitAndAssertDone(latch); in addObserver_oneEventResult()
310 CountDownLatch latch = new CountDownLatch(1); in noCalendars_valueNull() local
314 awaitAndAssertDone(latch); in noCalendars_valueNull()
333 CountDownLatch latch = new CountDownLatch(1); in multiDayEvent_createsMultipleEvents() local
338 awaitAndAssertDone(latch); in multiDayEvent_createsMultipleEvents()
355 awaitAndAssertDone(latch); in multiDayEvent_keepsOriginalTimes()
378 awaitAndAssertDone(latch); in multipleEvents_resultsSortedStart()
401 awaitAndAssertDone(latch); in multipleEvents_resultsSortedTitle()
423 awaitAndAssertDone(latch); in allDayEvent_timesSetToLocal()
[all …]
/aosp12/packages/services/Car/tests/carservice_test/src/com/android/car/garagemode/
H A DGarageModeTest.java105 CountDownLatch latch = new CountDownLatch(3); // 3 for three users in test_backgroundUsersStopedOnGarageModeCancel() local
106 mockCarUserServiceStopUserCall(getEventListener(), latch); in test_backgroundUsersStopedOnGarageModeCancel() local
112 waitForHandlerThreadToFinish(latch); in test_backgroundUsersStopedOnGarageModeCancel()
125 waitForHandlerThreadToFinish(latch); in test_restartingGarageModeStorePreviouslyStartedUsers()
129 latch = mockCarUserServiceStartUsersCall(userToStartInBackground); in test_restartingGarageModeStorePreviouslyStartedUsers()
132 waitForHandlerThreadToFinish(latch); in test_restartingGarageModeStorePreviouslyStartedUsers()
181 CountDownLatch latch = new CountDownLatch(1); in mockCarUserServiceStartUsersCall() local
183 latch.countDown(); in mockCarUserServiceStartUsersCall()
187 return latch; in mockCarUserServiceStartUsersCall()
199 CountDownLatch latch) { in mockCarUserServiceStopUserCall() argument
[all …]
/aosp12/frameworks/base/core/tests/coretests/src/com/android/internal/infra/
H A DAndroidFutureTest.java53 CountDownLatch latch = new CountDownLatch(1); in testWhenComplete_AlreadyComplete() local
57 latch.countDown(); in testWhenComplete_AlreadyComplete()
59 latch.await(); in testWhenComplete_AlreadyComplete()
65 CountDownLatch latch = new CountDownLatch(1); in testWhenComplete_NotYetComplete() local
69 latch.countDown(); in testWhenComplete_NotYetComplete()
71 assertThat(latch.getCount()).isEqualTo(1); in testWhenComplete_NotYetComplete()
73 latch.await(); in testWhenComplete_NotYetComplete()
74 assertThat(latch.getCount()).isEqualTo(0); in testWhenComplete_NotYetComplete()
92 CountDownLatch latch = new CountDownLatch(1); in testCompleteExceptionally_Listener() local
96 latch.countDown(); in testCompleteExceptionally_Listener()
[all …]
/aosp12/frameworks/base/tests/GamePerformance/src/android/gameperformance/
H A DGamePerformanceActivity.java59 final CountDownLatch latch = new CountDownLatch(1); in attachSurfaceView() local
66 latch.countDown(); in attachSurfaceView()
69 latch.await(); in attachSurfaceView()
79 final CountDownLatch latch = new CountDownLatch(1); in attachOpenGLView() local
86 latch.countDown(); in attachOpenGLView()
89 latch.await(); in attachOpenGLView()
98 final CountDownLatch latch = new CountDownLatch(1); in attachControlView() local
105 latch.countDown(); in attachControlView()
108 latch.await(); in attachControlView()
/aosp12/frameworks/base/services/autofill/java/com/android/server/autofill/
H A DAutofillManagerServiceShellCommand.java252 final CountDownLatch latch = new CountDownLatch(1); in getFieldClassificationScore() local
260 latch.countDown(); in getFieldClassificationScore()
263 return waitForLatch(pw, latch); in getFieldClassificationScore()
353 CountDownLatch latch = new CountDownLatch(1); in getSavedPasswordCount() local
361 latch.countDown(); in getSavedPasswordCount()
365 waitForLatch(pw, latch); in getSavedPasswordCount()
376 final CountDownLatch latch = new CountDownLatch(1); in requestDestroy() local
380 latch.countDown(); in requestDestroy()
392 final CountDownLatch latch = new CountDownLatch(1); in requestList() local
401 latch.countDown(); in requestList()
[all …]
/aosp12/packages/apps/DocumentsUI/tests/common/com/android/documentsui/testing/
H A DLatchedConsumer.java16 private CountDownLatch latch; field in LatchedConsumer
19 latch = new CountDownLatch(expectedCount); in LatchedConsumer()
22 public CountDownLatch getLatch() { return latch; } in getLatch()
29 latch.countDown(); in accept()
34 assertFalse(latch.await(timeout, unit)); in assertNotCalled()
39 assertTrue(latch.await(timeout, unit)); in assertCalled()
/aosp12/packages/services/Car/car-test-lib/src/android/car/test/mocks/
H A DJavaMockitoHelper.java44 public static void await(@NonNull CountDownLatch latch, long timeoutMs) in await() argument
46 if (!latch.await(timeoutMs, TimeUnit.MILLISECONDS)) { in await()
47 throw new IllegalStateException(latch + " not called in " + timeoutMs + " ms"); in await()
72 public static boolean silentAwait(@NonNull CountDownLatch latch, long timeoutMs) { in silentAwait() argument
75 called = latch.await(timeoutMs, TimeUnit.MILLISECONDS); in silentAwait()
77 Log.w(TAG, latch + " not called in " + timeoutMs + " ms"); in silentAwait()
81 Log.w(TAG, latch + " interrupted", e); in silentAwait()
/aosp12/packages/apps/Contacts/tests/src/com/android/contacts/database/
H A DNoNullCursorAsyncQueryHandlerTest.java59 final CountDownLatch latch = new CountDownLatch(1); in testCursorIsNotNull() local
75 latch.countDown(); in testCursorIsNotNull()
82 latch.await(5, TimeUnit.SECONDS); in testCursorIsNotNull()
89 final CountDownLatch latch = new CountDownLatch(1); in testCursorContainsCorrectCookies() local
102 latch.countDown(); in testCursorContainsCorrectCookies()
109 latch.await(5, TimeUnit.SECONDS); in testCursorContainsCorrectCookies()
116 final CountDownLatch latch = new CountDownLatch(1); in testCursorContainsCorrectColumns() local
129 latch.countDown(); in testCursorContainsCorrectColumns()
136 latch.await(5, TimeUnit.SECONDS); in testCursorContainsCorrectColumns()
/aosp12/frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/common/
H A DShellExecutor.java47 final CountDownLatch latch = new CountDownLatch(1); in executeBlocking() local
50 latch.countDown(); in executeBlocking()
52 latch.await(waitTimeout, waitTimeUnit); in executeBlocking()
71 final CountDownLatch latch = new CountDownLatch(1); in executeBlockingForResult() local
74 latch.countDown(); in executeBlockingForResult()
77 latch.await(); in executeBlockingForResult()
/aosp12/frameworks/base/services/contentcapture/java/com/android/server/contentcapture/
H A DContentCaptureManagerServiceShellCommand.java185 final CountDownLatch latch = new CountDownLatch(1); in requestDestroy() local
189 latch.countDown(); in requestDestroy()
192 return requestSessionCommon(pw, latch, () -> mService.destroySessions(userId, receiver)); in requestDestroy()
201 final CountDownLatch latch = new CountDownLatch(1); in requestList() local
210 latch.countDown(); in requestList()
213 return requestSessionCommon(pw, latch, () -> mService.listSessions(userId, receiver)); in requestList()
225 private int requestSessionCommon(PrintWriter pw, CountDownLatch latch, in requestSessionCommon() argument
228 return waitForLatch(pw, latch); in requestSessionCommon()
231 private int waitForLatch(PrintWriter pw, CountDownLatch latch) { in waitForLatch() argument
233 final boolean received = latch.await(5, TimeUnit.SECONDS); in waitForLatch()
/aosp12/frameworks/base/core/tests/coretests/src/android/transition/
H A DFadeTransitionTest.java54 assertTrue(latch.startLatch.await(400, TimeUnit.MILLISECONDS)); in testFadeOutAndIn()
58 assertTrue(latch.endLatch.await(800, TimeUnit.MILLISECONDS)); in testFadeOutAndIn()
64 assertTrue(latch.startLatch.await(400, TimeUnit.MILLISECONDS)); in testFadeOutAndIn()
70 assertTrue(latch.endLatch.await(800, TimeUnit.MILLISECONDS)); in testFadeOutAndIn()
176 TransitionLatch latch = new TransitionLatch(); in setVisibilityInTransition() local
177 transition.addListener(latch); in setVisibilityInTransition()
185 return latch; in setVisibilityInTransition()
192 final CountDownLatch latch = new CountDownLatch(2); in waitForAnimation() local
196 latch.countDown(); in waitForAnimation()
197 if (latch.getCount() > 0) { in waitForAnimation()
[all …]
H A DSlideTransitionTest.java58 TransitionLatch latch = setVisibilityInTransition(slideOut, R.id.square1, View.INVISIBLE); in testShortSlide() local
59 assertTrue(latch.startLatch.await(200, TimeUnit.MILLISECONDS)); in testShortSlide()
65 assertTrue(latch.endLatch.await(400, TimeUnit.MILLISECONDS)); in testShortSlide()
75 latch = setVisibilityInTransition(slideIn, R.id.square1, View.VISIBLE); in testShortSlide()
76 assertTrue(latch.startLatch.await(200, TimeUnit.MILLISECONDS)); in testShortSlide()
82 assertTrue(latch.endLatch.await(400, TimeUnit.MILLISECONDS)); in testShortSlide()
94 TransitionLatch latch = new TransitionLatch(); in setVisibilityInTransition() local
95 transition.addListener(latch); in setVisibilityInTransition()
103 return latch; in setVisibilityInTransition()
/aosp12/packages/modules/Permission/PermissionController/tests/inprocess/src/com/android/permissioncontroller/permission/
H A DGetPermissionGroupInfoTest.kt40 val latch = CountDownLatch(1) regex
43 latch.countDown()
45 latch.await(timeoutMs, TimeUnit.MILLISECONDS)
58 val latch = CountDownLatch(1) regex
61 latch.countDown()
63 latch.await(timeoutMs, TimeUnit.MILLISECONDS)
/aosp12/packages/services/Car/tests/carservice_unit_test/src/com/android/car/testapi/
H A DBlockingUserLifecycleListenerTest.java138 await(latch, TIMEOUT_MS); in testForSpecificEvents_receivedExtraEvents()
159 CountDownLatch latch = sendAsyncEvents(listener, in testForSpecificEvents_filterByUser() local
165 await(latch, TIMEOUT_MS); in testForSpecificEvents_filterByUser()
187 CountDownLatch latch = sendAsyncEvents(listener, in testForSpecificEvents_filterByUserDuplicatedEventTypes() local
193 await(latch, TIMEOUT_MS); in testForSpecificEvents_filterByUserDuplicatedEventTypes()
218 CountDownLatch latch = sendAsyncEvents(listener, in testForSpecificEvents_filterByPreviousUser() local
224 await(latch, TIMEOUT_MS); in testForSpecificEvents_filterByPreviousUser()
256 await(latch, TIMEOUT_MS); in testForSpecificEvents_filterByPreviousAndTargetUsers()
276 CountDownLatch latch = new CountDownLatch(1); in sendAsyncEvents() local
281 latch.countDown(); in sendAsyncEvents()
[all …]
/aosp12/frameworks/base/tests/TtsTests/src/com/android/speech/tts/
H A DTextToSpeechTests.java191 final CountDownLatch latch = new CountDownLatch(1); in blockingCallSpeak() local
192 doCountDown(latch).when(mock).onSynthesizeText(Mockito.<SynthesisRequest>anyObject(), in blockingCallSpeak()
196 awaitCountDown(latch, 5, TimeUnit.SECONDS); in blockingCallSpeak()
204 final CountDownLatch latch = new CountDownLatch(1); in blockingInitAndVerify() local
205 doCountDown(latch).when(listener).onInit(errorCode); in blockingInitAndVerify()
210 awaitCountDown(latch, 5, TimeUnit.SECONDS); in blockingInitAndVerify()
222 public static CountDownBehaviour doCountDown(final CountDownLatch latch) { in doCountDown() argument
229 latch.countDown(); in doCountDown()
243 latch.countDown(); in doCountDown()
253 public static void awaitCountDown(CountDownLatch latch, long timeout, TimeUnit unit)
[all …]
/aosp12/packages/apps/DocumentsUI/tests/unit/com/android/documentsui/
H A DAbstractActionHandlerTest.java270 CountDownLatch latch = new CountDownLatch(1); in testLoadChildrenDocuments() local
274 latch.await(1, TimeUnit.SECONDS); in testLoadChildrenDocuments()
298 CountDownLatch latch = new CountDownLatch(1); in testCrossProfileDocuments_success() local
302 latch.await(1, TimeUnit.SECONDS); in testCrossProfileDocuments_success()
322 CountDownLatch latch = new CountDownLatch(1); in testLoadCrossProfileDoc_failsWithQuietModeException() local
326 latch.await(1, TimeUnit.SECONDS); in testLoadCrossProfileDoc_failsWithQuietModeException()
343 CountDownLatch latch = new CountDownLatch(1); in testLoadCrossProfileDoc_failsWithNoPermissionException() local
347 latch.await(1, TimeUnit.SECONDS); in testLoadCrossProfileDoc_failsWithNoPermissionException()
367 CountDownLatch latch = new CountDownLatch(1); in testLoadCrossProfileDoc_bothError_showNoPermissionException() local
371 latch.await(1, TimeUnit.SECONDS); in testLoadCrossProfileDoc_bothError_showNoPermissionException()
[all …]
/aosp12/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/
H A DRecoverySnapshotListenersStorageTest.java58 CountDownLatch latch = new CountDownLatch(1); in setSnapshotListener_invokesIntentImmediatelyIfPreviouslyNotified() local
63 latch.countDown(); in setSnapshotListener_invokesIntentImmediatelyIfPreviouslyNotified()
69 assertTrue(latch.await(TEST_TIMEOUT_SECONDS, TimeUnit.SECONDS)); in setSnapshotListener_invokesIntentImmediatelyIfPreviouslyNotified()
79 CountDownLatch latch = new CountDownLatch(2); in setSnapshotListener_doesNotRepeatedlyInvokeListener() local
83 latch.countDown(); in setSnapshotListener_doesNotRepeatedlyInvokeListener()
91 assertFalse(latch.await(TEST_TIMEOUT_SECONDS, TimeUnit.SECONDS)); in setSnapshotListener_doesNotRepeatedlyInvokeListener()
/aosp12/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/testutils/
H A DBluetoothTestUtils.java52 CountDownLatch latch = new CountDownLatch(1); in setBluetoothState() local
53 LatchBroadcastReceiver receiver = new LatchBroadcastReceiver(latch, enable); in setBluetoothState()
61 latch.await(BLUETOOTH_TOGGLE_TIMEOUT, TimeUnit.SECONDS); in setBluetoothState()
77 private LatchBroadcastReceiver(CountDownLatch latch, boolean enable) { in LatchBroadcastReceiver() argument
78 mLatch = latch; in LatchBroadcastReceiver()
/aosp12/packages/apps/Car/libs/car-ui-lib/car-rotary-lib/src/androidTest/java/com/android/car/ui/utils/
H A DTestUtils.java49 CountDownLatch latch = new CountDownLatch(1); in accept() local
52 latch.countDown(); in accept()
55 .that(latch.await(WAIT_TIME_MS, TimeUnit.MILLISECONDS)).isTrue(); in accept()
70 CountDownLatch latch = new CountDownLatch(1); in test() local
73 latch.countDown(); in test()
76 .that(latch.await(WAIT_TIME_MS, TimeUnit.MILLISECONDS)).isTrue(); in test()
/aosp12/frameworks/base/services/tests/wmtests/src/com/android/server/wm/
H A DTaskStackChangedListenerTest.java125 final CountDownLatch latch = new CountDownLatch(1); in testTaskStackChanged_afterFinish() local
129 latch.countDown(); in testTaskStackChanged_afterFinish()
134 waitForCallback(latch); in testTaskStackChanged_afterFinish()
140 final CountDownLatch latch = new CountDownLatch(1); in testTaskStackChanged_resumeWhilePausing() local
144 latch.countDown(); in testTaskStackChanged_resumeWhilePausing()
149 waitForCallback(latch); in testTaskStackChanged_resumeWhilePausing()
171 latch.countDown(); in testTaskDescriptionChanged()
180 waitForCallback(latch); in testTaskDescriptionChanged()
196 latch.countDown(); in testActivityRequestedOrientationChanged()
203 waitForCallback(latch); in testActivityRequestedOrientationChanged()
[all …]

123456789