tests: Add test for LocalConnection.send

This commit is contained in:
Lord-McSweeney 2023-07-19 05:15:29 -07:00 committed by Nathan Adams
parent 7b21815660
commit 68c5024f21
4 changed files with 8 additions and 2 deletions

View File

@ -40,7 +40,7 @@ pub fn send<'gc>(
if matches!(args.get_value(0), Value::Null) {
return Err(Error::AvmError(type_error(
activation,
&format!("Error #2007: Parameter connectionName must be non-null."),
"Error #2007: Parameter connectionName must be non-null.",
2007,
)?));
}
@ -48,7 +48,7 @@ pub fn send<'gc>(
if matches!(args.get_value(1), Value::Null) {
return Err(Error::AvmError(type_error(
activation,
&format!("Error #2007: Parameter methodName must be non-null."),
"Error #2007: Parameter methodName must be non-null.",
2007,
)?));
}
@ -66,6 +66,7 @@ pub fn send<'gc>(
],
)?;
// FIXME: Adding the event listener after calling `send` works in FP.
Avm2::dispatch_event(&mut activation.context, event, this);
Ok(Value::Undefined)

View File

@ -0,0 +1,4 @@
TypeError: Error #2007: Parameter connectionName must be non-null.
TypeError: Error #2007: Parameter connectionName must be non-null.
TypeError: Error #2007: Parameter methodName must be non-null.
[StatusEvent type="status" bubbles=false cancelable=false eventPhase=2 code=null level="error"]

Binary file not shown.

View File

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