Skip to content

Commit 7ec3e07

Browse files
committed
Revert "Disable Failing Windows tests"
This reverts commit a5b43ea.
1 parent 518a6e4 commit 7ec3e07

13 files changed

Lines changed: 43 additions & 158 deletions

compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/ComposeSceneTest.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ import kotlinx.coroutines.runBlocking
105105
import kotlinx.coroutines.withContext
106106
import org.jetbrains.skia.Surface
107107
import org.junit.Assert.assertFalse
108-
import org.junit.Assume.assumeTrue
109108
import org.junit.Ignore
110109
import org.junit.Rule
111110
import org.junit.Test
@@ -839,9 +838,6 @@ class ComposeSceneTest {
839838

840839
@Test
841840
fun sendApplyNotificationsFromNonUiThreadDoesntDeadlock() = runApplicationTest {
842-
// TODO Fix failing
843-
assumeTrue(!isWindows)
844-
845841
// https://youtrack.jetbrains.com/issue/CMP-7838
846842
var value by mutableStateOf(0)
847843
val derivedValue by derivedStateOf {

compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/awt/ComposeDialogTest.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import androidx.compose.ui.Modifier
3333
import androidx.compose.ui.graphics.Color
3434
import androidx.compose.ui.input.pointer.PointerEventType
3535
import androidx.compose.ui.input.pointer.pointerInput
36-
import androidx.compose.ui.isWindows
3736
import androidx.compose.ui.layout.layout
3837
import androidx.compose.ui.sendMouseEvent
3938
import androidx.compose.ui.sendMousePress
@@ -62,7 +61,6 @@ import org.jetbrains.skiko.MainUIDispatcher
6261
import org.jetbrains.skiko.OS
6362
import org.jetbrains.skiko.SkiaLayerAnalytics
6463
import org.junit.Assume
65-
import org.junit.Assume.assumeTrue
6664
import org.junit.Rule
6765
import org.junit.Test
6866
import org.junit.rules.Timeout
@@ -375,9 +373,6 @@ class ComposeDialogTest {
375373

376374
@Test
377375
fun `ComposeDialog with popup prefSize`() = runApplicationTest {
378-
// TODO Fix failing
379-
assumeTrue(!isWindows)
380-
381376
val dialog = ComposeDialog().apply {
382377
setContent {
383378
Box(Modifier.size(100.dp))

compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/awt/ComposePanelTest.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ import androidx.compose.ui.input.key.KeyEvent
5252
import androidx.compose.ui.input.key.onKeyEvent
5353
import androidx.compose.ui.input.pointer.PointerEventType
5454
import androidx.compose.ui.input.pointer.onPointerEvent
55-
import androidx.compose.ui.isWindows
5655
import androidx.compose.ui.layout.onGloballyPositioned
5756
import androidx.compose.ui.platform.testTag
5857
import androidx.compose.ui.sendCharTypedEvents
@@ -100,7 +99,6 @@ import org.jetbrains.skiko.MainUIDispatcher
10099
import org.jetbrains.skiko.OS
101100
import org.jetbrains.skiko.SkiaLayerAnalytics
102101
import org.junit.Assume.assumeFalse
103-
import org.junit.Assume.assumeTrue
104102
import org.junit.Rule
105103
import org.junit.Test
106104
import org.junit.rules.Timeout
@@ -913,9 +911,6 @@ class ComposePanelTest {
913911

914912
@Test
915913
fun `ComposePanel draws background correctly`() = runApplicationTest {
916-
// TODO Fix failing
917-
assumeTrue(!isWindows)
918-
919914
// Show a canvas and a `ComposePanel` with the same background and compare the two colors.
920915
// Simply comparing to the set color doesn't work because Robot returns the color after
921916
// the OS transforms it to the screen color space (which doesn't seem accessible from

compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/awt/SwingPanelTest.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import androidx.compose.runtime.mutableFloatStateOf
3030
import androidx.compose.runtime.setValue
3131
import androidx.compose.ui.Alignment
3232
import androidx.compose.ui.Modifier
33-
import androidx.compose.ui.isWindows
3433
import androidx.compose.ui.layout.LayoutBoundsHolder
3534
import androidx.compose.ui.layout.layoutBounds
3635
import androidx.compose.ui.platform.LocalDensity
@@ -61,7 +60,6 @@ import kotlin.test.Test
6160
import kotlin.test.assertEquals
6261
import kotlin.test.assertIs
6362
import kotlin.test.assertTrue
64-
import org.junit.Assume.assumeTrue
6563

6664
class SwingPanelTest {
6765
/**
@@ -221,9 +219,6 @@ class SwingPanelTest {
221219

222220
@Test
223221
fun swingPanelRespondsToDensityChange() = runApplicationTest {
224-
// TODO Fix failing
225-
assumeTrue(!isWindows)
226-
227222
val swingComponent = object: JComponent() {
228223
override fun paint(g: Graphics) {
229224
g.color = java.awt.Color.RED

compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/window/ApplicationTest.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import androidx.compose.ui.geometry.Offset
3333
import androidx.compose.ui.geometry.isSpecified
3434
import androidx.compose.ui.graphics.Color
3535
import androidx.compose.ui.isLinux
36-
import androidx.compose.ui.isWindows
3736
import androidx.compose.ui.layout.onGloballyPositioned
3837
import androidx.compose.ui.layout.onPlaced
3938
import androidx.compose.ui.layout.positionOnScreen
@@ -268,9 +267,6 @@ class ApplicationTest {
268267

269268
@Test
270269
fun `onGloballyPositioned is not called repeatedly with same position on screen`() = runApplicationTest(useDelay = true) {
271-
// TODO Fix failing
272-
assumeTrue(!isWindows)
273-
274270
lateinit var window: ComposeWindow
275271
val positionsOnScreen = mutableListOf<Offset>()
276272
launchTestApplication {

compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/window/DesktopPopupTest.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import androidx.compose.ui.graphics.Color
3939
import androidx.compose.ui.input.key.Key
4040
import androidx.compose.ui.input.key.KeyEvent
4141
import androidx.compose.ui.input.key.KeyEventType
42-
import androidx.compose.ui.isWindows
4342
import androidx.compose.ui.layout.Layout
4443
import androidx.compose.ui.layout.LayoutCoordinates
4544
import androidx.compose.ui.layout.onGloballyPositioned
@@ -63,7 +62,6 @@ import javax.swing.JFrame
6362
import kotlin.test.assertEquals
6463
import kotlin.test.assertNotNull
6564
import kotlin.test.assertTrue
66-
import org.junit.Assume.assumeTrue
6765
import org.junit.Rule
6866
import org.junit.Test
6967

@@ -386,14 +384,10 @@ class DesktopPopupTest {
386384
}
387385

388386
@Test
389-
fun popup_reportsCorrectPositionInWindow_onWindowLayerType() {
390-
// TODO Fix failing
391-
assumeTrue(!isWindows)
392-
387+
fun popup_reportsCorrectPositionInWindow_onWindowLayerType() =
393388
ComposeFeatureFlags.layerType.withOverride(LayerType.OnWindow) {
394389
popup_reportsCorrectPositionInWindow()
395390
}
396-
}
397391

398392
private fun popup_reportsCorrectPositionInWindow() = runApplicationTest {
399393
val popupOffset = IntOffset(40, 70)

compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/window/DialogWindowTest.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import androidx.compose.ui.input.key.Key
4343
import androidx.compose.ui.input.key.key
4444
import androidx.compose.ui.input.key.onKeyEvent
4545
import androidx.compose.ui.input.key.onPreviewKeyEvent
46-
import androidx.compose.ui.isWindows
4746
import androidx.compose.ui.platform.LocalLayoutDirection
4847
import androidx.compose.ui.sendKeyEvent
4948
import androidx.compose.ui.test.ExperimentalTestApi
@@ -72,7 +71,6 @@ import kotlin.test.assertEquals
7271
import kotlin.test.assertNotNull
7372
import kotlin.time.Duration.Companion.seconds
7473
import kotlinx.coroutines.delay
75-
import org.junit.Assume.assumeTrue
7674

7775
class DialogWindowTest {
7876
@Test
@@ -586,9 +584,6 @@ class DialogWindowTest {
586584

587585
@Test(timeout = 30000)
588586
fun `should draw before dialog is visible`() {
589-
// TODO Fix failing
590-
assumeTrue(!isWindows)
591-
592587
val windowSize = DpSize(400.dp, 300.dp)
593588
testDrawingBeforeDialogIsVisible(
594589
dialogState = DialogState(size = windowSize),
@@ -729,9 +724,6 @@ class DialogWindowTest {
729724

730725
@Test
731726
fun `dialog does not flash background when closed`() = runApplicationTest {
732-
// TODO Fix failing
733-
assumeTrue(!isWindows)
734-
735727
lateinit var window: Window
736728
lateinit var dialog: Dialog
737729
var showDialog by mutableStateOf(false)

compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/window/WindowTest.kt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import androidx.compose.ui.awt.SwingWindow
4141
import androidx.compose.ui.background
4242
import androidx.compose.ui.graphics.Color
4343
import androidx.compose.ui.isLinux
44-
import androidx.compose.ui.isWindows
4544
import androidx.compose.ui.layout.Layout
4645
import androidx.compose.ui.platform.LocalDensity
4746
import androidx.compose.ui.platform.LocalLayoutDirection
@@ -79,7 +78,6 @@ import kotlinx.coroutines.plus
7978
import kotlinx.coroutines.runBlocking
8079
import org.jetbrains.skiko.MainUIDispatcher
8180
import org.junit.Assume.assumeFalse
82-
import org.junit.Assume.assumeTrue
8381
import org.junit.Ignore
8482

8583
class WindowTest {
@@ -507,9 +505,6 @@ class WindowTest {
507505

508506
@Test(timeout = 30000)
509507
fun `should draw before window is visible`() {
510-
// TODO Fix failing
511-
assumeTrue(!isWindows)
512-
513508
val windowSize = DpSize(400.dp, 300.dp)
514509
testDrawingBeforeWindowIsVisible(
515510
windowState = WindowState(size = windowSize),
@@ -633,9 +628,6 @@ class WindowTest {
633628

634629
@Test
635630
fun `showing a window should measure content specified size`() = runApplicationTest {
636-
// TODO Fix failing
637-
assumeTrue(!isWindows)
638-
639631
// TODO fix on Linux https://github.com/JetBrains/compose-multiplatform/issues/1297
640632
assumeFalse(isLinux)
641633
val constraintsList = mutableListOf<Constraints>()
@@ -796,9 +788,6 @@ class WindowTest {
796788

797789
@Test
798790
fun `window does not flash background when closed`() = runApplicationTest {
799-
// TODO Fix failing
800-
assumeTrue(!isWindows)
801-
802791
lateinit var outerWindow: Window
803792
lateinit var innerWindow: Window
804793
var showInnerWindow by mutableStateOf(false)

compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/window/WindowTypingLocationTest.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@
1717
package androidx.compose.ui.window
1818

1919
import androidx.compose.ui.focusedInputMethodRequests
20-
import androidx.compose.ui.isWindows
2120
import androidx.compose.ui.sendCharTypedEvents
2221
import java.awt.Rectangle
23-
import org.junit.Assume.assumeTrue
2422
import org.junit.experimental.theories.Theories
2523
import org.junit.experimental.theories.Theory
2624
import org.junit.runner.RunWith
@@ -34,12 +32,6 @@ class WindowTypingLocationTest: BaseWindowTextFieldTest() {
3432
textFieldKind = textFieldKind,
3533
name = "input methods text location going right when typing"
3634
) {
37-
// TODO Fix failing
38-
if (isWindows) {
39-
println("Skipped")
40-
return@runTextFieldTest
41-
}
42-
4335
val location0 = window.focusedInputMethodRequests()!!.getTextLocation(null)
4436

4537
window.sendCharTypedEvents('a')

compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/window/v2/DialogWindowV2StateTest.kt

Lines changed: 31 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import androidx.compose.ui.awt.ComposeDialog
3232
import androidx.compose.ui.awt.ComposeWindow
3333
import androidx.compose.ui.isLinux
3434
import androidx.compose.ui.isMacOs
35-
import androidx.compose.ui.isWindows
3635
import androidx.compose.ui.layout.Layout
3736
import androidx.compose.ui.toDpSize
3837
import androidx.compose.ui.unit.DpOffset
@@ -382,9 +381,6 @@ class DialogWindowV2StateTest {
382381

383382
@Test
384383
fun `set dialog preferred height`() = runApplicationTest(useDelay = isLinux) {
385-
// TODO Fix failing
386-
assumeTrue(!isWindows)
387-
388384
assumeTrue(!isLinux) // Flaky on our CI
389385

390386
lateinit var dialog: ComposeDialog
@@ -418,9 +414,6 @@ class DialogWindowV2StateTest {
418414

419415
@Test
420416
fun `set dialog preferred width`() = runApplicationTest {
421-
// TODO Fix failing
422-
assumeTrue(!isWindows)
423-
424417
assumeTrue(!isLinux) // Flaky on our CI
425418

426419
lateinit var dialog: ComposeDialog
@@ -453,9 +446,6 @@ class DialogWindowV2StateTest {
453446

454447
@Test
455448
fun `set unconstrained dialog size by its content`() = runApplicationTest {
456-
// TODO Fix failing
457-
assumeTrue(!isWindows)
458-
459449
assumeTrue(!isLinux) // Flaky on our CI
460450

461451
lateinit var dialog: ComposeDialog
@@ -811,56 +801,41 @@ class DialogWindowV2StateTest {
811801
}
812802

813803
@Test
814-
fun dialogPreferredWidth() {
815-
// TODO Fix failing
816-
assumeTrue(!isWindows)
817-
818-
runDialogSizeTest(
819-
testName = "dialogPreferredWidth",
820-
sizeProvider = WindowSizeProvider.PreferredWidth(height = 500.dp),
821-
content = {
822-
BoxWithGivenSize(
823-
width = { 400.dp.roundToPx() }
824-
)
825-
},
826-
expectedDialogSizeSansInsets = DpSize(400.dp, 500.dp)
827-
)
828-
}
804+
fun dialogPreferredWidth() = runDialogSizeTest(
805+
testName = "dialogPreferredWidth",
806+
sizeProvider = WindowSizeProvider.PreferredWidth(height = 500.dp),
807+
content = {
808+
BoxWithGivenSize(
809+
width = { 400.dp.roundToPx() }
810+
)
811+
},
812+
expectedDialogSizeSansInsets = DpSize(400.dp, 500.dp)
813+
)
829814

830815
@Test
831-
fun dialogPreferredHeight() {
832-
// TODO Fix failing
833-
assumeTrue(!isWindows)
834-
835-
runDialogSizeTest(
836-
testName = "dialogPreferredHeight",
837-
sizeProvider = WindowSizeProvider.PreferredHeight(width = 500.dp),
838-
content = {
839-
BoxWithGivenSize(
840-
height = { 400.dp.roundToPx() }
841-
)
842-
},
843-
expectedDialogSizeSansInsets = DpSize(500.dp, 400.dp)
844-
)
845-
}
816+
fun dialogPreferredHeight() = runDialogSizeTest(
817+
testName = "dialogPreferredHeight",
818+
sizeProvider = WindowSizeProvider.PreferredHeight(width = 500.dp),
819+
content = {
820+
BoxWithGivenSize(
821+
height = { 400.dp.roundToPx() }
822+
)
823+
},
824+
expectedDialogSizeSansInsets = DpSize(500.dp, 400.dp)
825+
)
846826

847827
@Test
848-
fun `preferred size is rounded up`() {
849-
// TODO Fix failing
850-
assumeTrue(!isWindows)
851-
852-
runDialogSizeTest(
853-
testName = "preferred size is rounded up",
854-
sizeProvider = WindowSizeProvider.Unconstrained,
855-
content = {
856-
Layout { _, _ ->
857-
val size = (density * 100 + 1).toInt()
858-
layout(size, size) { }
859-
}
860-
},
861-
expectedDialogSizeSansInsets = DpSize(101.dp, 101.dp)
862-
)
863-
}
828+
fun `preferred size is rounded up`() = runDialogSizeTest(
829+
testName = "preferred size is rounded up",
830+
sizeProvider = WindowSizeProvider.Unconstrained,
831+
content = {
832+
Layout { _, _ ->
833+
val size = (density * 100 + 1).toInt()
834+
layout(size, size) { }
835+
}
836+
},
837+
expectedDialogSizeSansInsets = DpSize(101.dp, 101.dp)
838+
)
864839

865840
private fun runBoundsOverwriteTest(
866841
name: String,

0 commit comments

Comments
 (0)