-
-
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_tabbable test
This test verifies what objects are tabbable by default and after setting tabEnable & tabIndex. This test includes: * invisible objects, * objects with 0x0 size, * object outside of visible window bound, * objects within invisible containers, * non-selectable texts, * non-editable texts.
- Loading branch information
Showing
5 changed files
with
150 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,41 @@ | ||
[ | ||
{ "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": 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": 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": 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 } | ||
] |
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,44 @@ | ||
Tabbable elements: | ||
_level0.button11: false | ||
_level0.button10: true | ||
_level0.clip9.text: false | ||
_level0.clip9: false | ||
_level0.clip8.text: true | ||
_level0.clip8: false | ||
_level0.text7: true | ||
_level0.text6: true | ||
_level0.text5: false | ||
_level0.text4: true | ||
_level0.text3: false | ||
_level0.text2: true | ||
_level0.text1: false | ||
Enabling tab | ||
Tabbable elements: | ||
_level0.button11: false | ||
_level0.button10: true | ||
_level0.clip9.text: false | ||
_level0.clip9: false | ||
_level0.clip8.text: true | ||
_level0.clip8: false | ||
_level0.text7: true | ||
_level0.text6: true | ||
_level0.text5: false | ||
_level0.text4: true | ||
_level0.text3: false | ||
_level0.text2: true | ||
_level0.text1: false | ||
Setting custom order | ||
Tabbable elements: | ||
_level0.button11: false | ||
_level0.button10: true | ||
_level0.clip9.text: false | ||
_level0.clip9: false | ||
_level0.clip8.text: true | ||
_level0.clip8: true | ||
_level0.text7: true | ||
_level0.text6: true | ||
_level0.text5: false | ||
_level0.text4: true | ||
_level0.text3: false | ||
_level0.text2: true | ||
_level0.text1: false |
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,64 @@ | ||
var listener = new Object(); | ||
listener.onSetFocus = function(oldFocus, newFocus) { | ||
if (newFocus) { | ||
tabbedObjects.push(newFocus); | ||
} | ||
}; | ||
Selection.addListener(listener); | ||
|
||
text1.type = "dynamic"; | ||
text2.maxChars = 0; | ||
text3._visible = false; | ||
text6.selectable = false; | ||
clip9._visible = false; | ||
button11._visible = false; | ||
|
||
var objects = [ | ||
text1, | ||
text2, | ||
text3, | ||
text4, | ||
text5, | ||
text6, | ||
text7, | ||
clip8, | ||
clip8.text, | ||
clip9, | ||
clip9.text, | ||
button10, | ||
button11 | ||
]; | ||
|
||
var tabbedObjects = []; | ||
|
||
var testStage = 0; | ||
|
||
var listener = new Object(); | ||
listener.onKeyDown = function() { | ||
if (Key.getCode() == 27) { | ||
trace("Tabbable elements:"); | ||
for (var i in objects) { | ||
var exists = false; | ||
for (var j in tabbedObjects) { | ||
if (objects[i] == tabbedObjects[j]) { | ||
exists = true; | ||
} | ||
} | ||
trace(" " + objects[i] + ": " + exists); | ||
} | ||
|
||
++testStage; | ||
if (testStage == 1) { | ||
trace("Enabling tab"); | ||
for (var i in objects) { | ||
objects[i].tabEnable = true; | ||
} | ||
} else if (testStage == 2) { | ||
trace("Setting custom order"); | ||
for (var i in objects) { | ||
objects[i].tabIndex = i; | ||
} | ||
} | ||
} | ||
}; | ||
Key.addListener(listener); |
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 |