Skip to content

Commit 0856d51

Browse files
committed
core: Add integration test for reentry in cleanup queue
1 parent b48aabf commit 0856d51

File tree

8 files changed

+287
-0
lines changed

8 files changed

+287
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Main constructor
2+
Container constructor
3+
Child constructor
4+
GrandChild constructor
5+
LeafChild constructor
6+
Main addFrameScript
7+
Main frame1
8+
Child addFrameScript
9+
Container addFrameScript
10+
LeafChild addFrameScript
11+
GrandChild addFrameScript
12+
Child frame1
13+
Container frame1
14+
Child another addFrameScript
15+
LeafChild frame1
16+
GrandChild frame1
17+
Child frame extra
18+
Main frame2
19+
Container frame2
20+
Child frame2
21+
GrandChild frame2
22+
LeafChild frame2
23+
Container frame1
24+
Child frame extra
25+
GrandChild frame1
26+
LeafChild frame1
27+
Main frame1
28+
Container frame2
29+
Child frame2
30+
GrandChild frame2
31+
LeafChild frame2
32+
Main frame2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
package
2+
{
3+
import flash.display.MovieClip;
4+
5+
public class Main extends MovieClip
6+
{
7+
public var child:*;
8+
9+
public var repeats:uint = 0;
10+
11+
public var descendant_names:Array = ["Container","Child","GrandChild","LeafChild"];
12+
13+
public var descendant_order:Array = [2,1,4,3];
14+
15+
public function Main()
16+
{
17+
trace("Main constructor");
18+
super();
19+
this.addScripts();
20+
var descendants:* = collectDescendants();
21+
for(i in this.descendant_order)
22+
{
23+
if(this.descendant_order[i] == 0)
24+
{
25+
descendants[i].addScripts();
26+
}
27+
}
28+
}
29+
30+
public function collectDescendants() : Array
31+
{
32+
return [this.child].concat(this.child.collectDescendants());
33+
}
34+
35+
public function addScripts() : *
36+
{
37+
trace("Main addFrameScript");
38+
addFrameScript(0,this.frame1,1,this.frame2);
39+
}
40+
41+
internal function frame1() : *
42+
{
43+
trace("Main frame1");
44+
if(this.repeats > 0)
45+
{
46+
return;
47+
}
48+
var descendants:* = collectDescendants();
49+
for(i in this.descendant_order)
50+
{
51+
for(j in this.descendant_order)
52+
{
53+
if(this.descendant_order[j] == i + 1)
54+
{
55+
descendants[j].addScripts();
56+
}
57+
}
58+
}
59+
}
60+
61+
internal function frame2() : *
62+
{
63+
trace("Main frame2");
64+
if(this.repeats > 0)
65+
{
66+
stop();
67+
}
68+
else
69+
{
70+
this.repeats += 1;
71+
}
72+
}
73+
}
74+
}
75+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
package
2+
{
3+
import flash.display.MovieClip;
4+
5+
public class MyChild extends MovieClip
6+
{
7+
public static var counter:uint = 1;
8+
9+
public var grandchild:*;
10+
11+
public var id:uint = counter;
12+
13+
public var repeats:uint = 0;
14+
15+
public var name:String = "Child";
16+
17+
public function MyChild()
18+
{
19+
counter += 1;
20+
trace(this.name + " constructor");
21+
super();
22+
}
23+
24+
public function collectDescendants() : Array
25+
{
26+
return [this.grandchild].concat(this.grandchild.collectDescendants());
27+
}
28+
29+
public function addScripts() : *
30+
{
31+
trace(this.name + " addFrameScript");
32+
addFrameScript(0,this.frame1,1,this.frame2);
33+
}
34+
35+
public function addOtherScripts() : *
36+
{
37+
trace(this.name + " another addFrameScript");
38+
addFrameScript(0,this.frame_extra);
39+
}
40+
41+
internal function frame1() : *
42+
{
43+
trace(this.name + " frame1");
44+
}
45+
46+
internal function frame_extra() : *
47+
{
48+
trace(this.name + " frame extra");
49+
}
50+
51+
internal function frame2() : *
52+
{
53+
trace(this.name + " frame2");
54+
if(this.repeats > 0)
55+
{
56+
stop();
57+
}
58+
else
59+
{
60+
this.repeats += 1;
61+
}
62+
}
63+
}
64+
}
65+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package
2+
{
3+
import flash.display.MovieClip;
4+
5+
public class MyContainer extends MovieClip
6+
{
7+
public var myChild1:*;
8+
9+
public var myChild2:*;
10+
11+
public var repeats:uint = 0;
12+
13+
public function MyContainer()
14+
{
15+
trace("Container constructor");
16+
super();
17+
}
18+
19+
public function collectDescendants() : Array
20+
{
21+
return [this.myChild1].concat(this.myChild1.collectDescendants()).concat([this.myChild2]).concat(this.myChild2.collectDescendants());
22+
}
23+
24+
public function addScripts() : *
25+
{
26+
trace("Container addFrameScript");
27+
addFrameScript(0,this.frame1,1,this.frame2);
28+
}
29+
30+
internal function frame1() : *
31+
{
32+
trace("Container frame1");
33+
if(this.repeats == 0)
34+
{
35+
this.myChild1.addOtherScripts();
36+
}
37+
}
38+
39+
internal function frame2() : *
40+
{
41+
trace("Container frame2");
42+
if(this.repeats > 0)
43+
{
44+
stop();
45+
}
46+
else
47+
{
48+
this.repeats += 1;
49+
}
50+
}
51+
}
52+
}
53+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
package
2+
{
3+
import flash.display.MovieClip;
4+
5+
public class MyLeaf extends MovieClip
6+
{
7+
public static var counter:uint = 1;
8+
9+
public var id:uint = counter;
10+
11+
public var repeats:uint = 0;
12+
13+
public var name:String = "";
14+
15+
public function MyLeaf()
16+
{
17+
if(this.id == 1)
18+
{
19+
this.name = "GrandChild";
20+
}
21+
else
22+
{
23+
this.name = "LeafChild";
24+
}
25+
counter += 1;
26+
trace(this.name + " constructor");
27+
super();
28+
}
29+
30+
public function collectDescendants() : Array
31+
{
32+
return [];
33+
}
34+
35+
public function addScripts() : *
36+
{
37+
trace(this.name + " addFrameScript");
38+
addFrameScript(0,this.frame1,1,this.frame2);
39+
}
40+
41+
internal function frame1() : *
42+
{
43+
trace(this.name + " frame1");
44+
}
45+
46+
internal function frame2() : *
47+
{
48+
trace(this.name + " frame2");
49+
if(this.repeats > 0)
50+
{
51+
stop();
52+
}
53+
else
54+
{
55+
this.repeats += 1;
56+
}
57+
}
58+
}
59+
}
60+
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
num_frames = 20
2+
ignore = false

0 commit comments

Comments
 (0)