Skip to content

Commit 9814df8

Browse files
committed
tests: Add avm1/edittext_ime_focus_lost test
This test verifies the behavior of IME and text selection when losing focus.
1 parent 69db0c3 commit 9814df8

File tree

5 files changed

+40
-0
lines changed

5 files changed

+40
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[
2+
{ "type": "ImePreedit", "text": "", "cursor": null },
3+
{ "type": "ImePreedit", "text": "q", "cursor": [1, 1] },
4+
{ "type": "Wait" },
5+
{ "type": "Wait" },
6+
{ "type": "Wait" },
7+
{ "type": "Wait" },
8+
{ "type": "Wait" },
9+
{ "type": "ImePreedit", "text": "", "cursor": null }
10+
]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Before: q
2+
1
3+
q|
4+
Changed: q|
5+
After: q|
6+
2
7+
|q|
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
_root.createTextField("text", _root.getNextHighestDepth(), 0, 0, 100, 100);
2+
text.type = "input";
3+
Selection.setFocus(text);
4+
text.onChanged = function() {
5+
trace("Changed: " + text.text);
6+
};
7+
8+
setTimeout(function() {
9+
trace("Before: " + text.text);
10+
trace(" " + text.length);
11+
text.replaceSel("|");
12+
trace(" " + text.text);
13+
14+
Selection.setFocus(null);
15+
16+
setTimeout(function() {
17+
trace("After: " + text.text);
18+
trace(" " + text.length);
19+
text.replaceSel("|");
20+
trace(" " + text.text);
21+
}, 1000);
22+
}, 5000);
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
num_ticks = 8

0 commit comments

Comments
 (0)