Skip to content

Commit

Permalink
tests: Add stage_properties2 test
Browse files Browse the repository at this point in the history
  • Loading branch information
kjarosh authored and Dinnerbone committed Apr 23, 2024
1 parent 83d5d18 commit 9bc5735
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/tests/swfs/avm2/stage_properties2/Test.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package {
import flash.display.Sprite;
import flash.display.Stage;

public class Test extends Sprite {
function Test() {
super();
var stage:Stage = this.stage;
trace("===== height");
this.logError(function() {
trace(stage.height);
});
this.logError(function() {
trace(stage.height = 400);
});
trace("===== width");
this.logError(function() {
trace(stage.width);
});
this.logError(function() {
trace(stage.width = 400);
});
trace("===== textSnapshot");
this.logError(function() {
trace(stage.textSnapshot);
});
}

function logError(f:*):void {
try {
f();
} catch(error) {
trace("Error: " + error);
}
}
}
}
8 changes: 8 additions & 0 deletions tests/tests/swfs/avm2/stage_properties2/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
===== height
0
Error: Error: Error #2071: The Stage class does not implement this property or method.
===== width
0
Error: Error: Error #2071: The Stage class does not implement this property or method.
===== textSnapshot
Error: Error: Error #2071: The Stage class does not implement this property or method.
Binary file added tests/tests/swfs/avm2/stage_properties2/test.swf
Binary file not shown.
1 change: 1 addition & 0 deletions tests/tests/swfs/avm2/stage_properties2/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
num_ticks = 1

0 comments on commit 9bc5735

Please sign in to comment.