From dcd8b70f708f786857aa0b64391e2451e88a5b7b Mon Sep 17 00:00:00 2001 From: Shagen Ogandzhanian Date: Mon, 30 Aug 2021 23:38:07 +0200 Subject: [PATCH] [web] [tests] Use waitForRecompositionComplete instead of waitForAnimationFrame in add/remove benchmark tests --- web/benchmark-core/src/jsTest/kotlin/BenchmarkTests.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/benchmark-core/src/jsTest/kotlin/BenchmarkTests.kt b/web/benchmark-core/src/jsTest/kotlin/BenchmarkTests.kt index db3b0d513b..870db91b59 100644 --- a/web/benchmark-core/src/jsTest/kotlin/BenchmarkTests.kt +++ b/web/benchmark-core/src/jsTest/kotlin/BenchmarkTests.kt @@ -49,7 +49,7 @@ class BenchmarkTests { println("#$name[$browserName]:$avgMs;") } - suspend private fun TestScope.addNItems(n: Int): Duration { + private suspend fun TestScope.addNItems(n: Int): Duration { val addItemsCount = mutableStateOf(0) composition { @@ -60,7 +60,7 @@ class BenchmarkTests { val duration = measureTime { addItemsCount.value = n - waitForAnimationFrame() + waitForRecompositionComplete() } assertEquals(n, root.childElementCount) @@ -100,7 +100,7 @@ class BenchmarkTests { val duration = measureTime { addItemsCount.value = 0 - waitForAnimationFrame() + waitForRecompositionComplete() } assertEquals(0, root.childElementCount)