Skip to content

Commit

Permalink
tests: Add avm1/edittext_place_caret test
Browse files Browse the repository at this point in the history
This test verifies how the text field and its selection behave
when placing a caret with the mouse.
  • Loading branch information
kjarosh committed Nov 15, 2024
1 parent 272573c commit 99561d9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/tests/swfs/avm1/edittext_place_caret/input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{ "type": "KeyDown", "key_code": 27 },
{ "type": "MouseMove", "pos": [400, 10] },
{ "type": "MouseDown", "pos": [400, 10], "btn": "Left" },
{ "type": "MouseUp", "pos": [400, 10], "btn": "Left" },
{ "type": "TextInput", "codepoint": "a" },
{ "type": "TextInput", "codepoint": "s" },
{ "type": "TextInput", "codepoint": "d" },
{ "type": "TextInput", "codepoint": "f" },
{ "type": "KeyDown", "key_code": 27 }
]
2 changes: 2 additions & 0 deletions tests/tests/swfs/avm1/edittext_place_caret/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Text: test
Text: testasdf
7 changes: 7 additions & 0 deletions tests/tests/swfs/avm1/edittext_place_caret/test.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var listener = new Object();
listener.onKeyDown = function() {
if (Key.getCode() == 27) {
trace("Text: " + text.text);
}
};
Key.addListener(listener);
Binary file added tests/tests/swfs/avm1/edittext_place_caret/test.swf
Binary file not shown.
1 change: 1 addition & 0 deletions tests/tests/swfs/avm1/edittext_place_caret/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
num_ticks = 1

0 comments on commit 99561d9

Please sign in to comment.