Skip to content

Commit 3604b9a

Browse files
committed
Debug tests
1 parent 48793e2 commit 3604b9a

7 files changed

Lines changed: 7 additions & 35 deletions

File tree

compose/ui/ui-uikit/src/iosMain/objc/CMPUIKitUtils/CMPUIKitUtils/CMPEditMenuView.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@
4747
- (void)activateTextInputInteractionIfNeeded;
4848

4949
- (void)deactivateTextInputInteractionIfNeeded;
50-
- (void)qweqwqwe;
50+
5151
@end

compose/ui/ui-uikit/src/iosMain/objc/CMPUIKitUtils/CMPUIKitUtils/CMPEditMenuView.m

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ - (void)showEditMenuAtRect:(CGRect)targetRect
123123
self.selectAllBlock = selectAllBlock;
124124
self.customActions = customActions;
125125

126-
NSLog(@">>>>> OBJ-C SHOW EDIT MENU: %@", self);
127-
128126
if (@available(iOS 16, *)) {
129127
[[CMPEditMenuViewRegister shared] hideAllMenusSkipping:self];
130128
if (self.editInteraction == nil || contextMenuItemsChanged || !self.isEditMenuShown) {
@@ -244,15 +242,8 @@ - (void)setEditInteraction:(UIEditMenuInteraction *)editInteraction API_AVAILABL
244242
- (void)presentEditMenuInteraction API_AVAILABLE(ios(16.0)) {
245243
NSAssert(self.editInteraction != nil, @"Edit Interaction must be initialized");
246244

247-
if (self.window == nil) {
248-
NSLog(@"[CMPEditMenuView] presentEditMenuInteraction called with nil window. Stack trace:\n%@",
249-
[NSThread callStackSymbols]);
250-
}
251-
252245
UIEditMenuConfiguration *config = [UIEditMenuConfiguration configurationWithIdentifier:nil
253246
sourcePoint:self.targetRect.origin];
254-
// hideEditMenu
255-
NSLog(@"[CMPEditMenuView] presentEditMenuInteraction called with config: %@ || view: %@", config, self);
256247
[self.editInteraction presentEditMenuWithConfiguration:config];
257248
}
258249

compose/ui/ui/src/iosMain/kotlin/androidx/compose/ui/platform/UIKitTextInputService.ios.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,6 @@ internal class UIKitTextInputService(
416416
val density = view.density
417417
val offset = textUIView.frame.useContents { origin.asDpOffset().toOffset(density) }
418418
val target = rect.translate(-offset).toDpRect(density).asCGRect()
419-
println(">>>> SHOW MENU AT $target | copy: ${onCopyRequested != null}, paste: ${onPasteRequested != null}, cut: ${onCutRequested != null}, selectAll: ${onSelectAllRequested != null} ")
420-
println(">>>>>>>>>> window? ${textUIView.window} | $textUIView")
421419
textUIView.showEditMenuAtRect(
422420
targetRect = target,
423421
copy = onCopyRequested,
@@ -436,7 +434,6 @@ internal class UIKitTextInputService(
436434
override fun hide() {
437435
showMenuOrUpdatePosition = {}
438436
textUIView?.let {
439-
println(">>>> HIDE")
440437
it.hideTextMenu()
441438
textMenuAppearanceChanged()
442439
}

compose/ui/ui/src/iosMain/kotlin/androidx/compose/ui/window/IntermediateTextInputUIView.ios.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ internal class IntermediateTextInputUIView(
156156
override fun didMoveToWindow() {
157157
super.didMoveToWindow()
158158

159-
println(">>>>>>>>>> sis move to? ${window} | $this")
160159
if (usingNativeTextInput) {
161160
if (window != null && !selectionInteractionAttached) {
162161
// Ensure UIKit text interaction is attached early so that cursor and selection

compose/ui/ui/src/uikitInstrumentedTest/kotlin/androidx/compose/ui/Configuration.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,13 @@
1616

1717
package androidx.compose.ui
1818

19-
import androidx.compose.ui.interaction.HapticFeedbackSelectionTest
20-
import androidx.compose.ui.interaction.TextFieldEditMenuTest
2119
import androidx.compose.xctest.setupXCTestSuite
2220
import kotlinx.cinterop.ExperimentalForeignApi
2321
import platform.XCTest.XCTestSuite
2422

2523
@Suppress("unused")
2624
@OptIn(ExperimentalForeignApi::class)
2725
fun testSuite(): XCTestSuite = setupXCTestSuite(
28-
HapticFeedbackSelectionTest::class,
29-
TextFieldEditMenuTest::class,
3026
// Run all test cases from the tests
3127
// BasicInteractionTest::class,
3228
// LayersAccessibilityTest::class,

compose/ui/ui/src/uikitInstrumentedTest/kotlin/androidx/compose/ui/interaction/TextFieldEditMenuTest.kt

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ import androidx.compose.ui.test.assertVisibleInContainer
4949
import androidx.compose.ui.test.findNodeWithLabel
5050
import androidx.compose.ui.test.findNodeWithTag
5151
import androidx.compose.ui.test.firstNodeOrNull
52-
import androidx.compose.ui.test.getAccessibilityTree
5352
import androidx.compose.ui.test.runUIKitInstrumentedTest
5453
import androidx.compose.ui.test.utils.hold
5554
import androidx.compose.ui.test.utils.up
@@ -432,13 +431,9 @@ class TextFieldEditMenuTest {
432431
}
433432

434433
private fun UIKitInstrumentedTest.openToolbar(textFieldTag: String) {
435-
delay(50)
436-
println(">> ---------------- tap $textFieldTag")
437434
findNodeWithTag(textFieldTag).tap()
438435
delay(500)
439-
println(">> ---------------- double tap $textFieldTag")
440436
findNodeWithTag(textFieldTag).doubleTap()
441-
println(">> ---------------- double tap done $textFieldTag")
442437
waitForContextMenu()
443438
}
444439

@@ -499,18 +494,12 @@ class TextFieldEditMenuTest {
499494
} else {
500495
"UICalloutBar"
501496
}
502-
println(">> ---------------- waitForContextMenu")
497+
503498
waitForIdle()
504-
try {
505-
UIKitInstrumentedTest.waitUntil {
506-
firstNodeOrNull { node ->
507-
node.element?.let { it::class.simpleName } == menuClassName
508-
} != null
509-
}
510-
} catch (e: Throwable) {
511-
println("Actual accessibility tree:")
512-
println(getAccessibilityTree().printTree())
513-
throw e
499+
waitUntil {
500+
firstNodeOrNull { node ->
501+
node.element?.let { it::class.simpleName } == menuClassName
502+
} != null
514503
}
515504
// Additional delay to wait until toolbar animation ends
516505
delay(500)

compose/ui/ui/src/uikitInstrumentedTest/kotlin/androidx/compose/ui/test/UIKitInstrumentedTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ internal class UIKitInstrumentedTest(
417417
fun AccessibilityTestNode.doubleTap() {
418418
val frame = frame ?: error("Internal error. Frame is missing.")
419419
tap(frame.center())
420-
delay(100)
420+
delay(50)
421421
return tap(frame.center())
422422
}
423423

0 commit comments

Comments
 (0)