tests: Verify the URLRequest method setter can throw

This commit is contained in:
Tom Schuster 2024-02-06 14:34:46 +01:00
parent cadae9303f
commit 95f5701072
4 changed files with 41 additions and 0 deletions

View File

@ -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);
}
}

View File

@ -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.

View File

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