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 000000000000..7d9b3af485a2 Binary files /dev/null and b/tests/tests/swfs/avm2/socket_close/test.swf differ 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