Skip to content

Commit

Permalink
tests: Add test for close event
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepycatcoding authored and Dinnerbone committed Jul 26, 2023
1 parent bf76e72 commit 021ee6a
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/tests/swfs/avm2/socket_close/Test.as
Original file line number Diff line number Diff line change
@@ -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);
2 changes: 2 additions & 0 deletions tests/tests/swfs/avm2/socket_close/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
connected
closed
5 changes: 5 additions & 0 deletions tests/tests/swfs/avm2/socket_close/socket.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
{
"type": "Disconnect"
}
]
Binary file added tests/tests/swfs/avm2/socket_close/test.swf
Binary file not shown.
1 change: 1 addition & 0 deletions tests/tests/swfs/avm2/socket_close/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
num_ticks = 10

0 comments on commit 021ee6a

Please sign in to comment.