Fixed
Status Update
Comments
pa...@google.com <pa...@google.com> #2
This is currently also affecting a TextField as it has a blinking cursor. This means any text field that is on the screen will block our synchronization.
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit ba279a0fd4cb3df553cc80cfec23353fba8c0411
Author: Jelle Fresen <jellefresen@google.com>
Date: Wed Jun 10 15:07:39 2020
Disable blinking cursor in tests by default
The blinking cursor is a poster child example of an infinite animation.
As long as we don't have a solution in place to properly deal with
infinite animations, we disable the blinking cursor in tests to avoid
tests from timing out just because there is a TextField that has focus
in the test.
I moved the TextField tests for the cursor to a separate test class, so
we can explicitly enable (and manually control) the blinking cursor for
thoses tests.
Bug: 151940543
Test: ./gradlew ui:ui-foundation:cC ui:ui-material:cC ui:ui-test:cC
Change-Id: I12984b8f43f6b587aa5cd9aabeaea96309e9086b
M ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/SoftwareKeyboardTest.kt
A ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldCursorTest.kt
M ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldOnValueChangeTextFieldValueTest.kt
M ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldTest.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/TextField.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/FilledTextFieldTest.kt
M ui/ui-test/api/0.1.0-dev14.txt
M ui/ui-test/api/api_lint.ignore
M ui/ui-test/api/current.txt
M ui/ui-test/api/public_plus_experimental_0.1.0-dev14.txt
M ui/ui-test/api/public_plus_experimental_current.txt
M ui/ui-test/api/restricted_0.1.0-dev14.txt
M ui/ui-test/api/restricted_current.txt
M ui/ui-test/src/androidTest/java/androidx/ui/test/TextActionsTest.kt
M ui/ui-test/src/main/java/androidx/ui/test/ComposeTestRule.kt
M ui/ui-test/src/main/java/androidx/ui/test/android/AndroidComposeTestRule.kt
https://android-review.googlesource.com/1329004
https://goto.google.com/android-sha1/ba279a0fd4cb3df553cc80cfec23353fba8c0411
Branch: androidx-master-dev
commit ba279a0fd4cb3df553cc80cfec23353fba8c0411
Author: Jelle Fresen <jellefresen@google.com>
Date: Wed Jun 10 15:07:39 2020
Disable blinking cursor in tests by default
The blinking cursor is a poster child example of an infinite animation.
As long as we don't have a solution in place to properly deal with
infinite animations, we disable the blinking cursor in tests to avoid
tests from timing out just because there is a TextField that has focus
in the test.
I moved the TextField tests for the cursor to a separate test class, so
we can explicitly enable (and manually control) the blinking cursor for
thoses tests.
Bug: 151940543
Test: ./gradlew ui:ui-foundation:cC ui:ui-material:cC ui:ui-test:cC
Change-Id: I12984b8f43f6b587aa5cd9aabeaea96309e9086b
M ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/SoftwareKeyboardTest.kt
A ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldCursorTest.kt
M ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldOnValueChangeTextFieldValueTest.kt
M ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldTest.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/TextField.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/FilledTextFieldTest.kt
M ui/ui-test/api/0.1.0-dev14.txt
M ui/ui-test/api/api_lint.ignore
M ui/ui-test/api/current.txt
M ui/ui-test/api/public_plus_experimental_0.1.0-dev14.txt
M ui/ui-test/api/public_plus_experimental_current.txt
M ui/ui-test/api/restricted_0.1.0-dev14.txt
M ui/ui-test/api/restricted_current.txt
M ui/ui-test/src/androidTest/java/androidx/ui/test/TextActionsTest.kt
M ui/ui-test/src/main/java/androidx/ui/test/ComposeTestRule.kt
M ui/ui-test/src/main/java/androidx/ui/test/android/AndroidComposeTestRule.kt
ap...@google.com <ap...@google.com> #4
This bug was referenced by a recent CL that changed the Android API surface area.
The Android API Council <http://go/android-api-council > regularly reviews API changes for
consistency and sustainability, and we've just added this bug to our hotlist of pending reviews.
We'll wait until you mark this bug as 'Fixed' before starting our review, but please reach out
if you'd like us to review it sooner.
CHANGES TO ui/ui-test/api/current.txt
http://goto.google.com/android-api-diff/support/cur/pkg/androidx.ui.test
http://goto.google.com/android-api-diff/support/cur/clz/androidx.ui.test.ComposeTestRuleKt
http://goto.google.com/android-api-diff/support/cur/pkg/androidx.ui.test.android
http://goto.google.com/android-api-diff/support/cur/clz/androidx.ui.test.android.AndroidComposeTestCaseSetup
http://goto.google.com/android-api-diff/support/cur/clz/androidx.ui.test.android.AndroidComposeTestRuleKt
CHANGES TO ui/ui-test/api/public_plus_experimental_current.txt
http://goto.google.com/android-api-diff/support/cur/pkg/androidx.ui.test
http://goto.google.com/android-api-diff/support/cur/clz/androidx.ui.test.ComposeTestRuleKt
http://goto.google.com/android-api-diff/support/cur/pkg/androidx.ui.test.android
http://goto.google.com/android-api-diff/support/cur/clz/androidx.ui.test.android.AndroidComposeTestCaseSetup
http://goto.google.com/android-api-diff/support/cur/clz/androidx.ui.test.android.AndroidComposeTestRuleKt
The links above may take several days to start working. Generated fromhttp://go/support-current.txt/ba279a0fd4cb3df553cc80cfec23353fba8c0411
[Gerrit:http://android-review.googlesource.com/1329004 ]
[API-Approvers:pavlis@google.com]
[LIBRARY_API_REVIEW_TAG:ui/ui-test/api/0.1.0-dev14.txt]
The Android API Council <
consistency and sustainability, and we've just added this bug to our hotlist of pending reviews.
We'll wait until you mark this bug as 'Fixed' before starting our review, but please reach out
if you'd like us to review it sooner.
CHANGES TO ui/ui-test/api/current.txt
CHANGES TO ui/ui-test/api/public_plus_experimental_current.txt
The links above may take several days to start working. Generated from
[Gerrit:
[API-Approvers:pavlis@google.com]
[LIBRARY_API_REVIEW_TAG:ui/ui-test/api/0.1.0-dev14.txt]
tc...@google.com <tc...@google.com> #5
Hi Jelle. Is this fixed or is there still more work to do? Thanks!
tc...@google.com <tc...@google.com> #6
Hi Jelle. Can you please update this by eod Tues so that we can close the iteration. Thanks.
je...@google.com <je...@google.com> #7
Sorry, removed it from the dev14 hotlist
je...@google.com <je...@google.com> #8
A workaround that can be used if you encounter this problem in one of your tests, is to pause the clock at the beginning of the test and advance it manually whenever you need to move forward in the animations that are currently running:
@get:Rule
val composeTestRule = createComposeRule()
val clockTestRule get() = composeTestRule.clockTestRule
@Test
fun test() {
clockTestRule.pauseClock()
// ...
runOnIdle {
clockTestRule.advanceClock(1000)
}
// ...
}
ap...@google.com <ap...@google.com> #9
Project: platform/frameworks/support
Branch: androidx-main
commit f0649b27c6df6fa151202e3f23913998805fb398
Author: Jelle Fresen <jellefresen@google.com>
Date: Tue Jan 26 12:06:58 2021
Add isInfinite to Animation and VectorizedAnimationSpec
Will be used to facilitate special handling of infinte animations in
tests, so the test framework won't await these animations indefinitely.
Bug: 151940543
Test: IsInfiniteTest.kt
Relnote: "Added `Animation.isInfinite` and
`VectorizedAnimationSpec.isInfinite` that signal if an animation is
infinite or not. This can be used in implementations of animations to
have special handling of such animations. For example, a special \"time
remaining\" message can be shown, or during tests the animation can be
cancelled to prevent waiting for idleness indefinitely."
Change-Id: Iebb05e9d158b4fe81d037ab28e113da4926c50cd
M compose/animation/animation-core/api/current.txt
M compose/animation/animation-core/api/public_plus_experimental_current.txt
M compose/animation/animation-core/api/restricted_current.txt
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/Animation.kt
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/VectorizedAnimationSpec.kt
A compose/animation/animation-core/src/test/java/androidx/compose/animation/core/IsInfiniteTest.kt
https://android-review.googlesource.com/1560508
Branch: androidx-main
commit f0649b27c6df6fa151202e3f23913998805fb398
Author: Jelle Fresen <jellefresen@google.com>
Date: Tue Jan 26 12:06:58 2021
Add isInfinite to Animation and VectorizedAnimationSpec
Will be used to facilitate special handling of infinte animations in
tests, so the test framework won't await these animations indefinitely.
Bug: 151940543
Test: IsInfiniteTest.kt
Relnote: "Added `Animation.isInfinite` and
`VectorizedAnimationSpec.isInfinite` that signal if an animation is
infinite or not. This can be used in implementations of animations to
have special handling of such animations. For example, a special \"time
remaining\" message can be shown, or during tests the animation can be
cancelled to prevent waiting for idleness indefinitely."
Change-Id: Iebb05e9d158b4fe81d037ab28e113da4926c50cd
M compose/animation/animation-core/api/current.txt
M compose/animation/animation-core/api/public_plus_experimental_current.txt
M compose/animation/animation-core/api/restricted_current.txt
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/Animation.kt
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/VectorizedAnimationSpec.kt
A compose/animation/animation-core/src/test/java/androidx/compose/animation/core/IsInfiniteTest.kt
ap...@google.com <ap...@google.com> #10
Project: platform/frameworks/support
Branch: androidx-main
commit ae92240e2b212a7c0cfbccdd716efa84f3da34f2
Author: Jelle Fresen <jellefresen@google.com>
Date: Thu Jan 28 17:15:52 2021
Cancel infinite animations in tests
Infinite animations are now started through withInfiniteAnimation, which
checks the InfiniteAnimationPolicy and applies it if present when
withFrameNanos or withFrameMillis is called.
ComposeTestRule installs an InfiniteAnimationPolicy in the
applyCoroutineContext that cancels the coroutine when that policy is
applied.
This enables us to remove special handling of demos with infinite
animations in DemoTest, and we can now remove blinkingCursorEnabled.
Fixes: 151940543
Bug: 168695905
Test: ./gradlew compose:animation:animation-core:test && \
./gradlew compose:animation:animation-core:cC && \
./gradlew compose:ui:ui-test:cC
Relnote: "Introduced an `InfiniteAnimationPolicy` coroutine context
element that will be applied in infinite animations. By default no
policy is installed, except when running tests with `ComposeTestRule`."
Change-Id: I50ec421d7db495459a61c9282dbc2bfbc1f1ad02
M compose/animation/animation-core/api/current.txt
M compose/animation/animation-core/api/public_plus_experimental_current.txt
M compose/animation/animation-core/api/restricted_current.txt
M compose/animation/animation-core/src/androidAndroidTest/kotlin/androidx/compose/animation/core/InfiniteTransitionTest.kt
A compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/InfiniteAnimationPolicy.kt
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/InfiniteTransition.kt
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/SuspendAnimation.kt
A compose/animation/animation-core/src/test/java/androidx/compose/animation/core/InfiniteAnimationPolicyTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldCursorTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldCursor.kt
M compose/integration-tests/demos/src/androidTest/java/androidx/compose/integration/demos/test/DemoTest.kt
M compose/integration-tests/src/main/java/androidx/ui/integration/test/core/text/TextFieldToggleTextTestCase.kt
M compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/AndroidComposeTestRule.kt
A compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/InfiniteAnimationTest.kt
https://android-review.googlesource.com/1563734
Branch: androidx-main
commit ae92240e2b212a7c0cfbccdd716efa84f3da34f2
Author: Jelle Fresen <jellefresen@google.com>
Date: Thu Jan 28 17:15:52 2021
Cancel infinite animations in tests
Infinite animations are now started through withInfiniteAnimation, which
checks the InfiniteAnimationPolicy and applies it if present when
withFrameNanos or withFrameMillis is called.
ComposeTestRule installs an InfiniteAnimationPolicy in the
applyCoroutineContext that cancels the coroutine when that policy is
applied.
This enables us to remove special handling of demos with infinite
animations in DemoTest, and we can now remove blinkingCursorEnabled.
Fixes: 151940543
Bug: 168695905
Test: ./gradlew compose:animation:animation-core:test && \
./gradlew compose:animation:animation-core:cC && \
./gradlew compose:ui:ui-test:cC
Relnote: "Introduced an `InfiniteAnimationPolicy` coroutine context
element that will be applied in infinite animations. By default no
policy is installed, except when running tests with `ComposeTestRule`."
Change-Id: I50ec421d7db495459a61c9282dbc2bfbc1f1ad02
M compose/animation/animation-core/api/current.txt
M compose/animation/animation-core/api/public_plus_experimental_current.txt
M compose/animation/animation-core/api/restricted_current.txt
M compose/animation/animation-core/src/androidAndroidTest/kotlin/androidx/compose/animation/core/InfiniteTransitionTest.kt
A compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/InfiniteAnimationPolicy.kt
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/InfiniteTransition.kt
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/SuspendAnimation.kt
A compose/animation/animation-core/src/test/java/androidx/compose/animation/core/InfiniteAnimationPolicyTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldCursorTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldCursor.kt
M compose/integration-tests/demos/src/androidTest/java/androidx/compose/integration/demos/test/DemoTest.kt
M compose/integration-tests/src/main/java/androidx/ui/integration/test/core/text/TextFieldToggleTextTestCase.kt
M compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/AndroidComposeTestRule.kt
A compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/InfiniteAnimationTest.kt
Description
No description yet.