tests: Verify the URLRequest method setter can throw
This commit is contained in:
parent
cadae9303f
commit
95f5701072
|
@ -0,0 +1,22 @@
|
|||
package {
|
||||
import flash.display.Sprite;
|
||||
public class Test extends Sprite {
|
||||
}
|
||||
}
|
||||
|
||||
import flash.net.*;
|
||||
|
||||
var request = new URLRequest();
|
||||
|
||||
request.url = null;
|
||||
|
||||
var methods = ["GET", "get", "Get", "POST", "post", "PoST", "PUT", "put", "DELETE"];
|
||||
for each (var method in methods) {
|
||||
trace("// '" + method + "' method");
|
||||
try {
|
||||
request.method = method;
|
||||
trace("request.method: " + request.method);
|
||||
} catch (e) {
|
||||
trace("error: " + e);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
// 'GET' method
|
||||
request.method: GET
|
||||
// 'get' method
|
||||
request.method: get
|
||||
// 'Get' method
|
||||
error: ArgumentError: Error #2008: Parameter method must be one of the accepted values.
|
||||
// 'POST' method
|
||||
request.method: POST
|
||||
// 'post' method
|
||||
request.method: post
|
||||
// 'PoST' method
|
||||
error: ArgumentError: Error #2008: Parameter method must be one of the accepted values.
|
||||
// 'PUT' method
|
||||
error: ArgumentError: Error #2008: Parameter method must be one of the accepted values.
|
||||
// 'put' method
|
||||
error: ArgumentError: Error #2008: Parameter method must be one of the accepted values.
|
||||
// 'DELETE' method
|
||||
error: ArgumentError: Error #2008: Parameter method must be one of the accepted values.
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
num_frames = 1
|
Loading…
Reference in New Issue