avm2: Add test for NetStream.client
This commit is contained in:
parent
42c1facf55
commit
dd0d4f7eea
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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.
|
@ -0,0 +1 @@
|
|||
num_frames = 1
|
Loading…
Reference in New Issue