-
-
Notifications
You must be signed in to change notification settings - Fork 839
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Add tab_ordering_children test
This test verifies the behavior of `tabChildren`: how it affects automatic and custom tabbing, and how it behaves in a hierarchy.
- Loading branch information
Showing
5 changed files
with
384 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
[ | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "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 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "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 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "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 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "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 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "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 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "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 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "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 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "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 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "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 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "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 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "KeyDown", "key_code": 9 } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,208 @@ | ||
Focus changed | ||
old: null | ||
new: _level0.text1 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text1 | ||
new: _level0.text2 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text2 | ||
new: _level0.clipOuter.text3 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.clipOuter.text3 | ||
new: _level0.clipOuter.text4 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.clipOuter.text4 | ||
new: _level0.clipOuter.clipInner.text5 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.clipOuter.clipInner.text5 | ||
new: _level0.clipOuter.clipInner.text6 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.clipOuter.clipInner.text6 | ||
new: _level0.text1 | ||
Escape pressed, moving to stage 1 | ||
Tab pressed | ||
Tab pressed | ||
Tab pressed | ||
Tab pressed | ||
Tab pressed | ||
Tab pressed | ||
Escape pressed, moving to stage 2 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text1 | ||
new: _level0.text2 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text2 | ||
new: _level0.text1 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text1 | ||
new: _level0.text2 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text2 | ||
new: _level0.text1 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text1 | ||
new: _level0.text2 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text2 | ||
new: _level0.text1 | ||
Escape pressed, moving to stage 3 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text1 | ||
new: _level0.text2 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text2 | ||
new: _level0.clipOuter.text3 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.clipOuter.text3 | ||
new: _level0.clipOuter.text4 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.clipOuter.text4 | ||
new: _level0.text1 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text1 | ||
new: _level0.text2 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text2 | ||
new: _level0.clipOuter.text3 | ||
Escape pressed, moving to stage 4 | ||
Tab pressed | ||
Tab pressed | ||
Tab pressed | ||
Tab pressed | ||
Tab pressed | ||
Tab pressed | ||
Escape pressed, moving to stage 5 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.clipOuter.text3 | ||
new: _level0.text1 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text1 | ||
new: _level0.text2 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text2 | ||
new: _level0.text1 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text1 | ||
new: _level0.text2 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text2 | ||
new: _level0.text1 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text1 | ||
new: _level0.text2 | ||
Escape pressed, moving to stage 6 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text2 | ||
new: _level0.clipOuter | ||
Tab pressed | ||
Focus changed | ||
old: _level0.clipOuter | ||
new: _level0.text1 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text1 | ||
new: _level0.text2 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text2 | ||
new: _level0.clipOuter | ||
Tab pressed | ||
Focus changed | ||
old: _level0.clipOuter | ||
new: _level0.text1 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text1 | ||
new: _level0.text2 | ||
Escape pressed, moving to stage 7 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text2 | ||
new: _level0.clipOuter | ||
Tab pressed | ||
Focus changed | ||
old: _level0.clipOuter | ||
new: _level0.text1 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text1 | ||
new: _level0.text2 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text2 | ||
new: _level0.clipOuter | ||
Tab pressed | ||
Focus changed | ||
old: _level0.clipOuter | ||
new: _level0.text1 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text1 | ||
new: _level0.text2 | ||
Escape pressed, moving to stage 8 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text2 | ||
new: _level0.text1 | ||
Tab pressed | ||
Tab pressed | ||
Tab pressed | ||
Tab pressed | ||
Tab pressed | ||
Escape pressed, moving to stage 9 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text1 | ||
new: _level0.clipOuter.text3 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.clipOuter.text3 | ||
new: _level0.text1 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text1 | ||
new: _level0.clipOuter.text3 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.clipOuter.text3 | ||
new: _level0.text1 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.text1 | ||
new: _level0.clipOuter.text3 | ||
Tab pressed | ||
Focus changed | ||
old: _level0.clipOuter.text3 | ||
new: _level0.text1 | ||
Escape pressed, moving to stage 10 | ||
Tab pressed | ||
Tab pressed | ||
Tab pressed | ||
Tab pressed | ||
Tab pressed | ||
Tab pressed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
var listener = new Object(); | ||
listener.onSetFocus = function(oldFocus, newFocus) { | ||
if (newFocus) { | ||
trace("Focus changed"); | ||
trace(" old: " + oldFocus); | ||
trace(" new: " + newFocus); | ||
} | ||
}; | ||
Selection.addListener(listener); | ||
|
||
var testStage = 0; | ||
function setUpStage(stage) { | ||
if (stage == 0) { | ||
// already set up | ||
} | ||
if (stage == 1) { | ||
_root.tabChildren = false; | ||
clipOuter.tabChildren = true; | ||
clipOuter.clipInner.tabChildren = true; | ||
} | ||
if (stage == 2) { | ||
_root.tabChildren = true; | ||
clipOuter.tabChildren = false; | ||
clipOuter.clipInner.tabChildren = true; | ||
} | ||
if (stage == 3) { | ||
_root.tabChildren = true; | ||
clipOuter.tabChildren = true; | ||
clipOuter.clipInner.tabChildren = false; | ||
} | ||
if (stage == 4) { | ||
_root.tabChildren = false; | ||
clipOuter.tabChildren = true; | ||
clipOuter.clipInner.tabChildren = false; | ||
} | ||
if (stage == 5) { | ||
_root.tabChildren = true; | ||
clipOuter.tabChildren = false; | ||
clipOuter.tabEnabled = false; | ||
clipOuter.clipInner.tabChildren = true; | ||
} | ||
if (stage == 6) { | ||
_root.tabChildren = true; | ||
clipOuter.tabChildren = false; | ||
clipOuter.tabEnabled = true; | ||
clipOuter.clipInner.tabChildren = true; | ||
} | ||
if (stage == 7) { | ||
_root.tabChildren = true; | ||
_root.tabEnabled = false; | ||
clipOuter.tabChildren = false; | ||
clipOuter.clipInner.tabChildren = true; | ||
} | ||
if (stage == 8) { | ||
_root.tabChildren = true; | ||
_root.tabEnabled = undefined; | ||
clipOuter.tabChildren = false; | ||
clipOuter.tabEnabled = undefined; | ||
clipOuter.clipInner.tabChildren = true; | ||
|
||
text1.tabIndex = 3; | ||
clipOuter.text3.tabIndex = 1; | ||
clipOuter.clipInner.text5.tabIndex = 2; | ||
} | ||
if (stage == 9) { | ||
_root.tabChildren = true; | ||
clipOuter.tabChildren = true; | ||
clipOuter.clipInner.tabChildren = false; | ||
|
||
text1.tabIndex = 3; | ||
clipOuter.text3.tabIndex = 1; | ||
clipOuter.clipInner.text5.tabIndex = 2; | ||
} | ||
if (stage == 10) { | ||
_root.tabChildren = false; | ||
clipOuter.tabChildren = false; | ||
clipOuter.clipInner.tabChildren = true; | ||
|
||
text1.tabIndex = 3; | ||
clipOuter.text3.tabIndex = 1; | ||
clipOuter.clipInner.text5.tabIndex = 2; | ||
} | ||
} | ||
|
||
var listener = new Object(); | ||
listener.onKeyDown = function() { | ||
if (Key.getCode() == 27) { | ||
testStage += 1; | ||
trace("Escape pressed, moving to stage " + testStage); | ||
setUpStage(testStage); | ||
} else if (Key.getCode() == 9) { | ||
trace("Tab pressed"); | ||
} | ||
}; | ||
Key.addListener(listener); | ||
|
||
Selection.setFocus(text1); |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
num_ticks = 1 |