Skip to content

Commit

Permalink
tests: Add tab_ordering_properties test
Browse files Browse the repository at this point in the history
This test verifies the behavior of properties related to tab ordering.
  • Loading branch information
kjarosh committed Mar 22, 2024
1 parent 33988ef commit 5a85439
Show file tree
Hide file tree
Showing 4 changed files with 320 additions and 0 deletions.
217 changes: 217 additions & 0 deletions tests/tests/swfs/avm1/tab_ordering_properties/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
===== text =====
default
tabEnabled = undefined
tabIndex = undefined
tabChildren = undefined
enumerated tabIndex
after set 1
tabEnabled = true
tabIndex = 0
tabChildren = true
enumerated tabEnabled
enumerated tabIndex
enumerated tabChildren
after set 2
tabEnabled = false
tabIndex = 4
tabChildren = false
enumerated tabEnabled
enumerated tabIndex
enumerated tabChildren
after set 3
tabEnabled = undefined
tabIndex = undefined
tabChildren = undefined
enumerated tabEnabled
enumerated tabIndex
enumerated tabChildren
after set 4
tabEnabled = -4
tabIndex = 4294967292
tabChildren = -4
enumerated tabEnabled
enumerated tabIndex
enumerated tabChildren
after set 5
tabEnabled = 2147483647
tabIndex = 2147483647
tabChildren = 2147483647
enumerated tabEnabled
enumerated tabIndex
enumerated tabChildren
after set 6
tabEnabled = 2147483648
tabIndex = 2147483648
tabChildren = 2147483648
enumerated tabEnabled
enumerated tabIndex
enumerated tabChildren
after set 7
tabEnabled = x
tabIndex = 0
tabChildren = x
enumerated tabEnabled
enumerated tabIndex
enumerated tabChildren
after set 8
tabEnabled = -2147483648
tabIndex = 2147483648
tabChildren = -2147483648
enumerated tabEnabled
enumerated tabIndex
enumerated tabChildren
after set 9
tabEnabled = [object Object]
tabIndex = 0
tabChildren = [object Object]
enumerated tabEnabled
enumerated tabIndex
enumerated tabChildren
after set 10
tabEnabled = 1.1
tabIndex = 1
tabChildren = 1.1
enumerated tabEnabled
enumerated tabIndex
enumerated tabChildren
===== button =====
default
tabEnabled = undefined
tabIndex = undefined
tabChildren = undefined
enumerated tabIndex
after set 1
tabEnabled = true
tabIndex = 0
tabChildren = true
enumerated tabEnabled
enumerated tabIndex
enumerated tabChildren
after set 2
tabEnabled = false
tabIndex = 4
tabChildren = false
enumerated tabEnabled
enumerated tabIndex
enumerated tabChildren
after set 3
tabEnabled = undefined
tabIndex = undefined
tabChildren = undefined
enumerated tabEnabled
enumerated tabIndex
enumerated tabChildren
after set 4
tabEnabled = -4
tabIndex = -4
tabChildren = -4
enumerated tabEnabled
enumerated tabIndex
enumerated tabChildren
after set 5
tabEnabled = 2147483647
tabIndex = 2147483647
tabChildren = 2147483647
enumerated tabEnabled
enumerated tabIndex
enumerated tabChildren
after set 6
tabEnabled = 2147483648
tabIndex = -2147483648
tabChildren = 2147483648
enumerated tabEnabled
enumerated tabIndex
enumerated tabChildren
after set 7
tabEnabled = x
tabIndex = -2147483648
tabChildren = x
enumerated tabEnabled
enumerated tabIndex
enumerated tabChildren
after set 8
tabEnabled = -2147483648
tabIndex = -2147483648
tabChildren = -2147483648
enumerated tabEnabled
enumerated tabIndex
enumerated tabChildren
after set 9
tabEnabled = [object Object]
tabIndex = -2147483648
tabChildren = [object Object]
enumerated tabEnabled
enumerated tabIndex
enumerated tabChildren
after set 10
tabEnabled = 1.1
tabIndex = 1
tabChildren = 1.1
enumerated tabEnabled
enumerated tabIndex
enumerated tabChildren
===== movie clip =====
default
tabEnabled = undefined
tabIndex = undefined
tabChildren = undefined
after set 1
tabEnabled = true
tabIndex = 0
tabChildren = true
enumerated tabEnabled
enumerated tabChildren
after set 2
tabEnabled = false
tabIndex = 4
tabChildren = false
enumerated tabEnabled
enumerated tabChildren
after set 3
tabEnabled = undefined
tabIndex = undefined
tabChildren = undefined
enumerated tabEnabled
enumerated tabChildren
after set 4
tabEnabled = -4
tabIndex = -4
tabChildren = -4
enumerated tabEnabled
enumerated tabChildren
after set 5
tabEnabled = 2147483647
tabIndex = 2147483647
tabChildren = 2147483647
enumerated tabEnabled
enumerated tabChildren
after set 6
tabEnabled = 2147483648
tabIndex = -2147483648
tabChildren = 2147483648
enumerated tabEnabled
enumerated tabChildren
after set 7
tabEnabled = x
tabIndex = -2147483648
tabChildren = x
enumerated tabEnabled
enumerated tabChildren
after set 8
tabEnabled = -2147483648
tabIndex = -2147483648
tabChildren = -2147483648
enumerated tabEnabled
enumerated tabChildren
after set 9
tabEnabled = [object Object]
tabIndex = -2147483648
tabChildren = [object Object]
enumerated tabEnabled
enumerated tabChildren
after set 10
tabEnabled = 1.1
tabIndex = 1
tabChildren = 1.1
enumerated tabEnabled
enumerated tabChildren
102 changes: 102 additions & 0 deletions tests/tests/swfs/avm1/tab_ordering_properties/test.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
function printProperties(obj) {
trace(' tabEnabled = ' + obj.tabEnabled);
trace(' tabIndex = ' + obj.tabIndex);
trace(' tabChildren = ' + obj.tabChildren);
for (var i in obj) {
if (i == 'tabEnabled') {
trace(' enumerated tabEnabled');
}
}
for (var i in obj) {
if (i == 'tabIndex') {
trace(' enumerated tabIndex');
}
}
for (var i in obj) {
if (i == 'tabChildren') {
trace(' enumerated tabChildren');
}
}
}

function testProperties(obj) {
trace(' default');
printProperties(obj);

obj.tabEnabled = true;
obj.tabIndex = 0;
obj.tabChildren = true;

trace(' after set 1');
printProperties(obj);

obj.tabEnabled = false;
obj.tabIndex = 4;
obj.tabChildren = false;

trace(' after set 2');
printProperties(obj);

obj.tabEnabled = undefined;
obj.tabIndex = undefined;
obj.tabChildren = undefined;

trace(' after set 3');
printProperties(obj);

obj.tabEnabled = -4;
obj.tabIndex = -4;
obj.tabChildren = -4;

trace(' after set 4');
printProperties(obj);

obj.tabEnabled = 2147483647;
obj.tabIndex = 2147483647;
obj.tabChildren = 2147483647;

trace(' after set 5');
printProperties(obj);

obj.tabEnabled = 2147483648;
obj.tabIndex = 2147483648;
obj.tabChildren = 2147483648;

trace(' after set 6');
printProperties(obj);

obj.tabEnabled = 'x';
obj.tabIndex = 'x';
obj.tabChildren = 'x';

trace(' after set 7');
printProperties(obj);

obj.tabEnabled = -2147483648;
obj.tabIndex = -2147483648;
obj.tabChildren = -2147483648;

trace(' after set 8');
printProperties(obj);

obj.tabEnabled = new Object();
obj.tabIndex = new Object();
obj.tabChildren = new Object();

trace(' after set 9');
printProperties(obj);

obj.tabEnabled = 1.1;
obj.tabIndex = 1.1;
obj.tabChildren = 1.1;

trace(' after set 10');
printProperties(obj);
}

trace('===== text =====');
testProperties(text);
trace('===== button =====');
testProperties(button);
trace('===== movie clip =====');
testProperties(_root);
Binary file not shown.
1 change: 1 addition & 0 deletions tests/tests/swfs/avm1/tab_ordering_properties/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
num_ticks = 1

0 comments on commit 5a85439

Please sign in to comment.