Skip to content

Commit

Permalink
tests: Add avm2/edittext_scrollh test
Browse files Browse the repository at this point in the history
This test verifies the behavior of setting TextField.scrollH.
  • Loading branch information
kjarosh committed Dec 27, 2024
1 parent 2f30e4a commit 04f9eea
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
39 changes: 39 additions & 0 deletions tests/tests/swfs/avm2/edittext_scrollh/Test.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package {
import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFormat;

public class Test extends Sprite {
public function Test() {
stage.scaleMode = "noScale";
var text = new TextField();
text.width = 20;
text.height = 20;
addChild(text);

trace(text.scrollH);
text.scrollH = 1;
trace(text.scrollH);
text.scrollH = -1;
trace(text.scrollH);

text.text = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";

text.scrollH = 10;
trace(text.scrollH);
text.scrollH = 5;
trace(text.scrollH);
text.scrollH = -15;
trace(text.scrollH);
text.scrollH = -1;
trace(text.scrollH);
text.scrollH = 0;
trace(text.scrollH);

text.scrollH = 1.23;
trace(text.scrollH);
text.scrollH = 3.93;
trace(text.scrollH);
}
}
}
10 changes: 10 additions & 0 deletions tests/tests/swfs/avm2/edittext_scrollh/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
0
0
0
10
5
15
1
0
1
3
Binary file added tests/tests/swfs/avm2/edittext_scrollh/test.swf
Binary file not shown.
1 change: 1 addition & 0 deletions tests/tests/swfs/avm2/edittext_scrollh/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
num_ticks = 1

0 comments on commit 04f9eea

Please sign in to comment.