From 021ee6a9fcb20cbdbbef75e706ddc8f861e51d30 Mon Sep 17 00:00:00 2001 From: sleepycatcoding <131554884+sleepycatcoding@users.noreply.github.com> Date: Sun, 23 Jul 2023 22:35:49 +0300 Subject: [PATCH] tests: Add test for close event --- tests/tests/swfs/avm2/socket_close/Test.as | 25 ++++++++++++++++++ tests/tests/swfs/avm2/socket_close/output.txt | 2 ++ .../tests/swfs/avm2/socket_close/socket.json | 5 ++++ tests/tests/swfs/avm2/socket_close/test.swf | Bin 0 -> 896 bytes tests/tests/swfs/avm2/socket_close/test.toml | 1 + 5 files changed, 33 insertions(+) create mode 100644 tests/tests/swfs/avm2/socket_close/Test.as create mode 100644 tests/tests/swfs/avm2/socket_close/output.txt create mode 100644 tests/tests/swfs/avm2/socket_close/socket.json create mode 100644 tests/tests/swfs/avm2/socket_close/test.swf create mode 100644 tests/tests/swfs/avm2/socket_close/test.toml diff --git a/tests/tests/swfs/avm2/socket_close/Test.as b/tests/tests/swfs/avm2/socket_close/Test.as new file mode 100644 index 000000000000..cbd6a991f445 --- /dev/null +++ b/tests/tests/swfs/avm2/socket_close/Test.as @@ -0,0 +1,25 @@ +package +{ + import flash.display.Sprite; + + public class Test extends Sprite + { + } +} + +import flash.net.Socket; +import flash.events.Event; + +var socket:Socket = new Socket(); + +socket.addEventListener(Event.CONNECT, function(evt:Event):void +{ + trace("connected"); +}); + +socket.addEventListener(Event.CLOSE, function(evt:Event):void +{ + trace("closed"); +}); + +socket.connect("localhost", 8001); diff --git a/tests/tests/swfs/avm2/socket_close/output.txt b/tests/tests/swfs/avm2/socket_close/output.txt new file mode 100644 index 000000000000..916d26dd549b --- /dev/null +++ b/tests/tests/swfs/avm2/socket_close/output.txt @@ -0,0 +1,2 @@ +connected +closed diff --git a/tests/tests/swfs/avm2/socket_close/socket.json b/tests/tests/swfs/avm2/socket_close/socket.json new file mode 100644 index 000000000000..f271f53d57be --- /dev/null +++ b/tests/tests/swfs/avm2/socket_close/socket.json @@ -0,0 +1,5 @@ +[ + { + "type": "Disconnect" + } +] diff --git a/tests/tests/swfs/avm2/socket_close/test.swf b/tests/tests/swfs/avm2/socket_close/test.swf new file mode 100644 index 0000000000000000000000000000000000000000..7d9b3af485a2c422bc24ecca493fffa12153b026 GIT binary patch literal 896 zcmV-`1AqKOS5qb%1poke0fkaeZ{tK1pYgwm)22zbA#E2HA_0n4G_jKiq;}h=Rnow& zRt?%L0wG1w)E>v)I<{p`{wx;|;=+Ni!G#ZjIB?(=4txPlhzsQtl;=s>?w%NF#xw8t z`@Q%4-diB$PlUF9L}(YIZgCGG^!4`N7@?!sb`GC)dzHn+50XQ89amk>qeH`(&*$}d zs~*NV3#-Z9NE^P6UGzD+cb)N&!VY2V^K@o(7K${8LK%yP23~nj+kn= z$9>j5ji}|aO3!DD%ITe4kXMY9Yv1MBUjL;7iaHf)k(W@s%1d?8^uqTNm&G@62BE{} zG=_lTG_XacLU>0^Wme265C2zmLrWz-4aQSCW^ERXJ{t(1ww@)RC^QufNR7 z0BNw5!sTx*7!-u|e>nc`d$|3Yea;e&elGnaA(SHGSwQuaRFTEDnrRr>BRJ z9=R3Q_L9h_FSS7wdz@+gix)u73uzZ1%3(0#TzUo83N1bkID^>So3WLp{2JZ~VZgnB z#o7R7k8yn!DPWv*`se3oo#zE=+aknMFX0TBYUgQxaHjjAMSV9+I9X@CGa8M<5f4W; zbG*PyXL{r^Ka!&`kv?jOT0$w_YaVEch$S~ZY-P$ynW)+F=5DrJQXilq!7{-bkun5l ziIO9Di%5B*6o^tJ$~~fO6Z{6jWrBAI-Xr8~6-%=64PKqlMCi;0Yz0a8@tbeKeg`Y6 zt|A#p2rH7(#n8#ZiL`+*R*@uOT>1xNRQgxCDi86#+Qaza)y~Jz?^`SnSP?K?VD|t6 zRYsSWCR}BV^=x)&E*~SH-3N;zOE~k@(uAkV&`@(Ub4VOw4l_>19O{m44zo_y9IB2g zjxW#yv0Mcdx#7l>4P<{Xk*@N#FAZf!b~aCNFDE?&v~*+IIzemG9+>ub-~XlE%S+$> W@%twkm{WcGc34lK7XJZCoNxvySGg?! literal 0 HcmV?d00001 diff --git a/tests/tests/swfs/avm2/socket_close/test.toml b/tests/tests/swfs/avm2/socket_close/test.toml new file mode 100644 index 000000000000..0d5c2c67fa6d --- /dev/null +++ b/tests/tests/swfs/avm2/socket_close/test.toml @@ -0,0 +1 @@ +num_ticks = 10