-
-
Notifications
You must be signed in to change notification settings - Fork 843
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Add focus_highlight_avm2_button_bounds test
- Loading branch information
Showing
6 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
tests/tests/swfs/visual/focus_highlight/focus_highlight_avm2_button_bounds/Test.as
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,38 @@ | ||
package { | ||
|
||
import flash.display.MovieClip; | ||
import flash.display.Shape; | ||
import flash.display.SimpleButton; | ||
import flash.events.FocusEvent; | ||
|
||
[SWF(width="50", height="50", backgroundColor="#000000")] | ||
public class Test extends MovieClip { | ||
private var button: SimpleButton; | ||
|
||
public function Test() { | ||
var buttonState = new Shape(); | ||
buttonState.graphics.beginFill(0xFF00FF); | ||
buttonState.graphics.drawRect(-10, -10, 20, 20); | ||
buttonState.graphics.endFill(); | ||
var hitState = new Shape(); | ||
hitState.graphics.beginFill(0xFF0000); | ||
hitState.graphics.drawRect(-5, -5, 10, 10); | ||
hitState.graphics.endFill(); | ||
|
||
button = new SimpleButton(); | ||
button.hitTestState = hitState; | ||
button.upState = buttonState; | ||
button.downState = buttonState; | ||
button.overState = buttonState; | ||
button.x = 25; | ||
button.y = 25; | ||
button.tabIndex = 1; | ||
|
||
stage.addChild(button); | ||
|
||
stage.addEventListener("focusIn", function (evt: FocusEvent): void { | ||
trace("Focus changed: " + evt.relatedObject + " -> " + evt.target); | ||
}); | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
tests/tests/swfs/visual/focus_highlight/focus_highlight_avm2_button_bounds/input.json
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,4 @@ | ||
[ | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "Wait" } | ||
] |
Binary file added
BIN
+172 Bytes
...s/visual/focus_highlight/focus_highlight_avm2_button_bounds/output.expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
tests/tests/swfs/visual/focus_highlight/focus_highlight_avm2_button_bounds/output.txt
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 @@ | ||
Focus changed: null -> [object SimpleButton] |
Binary file added
BIN
+1.25 KB
tests/tests/swfs/visual/focus_highlight/focus_highlight_avm2_button_bounds/test.swf
Binary file not shown.
6 changes: 6 additions & 0 deletions
6
tests/tests/swfs/visual/focus_highlight/focus_highlight_avm2_button_bounds/test.toml
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,6 @@ | ||
num_ticks = 1 | ||
|
||
image_comparisons."output".trigger = 1 | ||
|
||
[player_options] | ||
with_renderer = { optional = false, sample_count = 1 } |