From 04f9eea40d8387b9d36e27df91b28b1647bf9b9c Mon Sep 17 00:00:00 2001 From: Kamil Jarosz Date: Fri, 20 Dec 2024 15:36:37 +0100 Subject: [PATCH] tests: Add avm2/edittext_scrollh test This test verifies the behavior of setting TextField.scrollH. --- .../tests/swfs/avm2/edittext_scrollh/Test.as | 39 ++++++++++++++++++ .../swfs/avm2/edittext_scrollh/output.txt | 10 +++++ .../tests/swfs/avm2/edittext_scrollh/test.swf | Bin 0 -> 1010 bytes .../swfs/avm2/edittext_scrollh/test.toml | 1 + 4 files changed, 50 insertions(+) create mode 100644 tests/tests/swfs/avm2/edittext_scrollh/Test.as create mode 100644 tests/tests/swfs/avm2/edittext_scrollh/output.txt create mode 100644 tests/tests/swfs/avm2/edittext_scrollh/test.swf create mode 100644 tests/tests/swfs/avm2/edittext_scrollh/test.toml diff --git a/tests/tests/swfs/avm2/edittext_scrollh/Test.as b/tests/tests/swfs/avm2/edittext_scrollh/Test.as new file mode 100644 index 000000000000..a7be783b66be --- /dev/null +++ b/tests/tests/swfs/avm2/edittext_scrollh/Test.as @@ -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); + } +} +} diff --git a/tests/tests/swfs/avm2/edittext_scrollh/output.txt b/tests/tests/swfs/avm2/edittext_scrollh/output.txt new file mode 100644 index 000000000000..2ecf356c31ab --- /dev/null +++ b/tests/tests/swfs/avm2/edittext_scrollh/output.txt @@ -0,0 +1,10 @@ +0 +0 +0 +10 +5 +15 +1 +0 +1 +3 diff --git a/tests/tests/swfs/avm2/edittext_scrollh/test.swf b/tests/tests/swfs/avm2/edittext_scrollh/test.swf new file mode 100644 index 0000000000000000000000000000000000000000..723f007db8a3a8cf846b4dde8e04fe516aeb4923 GIT binary patch literal 1010 zcmV< zX6wN;-w@rE!>zw{6junGZU+^l;nJr^_0RTuy)TZQcF}neT3}{$rC0neI^ZrZFTcw0 zK&4R>Msl4CYmRpMQzI;41EoR!KsarFB*CH?4J=ZfCt<8enDS34K zHC5Sx13hip)LWYsJ+T?}h|0_}Iu$O@@-snJrW`#B+q(T>cnf*Lpf|mgLCq6`rHQ5; z7^bBq8N{Umd^wI~ebgTR?*V(}GdaBEXL3tTt4>YxF20sd?sl&EnKI_yD7rku-|W@O zU~u9Lm@`nJ%?BFQP1_8=+JQkWmv06gWZP;Sq~>u)xg=TuFQfiwRg`p|B)y6`{B+ z6jp`8U7@fBUCcpSF2LjvSH24XR@LYwJzpxri+2YJi<6F^5@E9XljlVGZ*-R zp9tp)%qQp{oIv6v-N!oKN)c`%_W6%_^!;y>Oi(M4#3UQul9OCN6&$AUyOTm+2=w%! z0Lx-f!z4YCVq`9;T>^3^MoPg}nTV5eP|E~8Y6du z8UoE)jI0N8n8dvp*$89~kXnq~hsrq)c46mSfzneH^>cbo>F4#l(l6)*rC-#GN?+0? grJvQa(dA3D8Vw@@jsye{=WqT9k6_dP0|njw9%Gj9H2?qr literal 0 HcmV?d00001 diff --git a/tests/tests/swfs/avm2/edittext_scrollh/test.toml b/tests/tests/swfs/avm2/edittext_scrollh/test.toml new file mode 100644 index 000000000000..cf6123969a1d --- /dev/null +++ b/tests/tests/swfs/avm2/edittext_scrollh/test.toml @@ -0,0 +1 @@ +num_ticks = 1