tests: Add avm1/focus_root_movie test

This test verifies the behavior of focusing
and tabbing into the root movie.
This commit is contained in:
Kamil Jarosz 2024-05-10 23:56:36 +02:00 committed by Nathan Adams
parent d39c7339d9
commit b0eb0ef1d9
5 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,7 @@
[
{ "type": "KeyDown", "key_code": 9 },
{ "type": "KeyDown", "key_code": 9 },
{ "type": "KeyDown", "key_code": 9 },
{ "type": "KeyDown", "key_code": 27 },
{ "type": "KeyDown", "key_code": 9 }
]

View File

@ -0,0 +1,2 @@
Focus changed: null -> _level0.clip
=====

View File

@ -0,0 +1,25 @@
_root.focusEnabled = true;
_root.tabEnabled = true;
_root.tabIndex = 1;
_root._focusrect = true;
_root.onRelease = function() {
};
_root.clip.focusEnabled = true;
_root.clip.tabEnabled = true;
_root.clip.tabIndex = 1;
_root.clip._focusrect = true;
var listener = new Object();
listener.onSetFocus = function(oldFocus, newFocus) {
if (newFocus) {
trace("Focus changed: " + oldFocus + " -> " + newFocus);
}
};
Selection.addListener(listener);
Selection.setFocus(_root);
Selection.setFocus(_root.clip);
trace("=====");

Binary file not shown.

View File

@ -0,0 +1 @@
num_ticks = 1