avm2: Add test for NetStream.client

This commit is contained in:
Lord-McSweeney 2023-07-08 10:06:18 -07:00 committed by kmeisthax
parent 42c1facf55
commit dd0d4f7eea
4 changed files with 67 additions and 0 deletions

View File

@ -0,0 +1,56 @@
package {
import flash.display.MovieClip;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.utils.getQualifiedClassName;
public class Test extends MovieClip {
public function Test() {
super();
var con:NetConnection = new NetConnection();
con.connect(null);
var stream:NetStream = new NetStream(con);
trace(stream.client);
trace(stream.client == stream);
try {
stream.client = 3;
} catch (e:Error) {
trace(getQualifiedClassName(e) + ": " + e.errorID);
}
try {
stream.client = true;
} catch (e:Error) {
trace(getQualifiedClassName(e) + ": " + e.errorID);
}
try {
stream.client = "abcd";
} catch (e:Error) {
trace(getQualifiedClassName(e) + ": " + e.errorID);
}
try {
stream.client = null;
} catch (e:Error) {
trace(getQualifiedClassName(e) + ": " + e.errorID);
}
try {
stream.client = undefined;
} catch (e:Error) {
trace(getQualifiedClassName(e) + ": " + e.errorID);
}
try {
stream.client = {};
trace("success!");
} catch (e:Error) {
trace(getQualifiedClassName(e) + ": " + e.errorID);
}
try {
stream.client = MovieClip;
trace("success!");
} catch (e:Error) {
trace(getQualifiedClassName(e) + ": " + e.errorID);
}
trace("test over");
}
}
}

View File

@ -0,0 +1,10 @@
[object NetStream]
true
TypeError: 2004
TypeError: 2004
TypeError: 2004
TypeError: 2004
TypeError: 2004
success!
success!
test over

Binary file not shown.

View File

@ -0,0 +1 @@
num_frames = 1