[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r10222: Tests for TextField.
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r10222: Tests for TextField. |
Date: |
Mon, 03 Nov 2008 19:25:59 +0100 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 10222
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Mon 2008-11-03 19:25:59 +0100
message:
Tests for TextField.
modified:
testsuite/actionscript.all/TextField.as
testsuite/misc-ming.all/DefineEditTextTest.c
=== modified file 'testsuite/actionscript.all/TextField.as'
--- a/testsuite/actionscript.all/TextField.as 2008-09-24 21:32:40 +0000
+++ b/testsuite/actionscript.all/TextField.as 2008-11-03 18:25:59 +0000
@@ -35,7 +35,31 @@
TextField.prototype.getBounds = MovieClip.prototype.getBounds;
-#if OUTPUT_VERSION > 5
+
+// check that the dejagnu clip is *not* a TextField, which is why the
+// following prototype properties are not yet initialized.
+#if OUTPUT_VERSION > 6
+ check_equals(_root.getInstanceAtDepth(-16383), _level0.__shared_assets);
+ xcheck(!_level0.__shared_assets.instance1._xtrace_win instanceof TextField);
+ xcheck_equals(typeof(_level0.__shared_assets.instance1._xtrace_win),
+ "movieclip");
+ note(_level0.__shared_assets.instance1._xtrace_win.toString());
+#endif
+
+#if OUTPUT_VERSION < 6
+
+ check_equals(typeof(TextField), 'function');
+ check_equals(TextField.prototype, undefined);
+ createTextField("tf", 50, 10, 10, 10, 10);
+ xcheck_equals(typeof(tf), "movieclip");
+ xcheck_equals(tf.__proto__.toString(), "[object Object]");
+ check(!tf instanceOf TextField);
+
+ tf = new TextField();
+ xcheck(tf instanceOf TextField);
+ totals();
+
+#else
check_equals(typeof(TextField), 'function');
check_equals(typeof(TextField.prototype), 'object');
@@ -127,6 +151,7 @@
check_equals(ret, _root.tf);
#endif
+check(tf instanceof TextField);
check_equals(typeof(tf), 'object');
check(tf.hasOwnProperty('_listeners'));
check_equals(tf._listeners.length, 1); // adds self to the listeners
@@ -152,7 +177,7 @@
xcheck( TextField.prototype.hasOwnProperty('maxscroll') );
xcheck( TextField.prototype.hasOwnProperty('multiline') );
xcheck( TextField.prototype.hasOwnProperty('password') );
-xcheck( TextField.prototype.hasOwnProperty('restrict') );
+cxheck( TextField.prototype.hasOwnProperty('restrict') );
xcheck( TextField.prototype.hasOwnProperty('scroll') );
check( TextField.prototype.hasOwnProperty('selectable') );
xcheck( TextField.prototype.hasOwnProperty('text') );
@@ -349,6 +374,14 @@
tf.text = "0123456789";
// no effect (maybe only limits user input)
check_equals(tf.text, "0123456789");
+tf.maxChars = "string";
+xcheck_equals(typeof(tf.maxChars), "null");
+tf.maxChars = -6;
+check_equals(typeof(tf.maxChars), "number");
+check_equals(tf.maxChars, -6);
+tf.maxChars = 0;
+xcheck_equals(typeof(tf.maxChars), "null");
+
tf.maxChars = null;
// Check TextField.maxhscroll
@@ -370,6 +403,7 @@
// Check TextField.multiline
xcheck_equals(typeof(tf.multiline), 'boolean');
+xcheck_equals(tf.multiline, false);
check(!tf.hasOwnProperty('multiline'));
xcheck_equals(tf.multiline, false);
tf.multiline = true;
@@ -420,11 +454,32 @@
// Check TextField.password
//-------------------------------------------------------------------------
+// This verifies it really uses to_bool.
+
xcheck_equals(typeof(tf.password), 'boolean');
+xcheck_equals(tf.password, false);
check(!tf.hasOwnProperty('password'));
xcheck_equals(tf.password, false);
tf.password = true;
check_equals(tf.password, true);
+tf.password = 7;
+xcheck_equals(tf.password, true);
+tf.password = "string";
+#if OUTPUT_VERSION > 6
+xcheck_equals(tf.password, true);
+#else
+xcheck_equals(tf.password, false);
+#endif
+tf.password = 0;
+check_equals(tf.password, false);
+tf.password = "a string";
+#if OUTPUT_VERSION > 6
+xcheck_equals(tf.password, true);
+#else
+xcheck_equals(tf.password, false);
+#endif
+tf.password = undefined;
+xcheck_equals(tf.password, false);
// TODO: check effects of setting to 'password' (should hide characters)
tf.password = false;
@@ -948,14 +1003,12 @@
// END OF TESTS
//------------------------------------------------------------
-#if OUTPUT_VERSION < 8
- check_totals(426);
-#else
- check_totals(427);
+#if OUTPUT_VERSION == 6
+ check_totals(437);
+#elif OUTPUT_VERSION == 7
+ check_totals(440);
+#elif OUTPUT_VERSION == 8
+ check_totals(441);
#endif
-
-#else // OUTPUT_VERSION <= 5
-
- totals();
#endif
=== modified file 'testsuite/misc-ming.all/DefineEditTextTest.c'
--- a/testsuite/misc-ming.all/DefineEditTextTest.c 2008-05-16 19:49:46
+0000
+++ b/testsuite/misc-ming.all/DefineEditTextTest.c 2008-11-03 18:25:59
+0000
@@ -132,13 +132,18 @@
SWFMovie_add(mo, (SWFBlock)dejagnuclip);
SWFMovie_nextFrame(mo); // 1st frame
- // checks before placing any swf defined TextField
- // Note: the dejagnuclip already placed some texts, so the following
- // does not work.
- //check(mo, "!TextField.prototype.hasOwnProperty('background')");
- //check(mo, "!TextField.prototype.hasOwnProperty('backgroundColor')");
- //check(mo, "!TextField.prototype.hasOwnProperty('text')");
- //check(mo, "!TextField.prototype.hasOwnProperty('textColor')");
+ // Check that the dejagnu clip is really a TextField.
+ check_equals(mo, "_root.getInstanceAtDepth(-16383)",
+ "_level0.instance1");
+ check(mo, "_level0.instance1._xtrace_win "
+ "instanceof TextField");
+
+ // Note: the dejagnuclip already placed some texts, so the following
+ // should be true.
+ check(mo, "TextField.prototype.hasOwnProperty('background')");
+ check(mo, "TextField.prototype.hasOwnProperty('backgroundColor')");
+ xcheck(mo, "TextField.prototype.hasOwnProperty('text')");
+ check(mo, "TextField.prototype.hasOwnProperty('textColor')");
/*********************************************
*
@@ -172,9 +177,13 @@
check_equals(mo, "dtext1.embedFonts", "false");
check_equals(mo, "etext1.embedFonts", "true");
+ check_equals(mo, "etext1.hasOwnProperty('embedFonts')", "false");
+
+ add_actions(mo, "createTextField('dynamictext1', 99, 10, 10, 10, 10);");
check_equals(mo, "dtext1.__proto__", "TextField.prototype");
check_equals(mo, "etext1.__proto__", "TextField.prototype");
+ check_equals(mo, "etext1.__proto__", "dynamictext1.__proto__");
// checks after placing some swf defined TextField
check(mo, "TextField.prototype.hasOwnProperty('background')");
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r10222: Tests for TextField.,
Benjamin Wolsey <=