Skip to content

Commit e61afca

Browse files
Lord-McSweeneykjarosh
authored andcommitted
tests: Add test for stack trace of context3DCreated event handler
1 parent 5ffa93b commit e61afca

4 files changed

Lines changed: 45 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package {
2+
import flash.display.MovieClip;
3+
import flash.display.Stage3D;
4+
import flash.events.Event;
5+
6+
public class Test extends MovieClip {
7+
public function Test() {
8+
var s3d:Stage3D = stage.stage3Ds[0];;
9+
var self:Test = this;
10+
11+
trace(this.currentFrame);
12+
13+
addEventListener("enterFrame", function():void {
14+
trace("Running enterFrame, currentFrame=" + self.currentFrame);
15+
});
16+
addEventListener("frameConstructed", function():void {
17+
trace("Running frameConstructed, currentFrame=" + self.currentFrame);
18+
});
19+
addEventListener("exitFrame", function():void {
20+
trace("Running exitFrame, currentFrame=" + self.currentFrame);
21+
});
22+
23+
s3d.addEventListener("context3DCreate", context3DCreateHandler);
24+
s3d.requestContext3D();
25+
}
26+
27+
public function context3DCreateHandler(e:Event):void {
28+
trace("context3DCreate dispatched, currentFrame=" + this.currentFrame);
29+
trace("Stack trace from within context3DCreate: " + new Error().getStackTrace());
30+
}
31+
}
32+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
1
2+
Running frameConstructed, currentFrame=1
3+
Running exitFrame, currentFrame=1
4+
context3DCreate dispatched, currentFrame=1
5+
Stack trace from within context3DCreate: Error
6+
at Test/context3DCreateHandler()
7+
Running enterFrame, currentFrame=2
8+
Running frameConstructed, currentFrame=2
9+
Running exitFrame, currentFrame=2
763 Bytes
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
num_frames = 2
2+
3+
[player_options]
4+
with_renderer = { optional = false, quality = "low" }

0 commit comments

Comments
 (0)