Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ object JetBrainsPublication {
supportedPlatforms = ComposePlatforms.SKIKO_SUPPORT,
),
ComposeComponent(":compose:ui:ui-graphics"),
ComposeComponent(":compose:ui:ui-skiko"),
ComposeComponent(":compose:ui:ui-test"),
ComposeComponent(
":compose:ui:ui-test-junit4",
Expand Down
3 changes: 3 additions & 0 deletions compose/foundation/foundation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ androidXMultiplatform {
dependencies {
// TODO(https://youtrack.jetbrains.com/issue/CMP-219) Remove API
api(libs.skiko)
// TODO(https://youtrack.jetbrains.com/issue/CMP-10338): Remove direct dependency
implementation(project(":compose:ui:ui-skiko"))

implementation(libs.atomicFu)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.platform.FrameRecomposer
import androidx.compose.ui.platform.LocalViewConfiguration
import androidx.compose.ui.platform.ViewConfiguration
import androidx.compose.ui.platform.registerSkikoComposeImplementation
import androidx.compose.ui.scene.CanvasLayersComposeScene
import androidx.compose.ui.test.ExperimentalTestApi
import androidx.compose.ui.test.runSkikoComposeUiTest
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.IntSize
import androidx.compose.ui.unit.dp
import androidx.compose.ui.use
import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runTest
Expand All @@ -48,6 +50,19 @@ import kotlinx.coroutines.test.runTest
@OptIn(ExperimentalFoundationApi::class, InternalComposeUiApi::class)
class OnClickTest {

@BeforeTest
fun registerSkikoBackend() {
registerSkikoComposeImplementation()
}

// TODO: re-enable per-test cleanup once tests that register the backend asynchronously
// (e.g. AWT ComposePanel/ComposeWindow via ComposeContainer on the EDT) no longer rely on
// the registration persisting across tests.
// @AfterTest
// fun clearSkikoBackend() {
// clearSkikoComposeImplementation()
// }

private fun testClick(
pointerMatcher: PointerMatcher,
button: PointerButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import androidx.compose.foundation.isEqualTo
import androidx.compose.foundation.isTrue
import androidx.compose.foundation.text.InternalFoundationTextApi
import androidx.compose.foundation.text.TextDelegate
import androidx.compose.ui.InternalComposeUiApi
import androidx.compose.ui.platform.registerSkikoComposeImplementation
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.TextStyle
Expand All @@ -32,12 +34,26 @@ import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.sp
import kotlin.math.roundToInt
import kotlin.test.BeforeTest
import kotlin.test.Ignore
import kotlin.test.Test

@OptIn(InternalFoundationTextApi::class)
@OptIn(InternalFoundationTextApi::class, InternalComposeUiApi::class)
class TextDelegateIntegrationTest {

@BeforeTest
fun registerSkikoBackend() {
registerSkikoComposeImplementation()
}

// TODO: re-enable per-test cleanup once tests that register the backend asynchronously
// (e.g. AWT ComposePanel/ComposeWindow via ComposeContainer on the EDT) no longer rely on
// the registration persisting across tests.
// @AfterTest
// fun clearSkikoBackend() {
// clearSkikoComposeImplementation()
// }

@Test
@Ignore // TODO: test is failing
fun minIntrinsicWidth_getter() = with(Density(1f, 1f)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

package androidx.compose.foundation.shape

import androidx.compose.ui.InternalComposeUiApi
import androidx.compose.ui.platform.registerSkikoComposeImplementation
import kotlin.test.BeforeTest
import androidx.compose.foundation.assertThat
import androidx.compose.foundation.isEqualTo
import androidx.compose.foundation.isFalse
Expand All @@ -31,8 +34,22 @@ import androidx.compose.ui.unit.dp
import kotlin.test.Test
import kotlin.test.assertEquals

@OptIn(InternalComposeUiApi::class)
class AbsoluteCutCornerShapeTest {

@BeforeTest
fun registerSkikoBackend() {
registerSkikoComposeImplementation()
}

// TODO: re-enable per-test cleanup once tests that register the backend asynchronously
// (e.g. AWT ComposePanel/ComposeWindow via ComposeContainer on the EDT) no longer rely on
// the registration persisting across tests.
// @AfterTest
// fun clearSkikoBackend() {
// clearSkikoComposeImplementation()
// }

private var layoutDirection: LayoutDirection? = null

private val testParameters = arrayOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

package androidx.compose.foundation.shape

import androidx.compose.ui.InternalComposeUiApi
import androidx.compose.ui.platform.registerSkikoComposeImplementation
import kotlin.test.BeforeTest
import androidx.compose.foundation.assertThat
import androidx.compose.foundation.isEqualTo
import androidx.compose.foundation.isFalse
Expand All @@ -32,8 +35,22 @@ import androidx.compose.ui.unit.dp
import kotlin.test.Test
import kotlin.test.assertEquals

@OptIn(InternalComposeUiApi::class)
class AbsoluteRoundedCornerShapeTest {

@BeforeTest
fun registerSkikoBackend() {
registerSkikoComposeImplementation()
}

// TODO: re-enable per-test cleanup once tests that register the backend asynchronously
// (e.g. AWT ComposePanel/ComposeWindow via ComposeContainer on the EDT) no longer rely on
// the registration persisting across tests.
// @AfterTest
// fun clearSkikoBackend() {
// clearSkikoComposeImplementation()
// }

private var layoutDirection: LayoutDirection? = null

private val testParameters = arrayOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

package androidx.compose.foundation.shape

import androidx.compose.ui.InternalComposeUiApi
import androidx.compose.ui.platform.registerSkikoComposeImplementation
import kotlin.test.BeforeTest
import androidx.compose.foundation.assertThat
import androidx.compose.foundation.isEqualTo
import androidx.compose.foundation.isFalse
Expand All @@ -33,8 +36,22 @@ import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertTrue

@OptIn(InternalComposeUiApi::class)
class CutCornerShapeTest {

@BeforeTest
fun registerSkikoBackend() {
registerSkikoComposeImplementation()
}

// TODO: re-enable per-test cleanup once tests that register the backend asynchronously
// (e.g. AWT ComposePanel/ComposeWindow via ComposeContainer on the EDT) no longer rely on
// the registration persisting across tests.
// @AfterTest
// fun clearSkikoBackend() {
// clearSkikoComposeImplementation()
// }

private val density = Density(2f)
private val size = Size(100.0f, 150.0f)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

package androidx.compose.foundation.shape

import androidx.compose.ui.InternalComposeUiApi
import androidx.compose.ui.platform.registerSkikoComposeImplementation
import kotlin.test.BeforeTest
import androidx.compose.foundation.assertThat
import androidx.compose.foundation.isEqualTo
import androidx.compose.foundation.isFalse
Expand All @@ -32,8 +35,22 @@ import androidx.compose.ui.unit.dp
import kotlin.test.Test
import kotlin.test.assertEquals

@OptIn(InternalComposeUiApi::class)
class RoundedCornerShapeTest {

@BeforeTest
fun registerSkikoBackend() {
registerSkikoComposeImplementation()
}

// TODO: re-enable per-test cleanup once tests that register the backend asynchronously
// (e.g. AWT ComposePanel/ComposeWindow via ComposeContainer on the EDT) no longer rely on
// the registration persisting across tests.
// @AfterTest
// fun clearSkikoBackend() {
// clearSkikoComposeImplementation()
// }

private val density = Density(2f)
private val size = Size(100.0f, 150.0f)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

package androidx.compose.foundation.text

import androidx.compose.ui.InternalComposeUiApi
import androidx.compose.ui.platform.registerSkikoComposeImplementation
import kotlin.test.BeforeTest
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.MultiParagraph
import androidx.compose.ui.text.TextLayoutInput
Expand All @@ -34,7 +37,21 @@ import kotlin.test.Test
import kotlin.test.assertEquals
import kotlinx.test.IgnoreWasmTarget

@OptIn(InternalComposeUiApi::class)
class CupertinoTextFieldDelegateTest {

@BeforeTest
fun registerSkikoBackend() {
registerSkikoComposeImplementation()
}

// TODO: re-enable per-test cleanup once tests that register the backend asynchronously
// (e.g. AWT ComposePanel/ComposeWindow via ComposeContainer on the EDT) no longer rely on
// the registration persisting across tests.
// @AfterTest
// fun clearSkikoBackend() {
// clearSkikoComposeImplementation()
// }
private val sampleText =
"aaaa bbb cccc dd e fffffffff?????????!!!!!!! ...\n" + "ggggggg tttt\n" +
"Family emoji: \uD83D\uDC68\u200D\uD83D\uDC69\u200D\uD83D\uDC67\u200D\uD83D\uDC66\uD83D\uDC68\u200D\uD83D\uDC69\u200D\uD83D\uDC67\u200D\uD83D\uDC66, and some text at the end\n" +
Expand Down
1 change: 1 addition & 0 deletions compose/mpp/demo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ kotlin {
implementation(project(":compose:ui:ui-graphics"))
implementation(project(":compose:ui:ui-text"))
implementation(project(":compose:ui:ui-backhandler"))
implementation(project(":compose:ui:ui-skiko"))
implementation(project(":lifecycle:lifecycle-common"))
implementation(project(":lifecycle:lifecycle-runtime"))
implementation(project(":lifecycle:lifecycle-runtime-compose"))
Expand Down
Loading
Loading