Skip to content

Commit

Permalink
Add k/wasm target to composable-test-cases (#4371)
Browse files Browse the repository at this point in the history
  • Loading branch information
eymar authored Feb 26, 2024
1 parent 2ca9e3c commit fe77886
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ val Project.isMingwX64Enabled: Boolean
fun KotlinMultiplatformExtension.configureTargets() {
jvm("desktop")
configureJsTargets()
wasmJs {
browser()
}
ios()
iosArm64()
iosSimulatorArm64()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ kotlin {
val commonMain by getting {
dependencies {
implementation(compose.runtime)
implementation(libs.kotlinx.datetime)
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import androidx.compose.runtime.*
import androidx.compose.runtime.snapshots.ObserverHandle
import androidx.compose.runtime.snapshots.Snapshot
import kotlinx.coroutines.*
import kotlinx.datetime.Clock
import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine
Expand Down Expand Up @@ -76,11 +75,14 @@ private object GlobalSnapshotManager {
private class MonotonicClockImpl : MonotonicFrameClock {

private val NANOS_PER_MILLI = 1_000_000

private var i = 0L

override suspend fun <R> withFrameNanos(
onFrame: (Long) -> R
): R = suspendCoroutine { continuation ->
val now = Clock.System.now()
val currentNanos = now.toEpochMilliseconds() * NANOS_PER_MILLI + now.nanosecondsOfSecond
val now = ++i
val currentNanos = now * NANOS_PER_MILLI
val result = onFrame(currentNanos)
continuation.resume(result)
}
Expand Down
8 changes: 4 additions & 4 deletions compose/integrations/composable-test-cases/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
org.gradle.jvmargs=-Xmx2048M -XX:MaxMetaspaceSize=512m
org.gradle.jvmargs=-Xmx4096M -XX:MaxMetaspaceSize=512m
kotlin.code.style=official
android.useAndroidX=true
kotlin.version=1.9.22
agp.version=7.3.0
compose.version=1.6.0-dev1357
compose.version=1.6.0-rc03

kotlinx.coroutines.version=1.8.0-RC
kotlinx.coroutines.version=1.8.0

#empty by default - a default version will be used
#compose.kotlinCompilerPluginVersion=23.12.18
compose.kotlinCompilerPluginVersion=1.5.8-beta01
compose.kotlinCompilerPluginVersion=1.5.8.1

# default|failingJs - see enum class CasesToRun
tests.casesToRun=default
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
actual val Abc.composableIntVal: Int
get() = 100

0 comments on commit fe77886

Please sign in to comment.