[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r11262: Add some basic TextField dis
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r11262: Add some basic TextField display tests with automatic testing of AS |
Date: |
Wed, 15 Jul 2009 18:47:33 +0200 |
User-agent: |
Bazaar (1.13.1) |
------------------------------------------------------------
revno: 11262
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Wed 2009-07-15 18:47:33 +0200
message:
Add some basic TextField display tests with automatic testing of AS
properties (but still not very useful for testing what it looks like).
added:
testsuite/misc-ming.all/EmbeddedFontTest.c
modified:
testsuite/misc-ming.all/DeviceFontTest.c
testsuite/misc-ming.all/Makefile.am
------------------------------------------------------------
revno: 11261.1.1
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Wed 2009-07-15 18:02:52 +0200
message:
Add automatic tests to DeviceFontTest.
modified:
testsuite/misc-ming.all/DeviceFontTest.c
------------------------------------------------------------
revno: 11261.1.2
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Wed 2009-07-15 18:42:57 +0200
message:
Add embedded font test.
added:
testsuite/misc-ming.all/EmbeddedFontTest.c
------------------------------------------------------------
revno: 11261.1.3
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Wed 2009-07-15 18:43:17 +0200
message:
Run font tests.
modified:
testsuite/misc-ming.all/Makefile.am
=== modified file 'testsuite/misc-ming.all/DeviceFontTest.c'
--- a/testsuite/misc-ming.all/DeviceFontTest.c 2009-07-08 14:22:11 +0000
+++ b/testsuite/misc-ming.all/DeviceFontTest.c 2009-07-15 16:02:52 +0000
@@ -109,6 +109,7 @@
dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10,
0, 0, 800, 600);
SWFMovie_add(mo, (SWFBlock)dejagnuclip);
+ SWFMovie_nextFrame(mo); // 1st frame
/*********************************************
*
@@ -123,12 +124,14 @@
it = add_text_field(mo, (SWFBlock)bfont, "Normal", 1, 2, 3,
SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255);
SWFDisplayItem_moveTo(it, 50, y);
+ SWFDisplayItem_setName(it, "tf1");
y += inc;
it = add_text_field(mo, (SWFBlock)bfont, "Transparent", 1, 2, 3,
SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 0);
SWFDisplayItem_moveTo(it, 50, y);
+ SWFDisplayItem_setName(it, "tf2");
y += inc;
@@ -136,6 +139,7 @@
"margin", 0, 0, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255);
SWFDisplayItem_moveTo(it, 50, y);
SWFDisplayItem_scale(it, 16, 1);
+ SWFDisplayItem_setName(it, "tf3");
y += inc;
@@ -143,6 +147,7 @@
4, 0, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255);
SWFDisplayItem_moveTo(it, 50, y);
SWFDisplayItem_scale(it, 16, 1);
+ SWFDisplayItem_setName(it, "tf4");
y += inc;
@@ -150,13 +155,14 @@
0, 4, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255);
SWFDisplayItem_moveTo(it, 50, y);
SWFDisplayItem_scale(it, 16, 1);
+ SWFDisplayItem_setName(it, "tf5");
y += inc;
-
it = add_text_field(mo, (SWFBlock)bfont, "X scaled by 16, right margin 4",
0, 0, 4, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255);
SWFDisplayItem_moveTo(it, 50, y);
SWFDisplayItem_scale(it, 16, 1);
+ SWFDisplayItem_setName(it, "tf6");
y += inc;
@@ -164,13 +170,15 @@
"indent 4", 4, 4, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255);
SWFDisplayItem_moveTo(it, 50, y);
SWFDisplayItem_scale(it, 16, 1);
-
+ SWFDisplayItem_setName(it, "tf7");
+
y += inc;
it = add_text_field(mo, (SWFBlock)bfont, "X scaled by 8, no indent or
margin",
0, 0, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255);
SWFDisplayItem_moveTo(it, 50, y);
SWFDisplayItem_scale(it, 8, 1);
+ SWFDisplayItem_setName(it, "tf8");
y += inc;
@@ -178,12 +186,14 @@
SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255);
SWFDisplayItem_moveTo(it, 50, y);
SWFDisplayItem_scale(it, 8, 1);
+ SWFDisplayItem_setName(it, "tf9");
y += inc;
it = add_text_field(mo, (SWFBlock)bfont, "X scaled by 0.2", 8, 8, 8,
SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255);
SWFDisplayItem_moveTo(it, 50, y);
SWFDisplayItem_scale(it, 0.2, 1);
+ SWFDisplayItem_setName(it, "tf10");
y += inc;
@@ -191,6 +201,7 @@
SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255);
SWFDisplayItem_moveTo(it, 50, y);
SWFDisplayItem_scale(it, 1, 4);
+ SWFDisplayItem_setName(it, "tf11");
y += inc * 3;
@@ -198,6 +209,112 @@
SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255);
SWFDisplayItem_moveTo(it, 50, y);
SWFDisplayItem_scale(it, 1, 8);
+ SWFDisplayItem_setName(it, "tf12");
+
+
+ // As these are device fonts, it's not clear how consistent the textWidth
+ // value will be. It's not even clear that it's worth testing it.
+
+ check_equals(mo, "tf1._width", "84");
+ check_equals(mo, "tf1._height", "20");
+ xcheck_equals(mo, "tf1._x", "48");
+ xcheck_equals(mo, "tf1._y", "28");
+ xcheck_equals(mo, "tf1.textHeight", "24");
+ // Approx 42
+ xcheck(mo, "tf1.textWidth >= 40 && tf1.textWidth <= 45");
+
+ check_equals(mo, "tf2._width", "84");
+ check_equals(mo, "tf2._height", "20");
+ xcheck_equals(mo, "tf2._x", "48");
+ xcheck_equals(mo, "tf2._y", "58");
+ xcheck_equals(mo, "tf2.textHeight", "24");
+ // Approx 69
+ xcheck(mo, "tf2.textWidth >= 66 && tf2.textWidth <= 72");
+
+ xcheck_equals(mo, "tf3._width", "1344");
+ check_equals(mo, "tf3._height", "20");
+ xcheck_equals(mo, "tf3._x", "18");
+ xcheck_equals(mo, "tf3._y", "88");
+ xcheck_equals(mo, "tf3.textHeight", "24");
+ // Approx 13
+ xcheck(mo, "tf3.textWidth >= 11 && tf3.textWidth <= 15");
+
+ xcheck_equals(mo, "tf4._width", "1344");
+ check_equals(mo, "tf4._height", "20");
+ xcheck_equals(mo, "tf4._x", "18");
+ xcheck_equals(mo, "tf4._y", "118");
+ xcheck_equals(mo, "tf4.textHeight", "24");
+ // Approx 9
+ xcheck(mo, "tf4.textWidth >= 7 && tf4.textWidth <= 11");
+
+ xcheck_equals(mo, "tf5._width", "1344");
+ check_equals(mo, "tf5._height", "20");
+ xcheck_equals(mo, "tf5._x", "18");
+ xcheck_equals(mo, "tf5._y", "148");
+ xcheck_equals(mo, "tf5.textHeight", "24");
+ // Approx 10
+ xcheck(mo, "tf5.textWidth >= 8 && tf5.textWidth <= 12");
+
+ xcheck_equals(mo, "tf6._width", "1344");
+ check_equals(mo, "tf6._height", "20");
+ xcheck_equals(mo, "tf6._x", "18");
+ xcheck_equals(mo, "tf6._y", "178");
+ xcheck_equals(mo, "tf6.textHeight", "24");
+ // Approx 11
+ xcheck(mo, "tf6.textWidth >= 9 && tf6.textWidth <= 13");
+
+ xcheck_equals(mo, "tf7._width", "1344");
+ check_equals(mo, "tf7._height", "20");
+ xcheck_equals(mo, "tf7._x", "18");
+ xcheck_equals(mo, "tf7._y", "208");
+ xcheck_equals(mo, "tf7.textHeight", "24");
+ // Approx 14
+ xcheck(mo, "tf7.textWidth >= 14 && tf7.textWidth <= 16");
+
+ xcheck_equals(mo, "tf8._width", "672");
+ check_equals(mo, "tf8._height", "20");
+ xcheck_equals(mo, "tf8._x", "34");
+ xcheck_equals(mo, "tf8._y", "238");
+ xcheck_equals(mo, "tf8.textHeight", "24");
+ // Approx 25
+ xcheck(mo, "tf8.textWidth >= 21 && tf8.textWidth <= 27");
+
+ xcheck_equals(mo, "tf9._width", "672");
+ check_equals(mo, "tf9._height", "20");
+ xcheck_equals(mo, "tf9._x", "34");
+ xcheck_equals(mo, "tf9._y", "268");
+ xcheck_equals(mo, "tf9.textHeight", "24");
+ // Approx 16
+ xcheck(mo, "tf9.textWidth >= 14 && tf9.textWidth <= 18");
+
+ xcheck_equals(mo, "tf10._width", "16.8");
+ check_equals(mo, "tf10._height", "20");
+ xcheck_equals(mo, "tf10._x", "49.6");
+ xcheck_equals(mo, "tf10._y", "298");
+ xcheck_equals(mo, "tf10.textHeight", "24");
+ // Approx 452
+ xcheck(mo, "tf10.textWidth >= 440 && tf10.textWidth <= 460");
+
+ // The textHeight for the following two fields varies.
+ check_equals(mo, "tf11._width", "84");
+ xcheck_equals(mo, "tf11._height", "80");
+ xcheck_equals(mo, "tf11._x", "48");
+ xcheck_equals(mo, "tf11._y", "322");
+ add_actions(mo, "trace(tf11.textWidth);");
+ xcheck(mo, "tf11.textHeight >= 23 && tf11.textHeight <= 24");
+ // Approx 315
+ xcheck(mo, "tf11.textWidth >= 305 && tf11.textWidth <= 325");
+
+ check_equals(mo, "tf12._width", "84");
+ xcheck_equals(mo, "tf12._height", "160");
+ xcheck_equals(mo, "tf12._x", "48");
+ xcheck_equals(mo, "tf12._y", "404");
+ add_actions(mo, "trace(tf12.textWidth);");
+ xcheck(mo, "tf12.textHeight >= 23 && tf12.textHeight <= 24");
+ // Approx 640
+ xcheck(mo, "tf12.textWidth >= 625 && tf12.textWidth <= 655");
+
+ add_actions(mo, "totals(); stop();");
SWFMovie_nextFrame(mo);
=== added file 'testsuite/misc-ming.all/EmbeddedFontTest.c'
--- a/testsuite/misc-ming.all/EmbeddedFontTest.c 1970-01-01 00:00:00
+0000
+++ b/testsuite/misc-ming.all/EmbeddedFontTest.c 2009-07-15 16:42:57
+0000
@@ -0,0 +1,348 @@
+/*
+ * Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ *
+ */
+
+/*
+ * Test DefineEditText tag.
+ * Uses both "embedded" font and device fonts.
+ * The text written is 'Hello world' in both cases.
+ * Text at the bottom is the one with embedded fonts.
+ *
+ * TODO: add a testrunner for pixel checking.
+ * TODO: test autoSize and wordWrap interaction (what takes precedence?)
+ *
+ * run as ./DefineEditTextTest
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ming.h>
+
+#include "ming_utils.h"
+
+#define OUTPUT_VERSION 7
+#define OUTPUT_FILENAME "EmbeddedFontTest.swf"
+
+SWFDisplayItem add_text_field(SWFMovie mo, SWFBlock font, const char* text,
+ float indent, float leftMargin, float rightMargin,
SWFTextFieldAlignment align,
+ float lineSpacing,
+ unsigned int textR, unsigned int textG, unsigned int textB, unsigned
int textA);
+
+SWFDisplayItem
+add_text_field(SWFMovie mo, SWFBlock font, const char* text, float indent,
+ float leftMargin, float rightMargin,
+ SWFTextFieldAlignment align, float lineSpacing,
+ unsigned int textR, unsigned int textG,
+ unsigned int textB, unsigned int textA)
+{
+ SWFTextField tf;
+
+ tf = newSWFTextField();
+
+ SWFTextField_setFont(tf, font);
+ SWFTextField_setIndentation(tf, indent);
+ SWFTextField_setLeftMargin(tf, leftMargin);
+ SWFTextField_setRightMargin(tf, rightMargin);
+ SWFTextField_setAlignment(tf, align);
+ SWFTextField_setLineSpacing(tf, lineSpacing);
+ SWFTextField_setColor(tf, textR, textG, textB, textA);
+
+ SWFTextField_setFlags(tf, SWFTEXTFIELD_DRAWBOX);
+ SWFTextField_addChars(tf, text);
+
+ SWFTextField_addString(tf, text);
+
+ SWFTextField_setBounds(tf, 80, 16);
+
+ return SWFMovie_add(mo, (SWFBlock)tf);
+}
+
+int
+main(int argc, char** argv)
+{
+ SWFMovie mo;
+ const char *srcdir=".";
+ char fdefont[256];
+ SWFMovieClip dejagnuclip;
+
+ SWFDisplayItem it;
+
+ /*********************************************
+ *
+ * Initialization
+ *
+ *********************************************/
+
+ if ( argc>1 ) srcdir=argv[1];
+ else
+ {
+ fprintf(stderr, "Usage: %s <mediadir>\n", argv[0]);
+ return 1;
+ }
+
+ sprintf(fdefont, "%s/Bitstream-Vera-Sans.fdb", srcdir);
+ FILE *font_file = fopen(fdefont, "r");
+ if ( font_file == NULL )
+ {
+ perror(fdefont);
+ exit(1);
+ }
+ SWFFont efont = loadSWFFontFromFile(font_file);
+
+ puts("Setting things up");
+
+ Ming_init();
+ Ming_useSWFVersion (OUTPUT_VERSION);
+
+ mo = newSWFMovie();
+ SWFMovie_setRate(mo, 1.0);
+ SWFMovie_setDimension(mo, 800, 600);
+
+ dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10,
+ 0, 0, 800, 600);
+ SWFMovie_add(mo, (SWFBlock)dejagnuclip);
+ SWFMovie_nextFrame(mo); // 1st frame
+
+ /*********************************************
+ *
+ * Add some textfields
+ *
+ *********************************************/
+
+ int y = 30;
+ int inc = 30;
+
+ it = add_text_field(mo, (SWFBlock)efont, "Normal", 1, 2, 3,
+ SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255);
+ SWFDisplayItem_moveTo(it, 50, y);
+ SWFDisplayItem_setName(it, "tf1");
+
+ y += inc;
+
+ it = add_text_field(mo, (SWFBlock)efont, "Transparent", 1, 2, 3,
+ SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 0);
+ SWFDisplayItem_moveTo(it, 50, y);
+ SWFDisplayItem_setName(it, "tf2");
+
+ y += inc;
+
+ it = add_text_field(mo, (SWFBlock)efont, "X scaled by 16, no indent or "
+ "margin", 0, 0, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255);
+ SWFDisplayItem_moveTo(it, 50, y);
+ SWFDisplayItem_scale(it, 16, 1);
+ SWFDisplayItem_setName(it, "tf3");
+
+ y += inc;
+
+ it = add_text_field(mo, (SWFBlock)efont, "X scaled by 16, indent 4",
+ 4, 0, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255);
+ SWFDisplayItem_moveTo(it, 50, y);
+ SWFDisplayItem_scale(it, 16, 1);
+ SWFDisplayItem_setName(it, "tf4");
+
+ y += inc;
+
+ it = add_text_field(mo, (SWFBlock)efont, "X scaled by 16, left margin 4",
+ 0, 4, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255);
+ SWFDisplayItem_moveTo(it, 50, y);
+ SWFDisplayItem_scale(it, 16, 1);
+ SWFDisplayItem_setName(it, "tf5");
+
+ y += inc;
+ it = add_text_field(mo, (SWFBlock)efont, "X scaled by 16, right margin 4",
+ 0, 0, 4, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255);
+ SWFDisplayItem_moveTo(it, 50, y);
+ SWFDisplayItem_scale(it, 16, 1);
+ SWFDisplayItem_setName(it, "tf6");
+
+ y += inc;
+
+ it = add_text_field(mo, (SWFBlock)efont, "X scaled by 16, left margin 4, "
+ "indent 4", 4, 4, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255);
+ SWFDisplayItem_moveTo(it, 50, y);
+ SWFDisplayItem_scale(it, 16, 1);
+ SWFDisplayItem_setName(it, "tf7");
+
+ y += inc;
+
+ it = add_text_field(mo, (SWFBlock)efont, "X scaled by 8, no indent or
margin",
+ 0, 0, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255);
+ SWFDisplayItem_moveTo(it, 50, y);
+ SWFDisplayItem_scale(it, 8, 1);
+ SWFDisplayItem_setName(it, "tf8");
+
+ y += inc;
+
+ it = add_text_field(mo, (SWFBlock)efont, "X scaled by 8, indent 4", 4, 0, 0,
+ SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255);
+ SWFDisplayItem_moveTo(it, 50, y);
+ SWFDisplayItem_scale(it, 8, 1);
+ SWFDisplayItem_setName(it, "tf9");
+ y += inc;
+
+ it = add_text_field(mo, (SWFBlock)efont, "X scaled by 0.2", 8, 8, 8,
+ SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255);
+ SWFDisplayItem_moveTo(it, 50, y);
+ SWFDisplayItem_scale(it, 0.2, 1);
+ SWFDisplayItem_setName(it, "tf10");
+
+ y += inc;
+
+ it = add_text_field(mo, (SWFBlock)efont, "Y scaled by 4", 4, 4, 0,
+ SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255);
+ SWFDisplayItem_moveTo(it, 50, y);
+ SWFDisplayItem_scale(it, 1, 4);
+ SWFDisplayItem_setName(it, "tf11");
+
+ y += inc * 3;
+
+ it = add_text_field(mo, (SWFBlock)efont, "Y scaled by 8", 4, 4, 0,
+ SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255);
+ SWFDisplayItem_moveTo(it, 50, y);
+ SWFDisplayItem_scale(it, 1, 8);
+ SWFDisplayItem_setName(it, "tf12");
+
+
+ // It's not clear how consistent the textWidth or textHeight
+ // values are. As they are embedded, it may be possible to reproduce
+ // exactly, in which case the test can be made more precise.
+
+ check_equals(mo, "tf1._width", "84");
+ check_equals(mo, "tf1._height", "20");
+ xcheck_equals(mo, "tf1._x", "48");
+ xcheck_equals(mo, "tf1._y", "28");
+ xcheck_equals(mo, "tf1.textHeight", "23");
+ // Approx 46
+ add_actions(mo, "trace(tf1.textWidth);");
+ xcheck(mo, "tf1.textWidth >= 44 && tf1.textWidth <= 48");
+
+ check_equals(mo, "tf2._width", "84");
+ check_equals(mo, "tf2._height", "20");
+ xcheck_equals(mo, "tf2._x", "48");
+ xcheck_equals(mo, "tf2._y", "58");
+ xcheck_equals(mo, "tf2.textHeight", "23");
+ // Approx 78
+ add_actions(mo, "trace(tf2.textWidth);");
+ xcheck(mo, "tf2.textWidth >= 76 && tf2.textWidth <= 80");
+
+ xcheck_equals(mo, "tf3._width", "1344");
+ check_equals(mo, "tf3._height", "20");
+ xcheck_equals(mo, "tf3._x", "18");
+ xcheck_equals(mo, "tf3._y", "88");
+ xcheck_equals(mo, "tf3.textHeight", "23");
+ // Approx 230
+ add_actions(mo, "trace(tf3.textWidth);");
+ xcheck(mo, "tf3.textWidth >= 225 && tf3.textWidth <= 235");
+
+ xcheck_equals(mo, "tf4._width", "1344");
+ check_equals(mo, "tf4._height", "20");
+ xcheck_equals(mo, "tf4._x", "18");
+ xcheck_equals(mo, "tf4._y", "118");
+ xcheck_equals(mo, "tf4.textHeight", "23");
+ // Approx 156
+ add_actions(mo, "trace(tf4.textWidth);");
+ xcheck(mo, "tf4.textWidth >= 153 && tf4.textWidth <= 159");
+
+ xcheck_equals(mo, "tf5._width", "1344");
+ check_equals(mo, "tf5._height", "20");
+ xcheck_equals(mo, "tf5._x", "18");
+ xcheck_equals(mo, "tf5._y", "148");
+ xcheck_equals(mo, "tf5.textHeight", "23");
+ // Approx 186
+ add_actions(mo, "trace(tf5.textWidth);");
+ xcheck(mo, "tf5.textWidth >= 183 && tf5.textWidth <= 189");
+
+ xcheck_equals(mo, "tf6._width", "1344");
+ check_equals(mo, "tf6._height", "20");
+ xcheck_equals(mo, "tf6._x", "18");
+ xcheck_equals(mo, "tf6._y", "178");
+ xcheck_equals(mo, "tf6.textHeight", "23");
+ // Approx 194
+ add_actions(mo, "trace(tf6.textWidth);");
+ xcheck(mo, "tf6.textWidth >= 189 && tf6.textWidth <= 199");
+
+ xcheck_equals(mo, "tf7._width", "1344");
+ check_equals(mo, "tf7._height", "20");
+ xcheck_equals(mo, "tf7._x", "18");
+ xcheck_equals(mo, "tf7._y", "208");
+ xcheck_equals(mo, "tf7.textHeight", "23");
+ // Approx 247
+ add_actions(mo, "trace(tf7.textWidth);");
+ xcheck(mo, "tf7.textWidth >= 240 && tf7.textWidth <= 254");
+
+ xcheck_equals(mo, "tf8._width", "672");
+ check_equals(mo, "tf8._height", "20");
+ xcheck_equals(mo, "tf8._x", "34");
+ xcheck_equals(mo, "tf8._y", "238");
+ xcheck_equals(mo, "tf8.textHeight", "23");
+ // Approx 222
+ add_actions(mo, "trace(tf8.textWidth);");
+ xcheck(mo, "tf8.textWidth >= 217 && tf8.textWidth <= 227");
+
+ xcheck_equals(mo, "tf9._width", "672");
+ check_equals(mo, "tf9._height", "20");
+ xcheck_equals(mo, "tf9._x", "34");
+ xcheck_equals(mo, "tf9._y", "268");
+ xcheck_equals(mo, "tf9.textHeight", "23");
+ // Approx 148
+ add_actions(mo, "trace(tf9.textWidth);");
+ xcheck(mo, "tf9.textWidth >= 144 && tf9.textWidth <= 152");
+
+ xcheck_equals(mo, "tf10._width", "16.8");
+ check_equals(mo, "tf10._height", "20");
+ xcheck_equals(mo, "tf10._x", "49.6");
+ xcheck_equals(mo, "tf10._y", "298");
+ xcheck_equals(mo, "tf10.textHeight", "23");
+ // Approx 99
+ add_actions(mo, "trace(tf10.textWidth);");
+ xcheck(mo, "tf10.textWidth >= 95 && tf10.textWidth <= 103");
+
+ // The textHeight for the following two fields varies.
+ check_equals(mo, "tf11._width", "84");
+ xcheck_equals(mo, "tf11._height", "80");
+ xcheck_equals(mo, "tf11._x", "48");
+ xcheck_equals(mo, "tf11._y", "322");
+ xcheck_equals(mo, "tf11.textHeight", "23");
+ // Approx 86
+ add_actions(mo, "trace(tf11.textWidth);");
+ xcheck(mo, "tf11.textWidth >= 84 && tf11.textWidth <= 88");
+
+ check_equals(mo, "tf12._width", "84");
+ xcheck_equals(mo, "tf12._height", "160");
+ xcheck_equals(mo, "tf12._x", "48");
+ xcheck_equals(mo, "tf12._y", "404");
+ xcheck_equals(mo, "tf12.textHeight", "23");
+ // Approx 86
+ add_actions(mo, "trace(tf12.textWidth);");
+ xcheck(mo, "tf12.textWidth >= 84 && tf12.textWidth <= 88");
+
+ add_actions(mo, "totals(); stop();");
+
+ SWFMovie_nextFrame(mo);
+
+ /*****************************************************
+ *
+ * Output movie
+ *
+ *****************************************************/
+ puts("Saving " OUTPUT_FILENAME );
+
+ SWFMovie_save(mo, OUTPUT_FILENAME);
+
+ return 0;
+}
=== modified file 'testsuite/misc-ming.all/Makefile.am'
--- a/testsuite/misc-ming.all/Makefile.am 2009-07-08 11:38:54 +0000
+++ b/testsuite/misc-ming.all/Makefile.am 2009-07-15 16:43:17 +0000
@@ -79,6 +79,7 @@
DefineTextTest-Runner \
TextSnapshotTest \
DeviceFontTest \
+ EmbeddedFontTest \
DefineEditTextTest \
DefineEditTextTest-Runner \
DefineEditTextVariableNameTest \
@@ -243,6 +244,8 @@
endif
check_SCRIPTS = \
+ DeviceFontTestRunner \
+ EmbeddedFontTestRunner \
TextSnapshotTest-Runner \
timeline_var_test-Runner \
place_object_testrunner \
@@ -407,11 +410,22 @@
sh $< $(top_builddir) TextSnapshotTest.swf > $@
chmod 755 $@
+DeviceFontTestRunner: $(srcdir)/../generic-testrunner.sh DeviceFontTest.swf
+ sh $< $(top_builddir) DeviceFontTest.swf > $@
+ chmod 755 $@
DeviceFontTest.swf: DeviceFontTest
./DeviceFontTest $(top_srcdir)/testsuite/media
DeviceFontTest_SOURCES = DeviceFontTest.c
DeviceFontTest_LDADD = libgnashmingutils.la
+EmbeddedFontTestRunner: $(srcdir)/../generic-testrunner.sh EmbeddedFontTest.swf
+ sh $< $(top_builddir) EmbeddedFontTest.swf > $@
+ chmod 755 $@
+EmbeddedFontTest.swf: EmbeddedFontTest
+ ./EmbeddedFontTest $(top_srcdir)/testsuite/media
+EmbeddedFontTest_SOURCES = EmbeddedFontTest.c
+EmbeddedFontTest_LDADD = libgnashmingutils.la
+
DefineEditTextTest.swf: DefineEditTextTest
./DefineEditTextTest $(top_srcdir)/testsuite/media
DefineEditTextTest_SOURCES = DefineEditTextTest.c
@@ -1950,6 +1964,8 @@
TEST_DRIVERS = ../simple.exp
TEST_CASES = \
LoadVarsTestRunner \
+ DeviceFontTestRunner \
+ EmbeddedFontTestRunner \
DefineEditTextVariableNameTest-Runner \
DefineEditTextVariableNameTest2-Runner \
DefineTextTest-Runner \
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r11262: Add some basic TextField display tests with automatic testing of AS,
Benjamin Wolsey <=