tests: Add focusrect_swf6 test

This test verifies the behavior of _focusrect for SWF6.
This commit is contained in:
Kamil Jarosz 2024-04-02 13:36:16 +02:00 committed by Nathan Adams
parent 84d24fdd50
commit cebd7f0e5c
17 changed files with 137 additions and 0 deletions

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

View File

@ -0,0 +1,42 @@
Setting test stage to 1
Focus changed
old: null
new: _level0.clip1
Focus changed
old: _level0.clip1
new: _level0.clip2
Setting test stage to 2
Focus changed
old: _level0.clip2
new: _level0.clip1
Focus changed
old: _level0.clip1
new: _level0.clip2
Setting test stage to 3
Focus changed
old: _level0.clip2
new: _level0.clip1
Focus changed
old: _level0.clip1
new: _level0.clip2
Setting test stage to 4
Focus changed
old: _level0.clip2
new: _level0.clip1
Focus changed
old: _level0.clip1
new: _level0.clip2
Setting test stage to 5
Focus changed
old: _level0.clip2
new: _level0.clip1
Focus changed
old: _level0.clip1
new: _level0.clip2
Setting test stage to 6
Focus changed
old: _level0.clip2
new: _level0.clip1
Focus changed
old: _level0.clip1
new: _level0.clip2

View File

@ -0,0 +1,46 @@
var listener = new Object();
listener.onSetFocus = function(oldFocus, newFocus) {
if (newFocus) {
trace("Focus changed");
trace(" old: " + oldFocus);
trace(" new: " + newFocus);
}
};
Selection.addListener(listener);
clip1.tabEnabled = true;
clip1.tabIndex = 1;
clip2.tabEnabled = true;
clip2.tabIndex = 2;
var testStage = 0;
function nextTestStage() {
testStage += 1;
trace("Setting test stage to " + testStage);
if (testStage == 1) {
_focusrect = true;
} else if (testStage == 2) {
_focusrect = false;
} else if (testStage == 3) {
_focusrect = true;
clip1._focusrect = false;
} else if (testStage == 4) {
_focusrect = false;
clip1._focusrect = true;
} else if (testStage == 5) {
_focusrect = true;
clip1._focusrect = null;
} else if (testStage == 6) {
_focusrect = false;
clip1._focusrect = null;
}
Selection.setFocus(clip2);
}
var listener = new Object();
listener.onKeyDown = function() {
if (Key.getCode() == 27) {
nextTestStage();
}
};
Key.addListener(listener);

Binary file not shown.

View File

@ -0,0 +1,17 @@
num_ticks = 12
image_comparisons."output.01a".trigger = 1
image_comparisons."output.01b".trigger = 2
image_comparisons."output.02a".trigger = 3
image_comparisons."output.02b".trigger = 4
image_comparisons."output.03a".trigger = 5
image_comparisons."output.03b".trigger = 6
image_comparisons."output.04a".trigger = 7
image_comparisons."output.04b".trigger = 8
image_comparisons."output.05a".trigger = 9
image_comparisons."output.05b".trigger = 10
image_comparisons."output.06a".trigger = 11
image_comparisons."output.06b".trigger = 12
[player_options]
with_renderer = { optional = false, sample_count = 1 }