Skip to content

Commit

Permalink
Add another test
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron1011 authored and adrian17 committed Sep 23, 2023
1 parent c20b7b3 commit 8aec2f1
Show file tree
Hide file tree
Showing 9 changed files with 119 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/tests/swfs/avm2/swf_9_goto_in_enter_frame/test.toml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
num_ticks = 3
known_failure = true
20 changes: 20 additions & 0 deletions tests/tests/swfs/avm2/swf_9_goto_in_enter_frame_simple/MyChild.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package {

import flash.display.MovieClip;


public class MyChild extends MovieClip {


public function MyChild() {
this.addFrameScript(0, function() {
trace("MyChild framescript 0");
});
this.addFrameScript(1, function() {
trace("MyChild framescript 1");
});
super();
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package {

import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.utils.setTimeout;


public class MyContainer extends MovieClip {


public function MyContainer() {
var self = this;
addFrameScript(0,function():*
{
trace("MyContainer framescript 0");
});
addFrameScript(1,function():*
{
trace("MyContainer framescript 1");
});
super();
addEventListener("enterFrame",function():*
{
trace("MyContainer enterFrame");
trace("Before MyContainer.gotoAndStop(2)");
self.gotoAndStop(2);
trace("After MyContainer.gotoAndStop(2)");
});
addEventListener("frameConstructed",function():*
{
trace("MyContainer frameConstructed");
});
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package {

import flash.display.MovieClip;
import flash.events.Event;


public class MyOtherChild extends MovieClip {


public function MyOtherChild() {
this.addEventListener(Event.ENTER_FRAME, this.onEnterFrame);
this.addEventListener(Event.FRAME_CONSTRUCTED, this.onFrameConstructed);
trace("Calling MyOtherChild super()")
super();
trace("Called MyOtherChild super()");
}

private function onEnterFrame(e) {
trace("MyOtherChild onEnterFrame");
}

private function onFrameConstructed(e) {
trace("MyOtherChild onFrameConstructed");
}
}

}
19 changes: 19 additions & 0 deletions tests/tests/swfs/avm2/swf_9_goto_in_enter_frame_simple/Test.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package {

import flash.display.MovieClip;


public class Test extends MovieClip {

public function Test()
{
trace("Constructing Test");
var self = this;
this.addFrameScript(1, function() {
trace("Stopping Test at frame 2");
self.stop();
})
}
}

}
15 changes: 15 additions & 0 deletions tests/tests/swfs/avm2/swf_9_goto_in_enter_frame_simple/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Constructing Test
Calling MyOtherChild super()
Called MyOtherChild super()
MyContainer frameConstructed
MyOtherChild onFrameConstructed
Stopping Test at frame 2
MyContainer framescript 0
MyContainer enterFrame
Before MyContainer.gotoAndStop(2)
After MyContainer.gotoAndStop(2)
MyOtherChild onEnterFrame
MyContainer frameConstructed
MyOtherChild onFrameConstructed
MyContainer framescript 1
MyChild framescript 0
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
num_ticks = 3

0 comments on commit 8aec2f1

Please sign in to comment.