From ca6d0d258e1ea8f227521646506cf4a42c5ac02a Mon Sep 17 00:00:00 2001 From: Nicolo' Mazzucato Date: Mon, 3 Apr 2023 09:04:07 +0000 Subject: [PATCH] Fix TestUnfoldProgressListener when there are no progress .last() was failing when there was still no progress. Test: RemoteUnfoldTransitionReceiverTest Bug: 276407993 Change-Id: I82afe7a94e29975b96c749885fcbf87a0eeaa89c --- .../systemui/unfold/progress/TestUnfoldProgressListener.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/SystemUI/tests/src/com/android/systemui/unfold/progress/TestUnfoldProgressListener.kt b/packages/SystemUI/tests/src/com/android/systemui/unfold/progress/TestUnfoldProgressListener.kt index 39ea46a657f28..e2aef31b4f10d 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/unfold/progress/TestUnfoldProgressListener.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/unfold/progress/TestUnfoldProgressListener.kt @@ -126,7 +126,7 @@ class TestUnfoldProgressListener : UnfoldTransitionProgressProvider.TransitionPr } fun assertLastProgress(progress: Float) { - waitForCondition { progress == progressHistory.last() } + waitForCondition { progress == progressHistory.lastOrNull() } } }