Fixed test
diff --git a/sample/src/androidTest/java/com/airbnb/lottie/samples/LottieTest.kt b/sample/src/androidTest/java/com/airbnb/lottie/samples/LottieTest.kt
index 7426b32..5395a62 100644
--- a/sample/src/androidTest/java/com/airbnb/lottie/samples/LottieTest.kt
+++ b/sample/src/androidTest/java/com/airbnb/lottie/samples/LottieTest.kt
@@ -102,18 +102,18 @@
fun testAll() = runBlocking {
withTimeout(TimeUnit.MINUTES.toMillis(45)) {
testColorStateListColorFilter()
-// testFailure()
-// snapshotFrameBoundaries()
-// snapshotScaleTypes()
-// testDynamicProperties()
-// testMarkers()
-// testAssets()
-// testText()
-// testPartialFrameProgress()
-// testProdAnimations()
-// testNightMode()
-// testApplyOpacityToLayer()
-// testOutlineMasksAndMattes()
+ testFailure()
+ snapshotFrameBoundaries()
+ snapshotScaleTypes()
+ testDynamicProperties()
+ testMarkers()
+ testAssets()
+ testText()
+ testPartialFrameProgress()
+ testProdAnimations()
+ testNightMode()
+ testApplyOpacityToLayer()
+ testOutlineMasksAndMattes()
snapshotter.finalizeReportAndUpload()
}
}
@@ -1002,14 +1002,17 @@
log("Testing color filter")
val context = ContextThemeWrapper(application, R.style.AppTheme)
val binding = TestColorFilterBinding.inflate(LayoutInflater.from(context))
- val composition = LottieCompositionFactory.fromRawResSync(application, R.raw.solid).value!!
+ withTimeout(10_000) {
+ while (binding.animationView.composition == null) {
+ delay(50)
+ }
+ }
val bitmap = bitmapPool.acquire(1000, 1000)
val canvas = Canvas(bitmap)
val spec = View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY)
binding.root.measure(spec, spec)
binding.root.layout(0, 0, 1000, 1000)
- binding.animationView.setComposition(composition)
canvas.drawColor(Color.BLACK, PorterDuff.Mode.CLEAR)
withContext(Dispatchers.Main) {
binding.root.draw(canvas)
diff --git a/sample/src/main/res/color/test_color_filter.xml b/sample/src/main/res/color/test_color_filter.xml
index c7934e6..cc68be3 100644
--- a/sample/src/main/res/color/test_color_filter.xml
+++ b/sample/src/main/res/color/test_color_filter.xml
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="?attr/colorPrimary" />
+ <item android:color="?attr/colorAccent" />
</selector>
\ No newline at end of file
diff --git a/sample/src/main/res/raw/solid.json b/sample/src/main/res/raw/solid.json
index fd9ce34..af39049 100644
--- a/sample/src/main/res/raw/solid.json
+++ b/sample/src/main/res/raw/solid.json
@@ -1 +1 @@
-{"v":"5.7.4","fr":29.9700012207031,"ip":0,"op":900.000036657751,"w":200,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":1,"nm":"Red Solid 1","sr":1,"ks":{"p":{"a":0,"k":[100,100,0],"ix":2,"l":2},"a":{"a":0,"k":[100,100,0],"ix":1,"l":2}},"ao":0,"sw":200,"sh":200,"sc":"#f30000","ip":0,"op":900.000036657751,"st":0,"bm":0}],"markers":[]}
\ No newline at end of file
+{"v":"5.7.4","fr":29.9700012207031,"ip":0,"op":900.000036657751,"w":200,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":1,"nm":"Red Solid 1","sr":1,"ks":{"p":{"a":0,"k":[100,100,0],"ix":2,"l":2},"a":{"a":0,"k":[100,100,0],"ix":1,"l":2}},"ao":0,"sw":200,"sh":200,"sc":"#0000ff","ip":0,"op":900.000036657751,"st":0,"bm":0}],"markers":[]}
\ No newline at end of file