diff --git a/tests/tests/swfs/avm1/focus_root_movie/input.json b/tests/tests/swfs/avm1/focus_root_movie/input.json new file mode 100644 index 000000000..ef8fac620 --- /dev/null +++ b/tests/tests/swfs/avm1/focus_root_movie/input.json @@ -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 } +] diff --git a/tests/tests/swfs/avm1/focus_root_movie/output.txt b/tests/tests/swfs/avm1/focus_root_movie/output.txt new file mode 100644 index 000000000..54134620f --- /dev/null +++ b/tests/tests/swfs/avm1/focus_root_movie/output.txt @@ -0,0 +1,2 @@ +Focus changed: null -> _level0.clip +===== diff --git a/tests/tests/swfs/avm1/focus_root_movie/test.as b/tests/tests/swfs/avm1/focus_root_movie/test.as new file mode 100644 index 000000000..93f3542f8 --- /dev/null +++ b/tests/tests/swfs/avm1/focus_root_movie/test.as @@ -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("====="); diff --git a/tests/tests/swfs/avm1/focus_root_movie/test.swf b/tests/tests/swfs/avm1/focus_root_movie/test.swf new file mode 100644 index 000000000..2f259fad9 Binary files /dev/null and b/tests/tests/swfs/avm1/focus_root_movie/test.swf differ diff --git a/tests/tests/swfs/avm1/focus_root_movie/test.toml b/tests/tests/swfs/avm1/focus_root_movie/test.toml new file mode 100644 index 000000000..cf6123969 --- /dev/null +++ b/tests/tests/swfs/avm1/focus_root_movie/test.toml @@ -0,0 +1 @@ +num_ticks = 1