Revert "Make TestAnimationClock & friends experimental"
This reverts commit 1cdacde6cc21c636c5288e6e2beea03b1195b3cd.
Reason for revert: TextFieldCursorTest.kt Unresolved reference: assertPixels
Change-Id: Ieadc74a3a5819a016ad21ea0712a93a988f25b8a
diff --git a/compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/AnimatedVisibilityTest.kt b/compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/AnimatedVisibilityTest.kt
index b07e4ad..2d6dbd1 100644
--- a/compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/AnimatedVisibilityTest.kt
+++ b/compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/AnimatedVisibilityTest.kt
@@ -30,7 +30,6 @@
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.platform.DensityAmbient
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.IntSize
@@ -47,7 +46,6 @@
@RunWith(AndroidJUnit4::class)
@LargeTest
-@OptIn(ExperimentalTesting::class)
class AnimatedVisibilityTest {
@get:Rule
diff --git a/compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/AnimationModifierTest.kt b/compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/AnimationModifierTest.kt
index 0cd9f84..e27f2e1 100644
--- a/compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/AnimationModifierTest.kt
+++ b/compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/AnimationModifierTest.kt
@@ -31,7 +31,6 @@
import androidx.compose.ui.platform.DensityAmbient
import androidx.compose.ui.platform.InspectableValue
import androidx.compose.ui.platform.isDebugInspectorInfoEnabled
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.unit.Constraints
import androidx.compose.ui.unit.IntSize
@@ -52,7 +51,6 @@
@RunWith(AndroidJUnit4::class)
@LargeTest
-@OptIn(ExperimentalTesting::class)
class AnimationModifierTest {
@get:Rule
diff --git a/compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/CrossfadeTest.kt b/compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/CrossfadeTest.kt
index a2a81cb..48388d0 100644
--- a/compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/CrossfadeTest.kt
+++ b/compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/CrossfadeTest.kt
@@ -23,7 +23,6 @@
import androidx.compose.runtime.onDispose
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithText
import androidx.test.ext.junit.runners.AndroidJUnit4
@@ -35,7 +34,6 @@
@RunWith(AndroidJUnit4::class)
@MediumTest
-@OptIn(ExperimentalTesting::class)
class CrossfadeTest {
@get:Rule
diff --git a/compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/SingleValueAnimationTest.kt b/compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/SingleValueAnimationTest.kt
index 857e076..c60995d4 100644
--- a/compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/SingleValueAnimationTest.kt
+++ b/compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/SingleValueAnimationTest.kt
@@ -33,7 +33,6 @@
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.lerp
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.unit.Bounds
import androidx.compose.ui.unit.Position
@@ -48,7 +47,6 @@
@RunWith(AndroidJUnit4::class)
@MediumTest
-@OptIn(ExperimentalTesting::class)
class SingleValueAnimationTest {
@get:Rule
diff --git a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/TextFieldCursorTest.kt b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/TextFieldCursorTest.kt
index 570bfa1..c85f1d7 100644
--- a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/TextFieldCursorTest.kt
+++ b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/TextFieldCursorTest.kt
@@ -33,8 +33,6 @@
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ImageBitmap
import androidx.compose.ui.graphics.RectangleShape
-import androidx.compose.ui.test.ExperimentalTesting
-import androidx.compose.ui.test.assertPixels
import androidx.compose.ui.test.captureToImage
import androidx.compose.ui.test.hasSetTextAction
import androidx.compose.ui.test.junit4.createComposeRule
@@ -56,7 +54,7 @@
import java.util.concurrent.TimeUnit
@LargeTest
-@OptIn(ExperimentalFocus::class, ExperimentalTesting::class)
+@OptIn(ExperimentalFocus::class)
class TextFieldCursorTest {
@get:Rule
diff --git a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ZoomableTest.kt b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ZoomableTest.kt
index d658268..edc41ce 100644
--- a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ZoomableTest.kt
+++ b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ZoomableTest.kt
@@ -27,8 +27,8 @@
import androidx.compose.ui.platform.InspectableValue
import androidx.compose.ui.platform.isDebugInspectorInfoEnabled
import androidx.compose.ui.platform.testTag
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.compose.ui.test.center
+import androidx.compose.ui.test.junit4.createAnimationClockRule
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.performGesture
@@ -51,11 +51,13 @@
@MediumTest
@RunWith(AndroidJUnit4::class)
-@OptIn(ExperimentalTesting::class)
class ZoomableTest {
@get:Rule
val rule = createComposeRule()
+ @get:Rule
+ val clockRule = createAnimationClockRule()
+
@Before
fun before() {
isDebugInspectorInfoEnabled = true
@@ -71,7 +73,7 @@
var cumulativeScale = 1.0f
val controller = ZoomableController(
cumulativeScale *= it },
- animationClock = rule.clockTestRule.clock
+ animationClock = clockRule.clock
)
setZoomableContent { Modifier.zoomable(controller) }
@@ -90,7 +92,7 @@
)
}
- rule.clockTestRule.advanceClock(milliseconds = 1000)
+ clockRule.advanceClock(milliseconds = 1000)
rule.runOnIdle {
assertWithMessage("Should have scaled at least 4x").that(cumulativeScale).isAtLeast(4f)
@@ -102,7 +104,7 @@
var cumulativeScale = 1.0f
val controller = ZoomableController(
cumulativeScale *= it },
- animationClock = rule.clockTestRule.clock
+ animationClock = clockRule.clock
)
setZoomableContent { Modifier.zoomable(controller) }
@@ -121,7 +123,7 @@
)
}
- rule.clockTestRule.advanceClock(milliseconds = 1000)
+ clockRule.advanceClock(milliseconds = 1000)
rule.runOnIdle {
assertWithMessage("Should have scaled down at least 4x")
@@ -137,7 +139,7 @@
var stopTriggered = 0f
val controller = ZoomableController(
cumulativeScale *= it },
- animationClock = rule.clockTestRule.clock
+ animationClock = clockRule.clock
)
setZoomableContent {
@@ -168,7 +170,7 @@
)
}
- rule.clockTestRule.advanceClock(milliseconds = 1000)
+ clockRule.advanceClock(milliseconds = 1000)
rule.runOnIdle {
assertThat(startTriggered).isEqualTo(1)
@@ -182,7 +184,7 @@
var cumulativeScale = 1.0f
val controller = ZoomableController(
cumulativeScale *= it },
- animationClock = rule.clockTestRule.clock
+ animationClock = clockRule.clock
)
setZoomableContent {
@@ -204,7 +206,7 @@
)
}
- rule.clockTestRule.advanceClock(milliseconds = 1000)
+ clockRule.advanceClock(milliseconds = 1000)
val prevScale = rule.runOnIdle {
assertWithMessage("Should have scaled at least 4x").that(cumulativeScale).isAtLeast(4f)
@@ -239,7 +241,7 @@
var stopTriggered = 0f
val controller = ZoomableController(
cumulativeScale *= it },
- animationClock = rule.clockTestRule.clock
+ animationClock = clockRule.clock
)
setZoomableContent {
@@ -272,7 +274,7 @@
)
}
- rule.clockTestRule.advanceClock(milliseconds = 1000)
+ clockRule.advanceClock(milliseconds = 1000)
rule.runOnIdle {
assertThat(cumulativeScale).isAtLeast(2f)
@@ -289,26 +291,26 @@
cumulativeScale *= it
callbackCount += 1
},
- animationClock = rule.clockTestRule.clock
+ animationClock = clockRule.clock
)
setZoomableContent { Modifier.zoomable(state) }
rule.runOnUiThread { state.smoothScaleBy(4f) }
- rule.clockTestRule.advanceClock(milliseconds = 10)
+ clockRule.advanceClock(milliseconds = 10)
rule.runOnIdle {
assertWithMessage("Scrolling should have been smooth").that(callbackCount).isAtLeast(1)
}
- rule.clockTestRule.advanceClock(milliseconds = 10)
+ clockRule.advanceClock(milliseconds = 10)
rule.runOnIdle {
assertWithMessage("Scrolling should have been smooth").that(callbackCount).isAtLeast(2)
}
- rule.clockTestRule.advanceClock(milliseconds = 1000)
+ clockRule.advanceClock(milliseconds = 1000)
rule.runOnIdle {
assertWithMessage("Scrolling should have been smooth").that(callbackCount).isAtLeast(3)
@@ -321,7 +323,7 @@
fun testInspectorValue() {
val controller = ZoomableController(
>
- animationClock = rule.clockTestRule.clock
+ animationClock = clockRule.clock
)
rule.setContent {
val modifier = Modifier.zoomable(controller) as InspectableValue
diff --git a/compose/integration-tests/demos/src/androidTest/java/androidx/compose/integration/demos/test/DemoTest.kt b/compose/integration-tests/demos/src/androidTest/java/androidx/compose/integration/demos/test/DemoTest.kt
index afe1022..7bd3c58 100644
--- a/compose/integration-tests/demos/src/androidTest/java/androidx/compose/integration/demos/test/DemoTest.kt
+++ b/compose/integration-tests/demos/src/androidTest/java/androidx/compose/integration/demos/test/DemoTest.kt
@@ -30,7 +30,6 @@
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import androidx.test.filters.MediumTest
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.compose.ui.test.SemanticsNodeInteractionCollection
import androidx.compose.ui.test.assertTextEquals
import androidx.compose.ui.test.junit4.createAndroidComposeRule
@@ -50,7 +49,6 @@
@LargeTest
@RunWith(AndroidJUnit4::class)
-@OptIn(ExperimentalTesting::class)
class DemoTest {
@get:Rule
val rule = createAndroidComposeRule<DemoActivity>()
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/BottomNavigationScreenshotTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/BottomNavigationScreenshotTest.kt
index 1a95074..d468b4b 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/BottomNavigationScreenshotTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/BottomNavigationScreenshotTest.kt
@@ -29,7 +29,6 @@
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.semantics.semantics
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.compose.ui.test.captureToImage
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithTag
@@ -44,7 +43,7 @@
@LargeTest
@RunWith(AndroidJUnit4::class)
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.O)
-@OptIn(ExperimentalMaterialApi::class, ExperimentalTesting::class)
+@OptIn(ExperimentalMaterialApi::class)
class BottomNavigationScreenshotTest {
@get:Rule
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ButtonScreenshotTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ButtonScreenshotTest.kt
index 1f907e6..632ae05 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ButtonScreenshotTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ButtonScreenshotTest.kt
@@ -21,7 +21,6 @@
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.testutils.assertAgainstGolden
import androidx.compose.ui.Modifier
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.compose.ui.test.captureToImage
import androidx.compose.ui.test.center
import androidx.compose.ui.test.down
@@ -42,7 +41,6 @@
@MediumTest
@RunWith(AndroidJUnit4::class)
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.O)
-@OptIn(ExperimentalTesting::class)
class ButtonScreenshotTest {
@get:Rule
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxScreenshotTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxScreenshotTest.kt
index 23b19e1..1071227 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxScreenshotTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxScreenshotTest.kt
@@ -25,7 +25,6 @@
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.state.ToggleableState
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.compose.ui.test.captureToImage
import androidx.compose.ui.test.center
import androidx.compose.ui.test.down
@@ -46,7 +45,6 @@
@MediumTest
@RunWith(AndroidJUnit4::class)
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.O)
-@OptIn(ExperimentalTesting::class)
class CheckboxScreenshotTest {
@get:Rule
@@ -203,4 +201,4 @@
.captureToImage()
.assertAgainstGolden(screenshotRule, goldenName)
}
-}
+}
\ No newline at end of file
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/MenuTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/MenuTest.kt
index 1a07cbb..a01aa52 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/MenuTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/MenuTest.kt
@@ -28,7 +28,6 @@
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.DensityAmbient
import androidx.compose.ui.platform.testTag
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.compose.ui.test.hasAnyDescendant
import androidx.compose.ui.test.hasTestTag
import androidx.compose.ui.test.isPopup
@@ -51,7 +50,6 @@
@MediumTest
@RunWith(AndroidJUnit4::class)
-@OptIn(ExperimentalTesting::class)
class MenuTest {
@get:Rule
val rule = createComposeRule()
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ProgressIndicatorTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ProgressIndicatorTest.kt
index 7f8b8ab..db9b8ca 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ProgressIndicatorTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ProgressIndicatorTest.kt
@@ -20,7 +20,6 @@
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.semantics.AccessibilityRangeInfo
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.compose.ui.test.assertHeightIsEqualTo
import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.assertRangeInfoEquals
@@ -37,7 +36,6 @@
@LargeTest
@RunWith(AndroidJUnit4::class)
-@OptIn(ExperimentalTesting::class)
class ProgressIndicatorTest {
private val ExpectedLinearWidth = 240.dp
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/RadioButtonScreenshotTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/RadioButtonScreenshotTest.kt
index 747b65f..b6c2f98 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/RadioButtonScreenshotTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/RadioButtonScreenshotTest.kt
@@ -25,7 +25,6 @@
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.compose.ui.test.captureToImage
import androidx.compose.ui.test.center
import androidx.compose.ui.test.down
@@ -46,7 +45,6 @@
@MediumTest
@RunWith(AndroidJUnit4::class)
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.O)
-@OptIn(ExperimentalTesting::class)
class RadioButtonScreenshotTest {
@get:Rule
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwitchScreenshotTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwitchScreenshotTest.kt
index 064b0a1..5afe047 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwitchScreenshotTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwitchScreenshotTest.kt
@@ -29,7 +29,6 @@
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LayoutDirectionAmbient
import androidx.compose.ui.platform.testTag
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.compose.ui.test.captureToImage
import androidx.compose.ui.test.center
import androidx.compose.ui.test.down
@@ -52,7 +51,6 @@
@MediumTest
@RunWith(AndroidJUnit4::class)
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.O)
-@OptIn(ExperimentalTesting::class)
class SwitchScreenshotTest {
@get:Rule
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/TabScreenshotTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/TabScreenshotTest.kt
index b011009..c1ba7a5 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/TabScreenshotTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/TabScreenshotTest.kt
@@ -27,7 +27,6 @@
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.semantics.semantics
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.compose.ui.test.captureToImage
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithTag
@@ -42,7 +41,7 @@
@LargeTest
@RunWith(AndroidJUnit4::class)
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.O)
-@OptIn(ExperimentalMaterialApi::class, ExperimentalTesting::class)
+@OptIn(ExperimentalMaterialApi::class)
class TabScreenshotTest {
@get:Rule
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ripple/RippleIndicationTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ripple/RippleIndicationTest.kt
index 4d8700f..fc16c3d 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ripple/RippleIndicationTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ripple/RippleIndicationTest.kt
@@ -46,7 +46,6 @@
import androidx.compose.ui.graphics.compositeOver
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.semantics.semantics
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.compose.ui.test.captureToImage
import androidx.compose.ui.test.junit4.ComposeTestRule
import androidx.compose.ui.test.junit4.createComposeRule
@@ -64,7 +63,7 @@
@LargeTest
@RunWith(AndroidJUnit4::class)
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.O)
-@OptIn(ExperimentalMaterialApi::class, ExperimentalTesting::class)
+@OptIn(ExperimentalMaterialApi::class)
class RippleIndicationTest {
@get:Rule
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/textfield/OutlinedTextFieldTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/textfield/OutlinedTextFieldTest.kt
index be4bd9f..e4c5cf0 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/textfield/OutlinedTextFieldTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/textfield/OutlinedTextFieldTest.kt
@@ -47,7 +47,6 @@
import androidx.compose.ui.node.Ref
import androidx.compose.ui.platform.TextInputServiceAmbient
import androidx.compose.ui.platform.testTag
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.compose.ui.test.captureToImage
import androidx.compose.ui.test.click
import androidx.compose.ui.test.junit4.createComposeRule
@@ -82,7 +81,7 @@
@MediumTest
@RunWith(AndroidJUnit4::class)
-@OptIn(ExperimentalFocus::class, ExperimentalTesting::class)
+@OptIn(ExperimentalFocus::class)
class OutlinedTextFieldTest {
private val ExpectedMinimumTextFieldHeight = 56.dp
private val ExpectedPadding = 16.dp
@@ -718,4 +717,4 @@
rule.clockTestRule.pauseClock()
rule.clockTestRule.advanceClock(time)
}
-}
+}
\ No newline at end of file
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/textfield/TextFieldTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/textfield/TextFieldTest.kt
index 8d337d5..c5a9e02 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/textfield/TextFieldTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/textfield/TextFieldTest.kt
@@ -57,7 +57,6 @@
import androidx.compose.ui.platform.TextInputServiceAmbient
import androidx.compose.ui.platform.ViewAmbient
import androidx.compose.ui.platform.testTag
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.compose.ui.test.assertHeightIsEqualTo
import androidx.compose.ui.test.captureToImage
import androidx.compose.ui.test.click
@@ -96,7 +95,7 @@
@MediumTest
@RunWith(AndroidJUnit4::class)
-@OptIn(ExperimentalFocus::class, ExperimentalTesting::class)
+@OptIn(ExperimentalFocus::class)
class TextFieldTest {
private val ExpectedMinimumTextFieldHeight = 56.dp
diff --git a/compose/ui/ui-test-junit4/api/current.txt b/compose/ui/ui-test-junit4/api/current.txt
index 33e8ce4..6c0c35c 100644
--- a/compose/ui/ui-test-junit4/api/current.txt
+++ b/compose/ui/ui-test-junit4/api/current.txt
@@ -2,7 +2,7 @@
package androidx.compose.ui.test.junit4 {
public final class AndroidAnimationClockTestRuleKt {
- method @androidx.compose.ui.test.ExperimentalTesting public static androidx.compose.ui.test.junit4.AnimationClockTestRule createAnimationClockRule();
+ method public static androidx.compose.ui.test.junit4.AnimationClockTestRule createAnimationClockRule();
}
public final class AndroidComposeTestRule<R extends org.junit.rules.TestRule, A extends androidx.activity.ComponentActivity> implements androidx.compose.ui.test.junit4.ComposeTestRule {
@@ -39,7 +39,7 @@
public final class AndroidSynchronizationKt {
}
- @androidx.compose.ui.test.ExperimentalTesting public interface AnimationClockTestRule extends org.junit.rules.TestRule {
+ public interface AnimationClockTestRule extends org.junit.rules.TestRule {
method public default void advanceClock(long milliseconds);
method public androidx.compose.ui.test.TestAnimationClock getClock();
method public boolean isPaused();
@@ -84,9 +84,9 @@
public final class ComposeIdlingResourceKt {
method public static void registerComposeWithEspresso();
- method @androidx.compose.ui.test.ExperimentalTesting public static void registerTestClock(androidx.compose.ui.test.TestAnimationClock clock);
+ method public static void registerTestClock(androidx.compose.ui.test.TestAnimationClock clock);
method public static void unregisterComposeFromEspresso();
- method @androidx.compose.ui.test.ExperimentalTesting public static void unregisterTestClock(androidx.compose.ui.test.TestAnimationClock clock);
+ method public static void unregisterTestClock(androidx.compose.ui.test.TestAnimationClock clock);
}
public final class ComposeNotIdleException extends java.lang.Throwable {
diff --git a/compose/ui/ui-test-junit4/api/public_plus_experimental_current.txt b/compose/ui/ui-test-junit4/api/public_plus_experimental_current.txt
index 33e8ce4..6c0c35c 100644
--- a/compose/ui/ui-test-junit4/api/public_plus_experimental_current.txt
+++ b/compose/ui/ui-test-junit4/api/public_plus_experimental_current.txt
@@ -2,7 +2,7 @@
package androidx.compose.ui.test.junit4 {
public final class AndroidAnimationClockTestRuleKt {
- method @androidx.compose.ui.test.ExperimentalTesting public static androidx.compose.ui.test.junit4.AnimationClockTestRule createAnimationClockRule();
+ method public static androidx.compose.ui.test.junit4.AnimationClockTestRule createAnimationClockRule();
}
public final class AndroidComposeTestRule<R extends org.junit.rules.TestRule, A extends androidx.activity.ComponentActivity> implements androidx.compose.ui.test.junit4.ComposeTestRule {
@@ -39,7 +39,7 @@
public final class AndroidSynchronizationKt {
}
- @androidx.compose.ui.test.ExperimentalTesting public interface AnimationClockTestRule extends org.junit.rules.TestRule {
+ public interface AnimationClockTestRule extends org.junit.rules.TestRule {
method public default void advanceClock(long milliseconds);
method public androidx.compose.ui.test.TestAnimationClock getClock();
method public boolean isPaused();
@@ -84,9 +84,9 @@
public final class ComposeIdlingResourceKt {
method public static void registerComposeWithEspresso();
- method @androidx.compose.ui.test.ExperimentalTesting public static void registerTestClock(androidx.compose.ui.test.TestAnimationClock clock);
+ method public static void registerTestClock(androidx.compose.ui.test.TestAnimationClock clock);
method public static void unregisterComposeFromEspresso();
- method @androidx.compose.ui.test.ExperimentalTesting public static void unregisterTestClock(androidx.compose.ui.test.TestAnimationClock clock);
+ method public static void unregisterTestClock(androidx.compose.ui.test.TestAnimationClock clock);
}
public final class ComposeNotIdleException extends java.lang.Throwable {
diff --git a/compose/ui/ui-test-junit4/api/restricted_current.txt b/compose/ui/ui-test-junit4/api/restricted_current.txt
index 33e8ce4..6c0c35c 100644
--- a/compose/ui/ui-test-junit4/api/restricted_current.txt
+++ b/compose/ui/ui-test-junit4/api/restricted_current.txt
@@ -2,7 +2,7 @@
package androidx.compose.ui.test.junit4 {
public final class AndroidAnimationClockTestRuleKt {
- method @androidx.compose.ui.test.ExperimentalTesting public static androidx.compose.ui.test.junit4.AnimationClockTestRule createAnimationClockRule();
+ method public static androidx.compose.ui.test.junit4.AnimationClockTestRule createAnimationClockRule();
}
public final class AndroidComposeTestRule<R extends org.junit.rules.TestRule, A extends androidx.activity.ComponentActivity> implements androidx.compose.ui.test.junit4.ComposeTestRule {
@@ -39,7 +39,7 @@
public final class AndroidSynchronizationKt {
}
- @androidx.compose.ui.test.ExperimentalTesting public interface AnimationClockTestRule extends org.junit.rules.TestRule {
+ public interface AnimationClockTestRule extends org.junit.rules.TestRule {
method public default void advanceClock(long milliseconds);
method public androidx.compose.ui.test.TestAnimationClock getClock();
method public boolean isPaused();
@@ -84,9 +84,9 @@
public final class ComposeIdlingResourceKt {
method public static void registerComposeWithEspresso();
- method @androidx.compose.ui.test.ExperimentalTesting public static void registerTestClock(androidx.compose.ui.test.TestAnimationClock clock);
+ method public static void registerTestClock(androidx.compose.ui.test.TestAnimationClock clock);
method public static void unregisterComposeFromEspresso();
- method @androidx.compose.ui.test.ExperimentalTesting public static void unregisterTestClock(androidx.compose.ui.test.TestAnimationClock clock);
+ method public static void unregisterTestClock(androidx.compose.ui.test.TestAnimationClock clock);
}
public final class ComposeNotIdleException extends java.lang.Throwable {
diff --git a/compose/ui/ui-test-junit4/src/androidAndroidTest/kotlin/androidx/compose/ui/test/junit4/TestAnimationClockTest.kt b/compose/ui/ui-test-junit4/src/androidAndroidTest/kotlin/androidx/compose/ui/test/junit4/TestAnimationClockTest.kt
index f3ff936..0acb995 100644
--- a/compose/ui/ui-test-junit4/src/androidAndroidTest/kotlin/androidx/compose/ui/test/junit4/TestAnimationClockTest.kt
+++ b/compose/ui/ui-test-junit4/src/androidAndroidTest/kotlin/androidx/compose/ui/test/junit4/TestAnimationClockTest.kt
@@ -38,7 +38,6 @@
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Color
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.compose.ui.test.junit4.android.ComposeIdlingResource
import androidx.test.espresso.Espresso.onIdle
import androidx.test.filters.LargeTest
@@ -49,7 +48,6 @@
import org.junit.Test
@LargeTest
-@OptIn(ExperimentalTesting::class)
class TestAnimationClockTest {
companion object {
diff --git a/compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/AndroidAnimationClockTestRule.kt b/compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/AndroidAnimationClockTestRule.kt
index f9ebc98..acae937 100644
--- a/compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/AndroidAnimationClockTestRule.kt
+++ b/compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/AndroidAnimationClockTestRule.kt
@@ -18,7 +18,6 @@
import androidx.compose.animation.core.InternalAnimationApi
import androidx.compose.animation.core.rootAnimationClockFactory
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.compose.ui.test.TestAnimationClock
import androidx.test.espresso.IdlingResource
import androidx.compose.ui.test.junit4.android.registerTestClock
@@ -43,7 +42,6 @@
* animations. Otherwise, built in steps that make sure the UI is stable when performing actions
* or assertions will fail to work.
*/
-@ExperimentalTesting
internal class AndroidAnimationClockTestRule : AnimationClockTestRule {
/** Backing property for [clock] */
@@ -101,6 +99,5 @@
}
}
-@ExperimentalTesting
actual fun createAnimationClockRule(): AnimationClockTestRule =
AndroidAnimationClockTestRule()
diff --git a/compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/AndroidComposeTestRule.kt b/compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/AndroidComposeTestRule.kt
index 538fafe..543c2c3 100644
--- a/compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/AndroidComposeTestRule.kt
+++ b/compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/AndroidComposeTestRule.kt
@@ -115,7 +115,6 @@
private val activityProvider: (R) -> A
) : ComposeTestRule {
- @ExperimentalTesting
override val clockTestRule: AnimationClockTestRule = AndroidAnimationClockTestRule()
internal var disposeContentHook: (() -> Unit)? = null
@@ -145,7 +144,7 @@
override fun apply(base: Statement, description: Description?): Statement {
@Suppress("NAME_SHADOWING")
- @OptIn(InternalTestingApi::class, ExperimentalTesting::class)
+ @OptIn(InternalTestingApi::class)
return RuleChain
.outerRule(clockTestRule)
.around { base, _ -> AndroidComposeStatement(base) }
diff --git a/compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/android/AndroidTestAnimationClock.kt b/compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/android/AndroidTestAnimationClock.kt
index be6439b..27a4c4a 100644
--- a/compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/android/AndroidTestAnimationClock.kt
+++ b/compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/android/AndroidTestAnimationClock.kt
@@ -19,7 +19,6 @@
import android.view.Choreographer
import androidx.compose.animation.core.AnimationClockObserver
import androidx.compose.animation.core.ManualAnimationClock
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.compose.ui.test.TestAnimationClock
import androidx.compose.ui.test.junit4.runOnUiThread
@@ -36,7 +35,6 @@
* @see advanceClock
* @see resumeClock
*/
-@ExperimentalTesting
internal class AndroidTestAnimationClock : TestAnimationClock {
/**
diff --git a/compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/android/ComposeIdlingResource.kt b/compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/android/ComposeIdlingResource.kt
index d792d7c..63e15a5 100644
--- a/compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/android/ComposeIdlingResource.kt
+++ b/compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/android/ComposeIdlingResource.kt
@@ -21,7 +21,6 @@
import androidx.compose.runtime.ExperimentalComposeApi
import androidx.compose.runtime.Recomposer
import androidx.compose.runtime.snapshots.Snapshot
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.IdlingResource
import androidx.compose.ui.test.TestAnimationClock
@@ -62,7 +61,6 @@
/**
* Registers the given [clock] so Espresso can await the animations subscribed to that clock.
*/
-@ExperimentalTesting
fun registerTestClock(clock: TestAnimationClock) {
ComposeIdlingResource.registerTestClock(clock)
}
@@ -70,7 +68,6 @@
/**
* Unregisters the [clock] that was registered with [registerTestClock].
*/
-@ExperimentalTesting
fun unregisterTestClock(clock: TestAnimationClock) {
ComposeIdlingResource.unregisterTestClock(clock)
}
@@ -89,7 +86,6 @@
private var isIdleCheckScheduled = false
- @OptIn(ExperimentalTesting::class)
private val clocks = mutableSetOf<TestAnimationClock>()
private val handler = Handler(Looper.getMainLooper())
@@ -167,21 +163,18 @@
compositionAwaiters.decrementAndGet()
}
- @OptIn(ExperimentalTesting::class)
internal fun registerTestClock(clock: TestAnimationClock) {
synchronized(clocks) {
clocks.add(clock)
}
}
- @OptIn(ExperimentalTesting::class)
internal fun unregisterTestClock(clock: TestAnimationClock) {
synchronized(clocks) {
clocks.remove(clock)
}
}
- @OptIn(ExperimentalTesting::class)
private fun areAllClocksIdle(): Boolean {
return synchronized(clocks) {
clocks.all { it.isIdle }
diff --git a/compose/ui/ui-test-junit4/src/desktopMain/kotlin/androidx/compose/ui/test/junit4/DesktopAnimationClockTestRule.kt b/compose/ui/ui-test-junit4/src/desktopMain/kotlin/androidx/compose/ui/test/junit4/DesktopAnimationClockTestRule.kt
index bacfaf2..f6b6814 100644
--- a/compose/ui/ui-test-junit4/src/desktopMain/kotlin/androidx/compose/ui/test/junit4/DesktopAnimationClockTestRule.kt
+++ b/compose/ui/ui-test-junit4/src/desktopMain/kotlin/androidx/compose/ui/test/junit4/DesktopAnimationClockTestRule.kt
@@ -18,12 +18,10 @@
import androidx.compose.animation.core.AnimationClockObserver
import androidx.compose.animation.core.InternalAnimationApi
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.compose.ui.test.TestAnimationClock
import org.junit.runner.Description
import org.junit.runners.model.Statement
-@ExperimentalTesting
internal class DesktopTestAnimationClock : TestAnimationClock {
override val isIdle: Boolean
get() = TODO("Not yet implemented")
@@ -52,7 +50,6 @@
}
}
-@ExperimentalTesting
internal class DesktopAnimationClockTestRule : AnimationClockTestRule {
override val clock: TestAnimationClock get() = DesktopTestAnimationClock()
@@ -89,6 +86,5 @@
}
}
-@ExperimentalTesting
actual fun createAnimationClockRule(): AnimationClockTestRule =
DesktopAnimationClockTestRule()
\ No newline at end of file
diff --git a/compose/ui/ui-test-junit4/src/desktopMain/kotlin/androidx/compose/ui/test/junit4/DesktopComposeTestRule.kt b/compose/ui/ui-test-junit4/src/desktopMain/kotlin/androidx/compose/ui/test/junit4/DesktopComposeTestRule.kt
index 73cdc85..7cb3269 100644
--- a/compose/ui/ui-test-junit4/src/desktopMain/kotlin/androidx/compose/ui/test/junit4/DesktopComposeTestRule.kt
+++ b/compose/ui/ui-test-junit4/src/desktopMain/kotlin/androidx/compose/ui/test/junit4/DesktopComposeTestRule.kt
@@ -62,7 +62,6 @@
var owners: DesktopOwners? = null
private var owner: DesktopOwner? = null
- @ExperimentalTesting
override val clockTestRule: AnimationClockTestRule = DesktopAnimationClockTestRule()
override val density: Density
diff --git a/compose/ui/ui-test-junit4/src/jvmMain/kotlin/androidx/compose/ui/test/junit4/AnimationClockTestRule.kt b/compose/ui/ui-test-junit4/src/jvmMain/kotlin/androidx/compose/ui/test/junit4/AnimationClockTestRule.kt
index c95edc0..1732d00 100644
--- a/compose/ui/ui-test-junit4/src/jvmMain/kotlin/androidx/compose/ui/test/junit4/AnimationClockTestRule.kt
+++ b/compose/ui/ui-test-junit4/src/jvmMain/kotlin/androidx/compose/ui/test/junit4/AnimationClockTestRule.kt
@@ -16,11 +16,9 @@
package androidx.compose.ui.test.junit4
-import androidx.compose.ui.test.ExperimentalTesting
import androidx.compose.ui.test.TestAnimationClock
import org.junit.rules.TestRule
-@ExperimentalTesting
interface AnimationClockTestRule : TestRule {
/**
* The ambient animation clock that is provided at the root of the composition tree.
@@ -48,5 +46,4 @@
fun advanceClock(milliseconds: Long) = clock.advanceClock(milliseconds)
}
-@ExperimentalTesting
expect fun createAnimationClockRule(): AnimationClockTestRule
\ No newline at end of file
diff --git a/compose/ui/ui-test-junit4/src/jvmMain/kotlin/androidx/compose/ui/test/junit4/ComposeTestRule.kt b/compose/ui/ui-test-junit4/src/jvmMain/kotlin/androidx/compose/ui/test/junit4/ComposeTestRule.kt
index 9fb0445..de8b3aa 100644
--- a/compose/ui/ui-test-junit4/src/jvmMain/kotlin/androidx/compose/ui/test/junit4/ComposeTestRule.kt
+++ b/compose/ui/ui-test-junit4/src/jvmMain/kotlin/androidx/compose/ui/test/junit4/ComposeTestRule.kt
@@ -45,7 +45,6 @@
/**
* A test rule that allows you to control the animation clock
*/
- @OptIn(ExperimentalTesting::class)
val clockTestRule: AnimationClockTestRule
/**
diff --git a/compose/ui/ui-test/api/current.txt b/compose/ui/ui-test/api/current.txt
index 051fd35..a98d1d0 100644
--- a/compose/ui/ui-test/api/current.txt
+++ b/compose/ui/ui-test/api/current.txt
@@ -272,7 +272,7 @@
public final class SemanticsSelectorKt {
}
- @androidx.compose.ui.test.ExperimentalTesting public interface TestAnimationClock extends androidx.compose.animation.core.AnimationClockObservable {
+ public interface TestAnimationClock extends androidx.compose.animation.core.AnimationClockObservable {
method public void advanceClock(long milliseconds);
method public boolean isIdle();
method public boolean isPaused();
diff --git a/compose/ui/ui-test/api/public_plus_experimental_current.txt b/compose/ui/ui-test/api/public_plus_experimental_current.txt
index 051fd35..a98d1d0 100644
--- a/compose/ui/ui-test/api/public_plus_experimental_current.txt
+++ b/compose/ui/ui-test/api/public_plus_experimental_current.txt
@@ -272,7 +272,7 @@
public final class SemanticsSelectorKt {
}
- @androidx.compose.ui.test.ExperimentalTesting public interface TestAnimationClock extends androidx.compose.animation.core.AnimationClockObservable {
+ public interface TestAnimationClock extends androidx.compose.animation.core.AnimationClockObservable {
method public void advanceClock(long milliseconds);
method public boolean isIdle();
method public boolean isPaused();
diff --git a/compose/ui/ui-test/api/restricted_current.txt b/compose/ui/ui-test/api/restricted_current.txt
index 051fd35..a98d1d0 100644
--- a/compose/ui/ui-test/api/restricted_current.txt
+++ b/compose/ui/ui-test/api/restricted_current.txt
@@ -272,7 +272,7 @@
public final class SemanticsSelectorKt {
}
- @androidx.compose.ui.test.ExperimentalTesting public interface TestAnimationClock extends androidx.compose.animation.core.AnimationClockObservable {
+ public interface TestAnimationClock extends androidx.compose.animation.core.AnimationClockObservable {
method public void advanceClock(long milliseconds);
method public boolean isIdle();
method public boolean isPaused();
diff --git a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/AnimationClocks.kt b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/AnimationClocks.kt
index d2b0062..11ea390 100644
--- a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/AnimationClocks.kt
+++ b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/AnimationClocks.kt
@@ -32,7 +32,6 @@
* Use [pauseClock] to switch from automatic ticking to manual ticking, [resumeClock] to switch
* from manual to automatic with; and manually tick the clock with [advanceClock].
*/
-@ExperimentalTesting
interface TestAnimationClock : AnimationClockObservable {
/**
* Whether the clock is idle or not. An idle clock is one that is not driving animations,