|
|
|
@ -1,36 +1,10 @@
|
|
|
|
|
import androidx.compose.runtime.Composable |
|
|
|
|
import androidx.compose.runtime.Composition |
|
|
|
|
import org.jetbrains.compose.web.css.* |
|
|
|
|
import org.jetbrains.compose.web.css.selectors.* |
|
|
|
|
import org.jetbrains.compose.web.attributes.* |
|
|
|
|
import org.jetbrains.compose.web.dom.* |
|
|
|
|
import org.jetbrains.compose.web.* |
|
|
|
|
import kotlinx.browser.document |
|
|
|
|
import kotlinx.browser.window |
|
|
|
|
import kotlinx.coroutines.CoroutineScope |
|
|
|
|
import kotlinx.coroutines.MainScope |
|
|
|
|
import kotlinx.coroutines.promise |
|
|
|
|
import kotlinx.dom.clear |
|
|
|
|
import org.w3c.dom.HTMLElement |
|
|
|
|
import org.w3c.dom.MutationObserver |
|
|
|
|
import org.w3c.dom.MutationObserverInit |
|
|
|
|
import kotlin.coroutines.resume |
|
|
|
|
import kotlin.coroutines.suspendCoroutine |
|
|
|
|
|
|
|
|
|
/* Currently, the recompositionRunner relies on AnimationFrame to run the recomposition and |
|
|
|
|
applyChanges. Therefore we can use this method after updating the state and before making |
|
|
|
|
assertions. |
|
|
|
|
|
|
|
|
|
If tests get broken, then DefaultMonotonicFrameClock need to be checked if it still |
|
|
|
|
uses window.requestAnimationFrame */ |
|
|
|
|
internal suspend fun waitForAnimationFrame() { |
|
|
|
|
suspendCoroutine<Unit> { continuation -> |
|
|
|
|
window.requestAnimationFrame { |
|
|
|
|
continuation.resume(Unit) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private object MutationObserverOptions : MutationObserverInit { |
|
|
|
|
override var childList: Boolean? = true |
|
|
|
|
override var attributes: Boolean? = true |
|
|
|
|