-
-
Notifications
You must be signed in to change notification settings - Fork 816
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Add avm1/movieclip_create_text_field test
This test verifies the behavior of MovieClip.createTextField's params.
- Loading branch information
1 parent
c3ad08c
commit 0c50083
Showing
5 changed files
with
147 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+231 Bytes
tests/tests/swfs/avm1/movieclip_create_text_field/output.expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
90 changes: 90 additions & 0 deletions
90
tests/tests/swfs/avm1/movieclip_create_text_field/output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
_level0.text1 | ||
x = 2 | ||
y = 3 | ||
w = 2 | ||
h = 3 | ||
_level0.text1 | ||
x = 2.1 | ||
y = 3.9 | ||
w = 2.1 | ||
h = 3.9 | ||
_level0.text2 | ||
x = 0 | ||
y = 0 | ||
w = 0 | ||
h = 0 | ||
_level0.text3 | ||
x = 0 | ||
y = 0 | ||
w = 0 | ||
h = 0 | ||
_level0.text4 | ||
x = 0 | ||
y = 0 | ||
w = 0 | ||
h = 0 | ||
_level0.text5 | ||
x = 1 | ||
y = 1 | ||
w = 1 | ||
h = 1 | ||
_level0.text6 | ||
x = 0 | ||
y = 0 | ||
w = 0 | ||
h = 0 | ||
_level0.text7 | ||
x = 0 | ||
y = 0 | ||
w = 0 | ||
h = 0 | ||
_level0.text8 | ||
x = 0 | ||
y = 0 | ||
w = 0 | ||
h = 0 | ||
_level0.text9 | ||
x = -2 | ||
y = -2 | ||
w = 2 | ||
h = 2 | ||
_level0.text10 | ||
x = -2 | ||
y = -2 | ||
w = 2 | ||
h = 2 | ||
_level0.text11 | ||
x = -2 | ||
y = -2 | ||
w = 2 | ||
h = 2 | ||
_level0.text12 | ||
x = 0 | ||
y = 0 | ||
w = 0 | ||
h = 0 | ||
_level0.text13 | ||
x = 0 | ||
y = 0 | ||
w = 0 | ||
h = 0 | ||
_level0.text14 | ||
x = 0 | ||
y = 0 | ||
w = 0 | ||
h = 0 | ||
_level0.text15 | ||
x = 0 | ||
y = 0 | ||
w = 0 | ||
h = 0 | ||
_level0.text16 | ||
x = 0 | ||
y = 0 | ||
w = 0 | ||
h = 0 | ||
_level0.text17 | ||
x = 50 | ||
y = 50 | ||
w = 50 | ||
h = 50 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
function printProps(obj) { | ||
trace(obj); | ||
trace(" x = " + obj._x); | ||
trace(" y = " + obj._y); | ||
trace(" w = " + obj._width); | ||
trace(" h = " + obj._height); | ||
} | ||
|
||
function testCreateTextField(i, value) { | ||
printProps(_root.createTextField( | ||
"text" + i, | ||
_root.getNextHighestDepth(), | ||
value, value, value, value)); | ||
} | ||
|
||
var text1 = _root.createTextField( | ||
"text1", | ||
_root.getNextHighestDepth(), | ||
2.1, 3.94, 2.1, 3.94); | ||
printProps(text1); | ||
|
||
text1._x = 2.1; | ||
text1._y = 3.94; | ||
text1._width = 2.1; | ||
text1._height = 3.94; | ||
printProps(text1); | ||
|
||
var i = 2; | ||
testCreateTextField(i++, 0); | ||
testCreateTextField(i++, "0"); | ||
testCreateTextField(i++, 0.1); | ||
testCreateTextField(i++, true); | ||
testCreateTextField(i++, false); | ||
testCreateTextField(i++, ""); | ||
testCreateTextField(i++, new Object()); | ||
testCreateTextField(i++, -2); | ||
testCreateTextField(i++, -2.9); | ||
testCreateTextField(i++, "-2"); | ||
testCreateTextField(i++, "text"); | ||
testCreateTextField(i++, null); | ||
testCreateTextField(i++, undefined); | ||
testCreateTextField(i++, 1.0 / 0.0); | ||
testCreateTextField(i++, 0.0 / 0.0); | ||
|
||
var tf = _root.createTextField( | ||
"text" + i++, | ||
_root.getNextHighestDepth(), | ||
50, 50, -50, -50); | ||
printProps(tf); | ||
tf.background = true; | ||
tf.backgroundColor = 0; |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
num_ticks = 1 | ||
|
||
image_comparisons."output".trigger = 1 | ||
|
||
[player_options] | ||
with_renderer = { optional = true, sample_count = 1 } |