gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r10657: Initial cleanup, testing, a


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r10657: Initial cleanup, testing, and corrections to TextSnapshot class.
Date: Wed, 04 Mar 2009 20:06:14 +0100
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 10657
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Wed 2009-03-04 20:06:14 +0100
message:
  Initial cleanup, testing, and corrections to TextSnapshot class.
modified:
  libcore/asobj/ClassHierarchy.cpp
  libcore/asobj/TextSnapshot_as.cpp
  libcore/asobj/TextSnapshot_as.h
  libcore/builtin_function.h
  testsuite/actionscript.all/TextSnapshot.as
  testsuite/swfdec/PASSING
    ------------------------------------------------------------
    revno: 10652.1.1
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Wed 2009-03-04 18:18:34 +0100
    message:
      Test TextSnapshot AS behaviour.
    modified:
      testsuite/actionscript.all/TextSnapshot.as
    ------------------------------------------------------------
    revno: 10652.1.2
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Wed 2009-03-04 18:25:51 +0100
    message:
      check->xcheck
    modified:
      testsuite/actionscript.all/TextSnapshot.as
    ------------------------------------------------------------
    revno: 10652.1.3
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Wed 2009-03-04 18:52:33 +0100
    message:
      Clean up TextSnapshot, minor corrections to initialization and visibility.
      First XPASS in TextSnapshot.as.
    modified:
      libcore/asobj/ClassHierarchy.cpp
      libcore/asobj/TextSnapshot_as.cpp
      libcore/asobj/TextSnapshot_as.h
      testsuite/actionscript.all/TextSnapshot.as
    ------------------------------------------------------------
    revno: 10652.1.4
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Wed 2009-03-04 19:28:12 +0100
    message:
      Get TextSnapshot properties correct. Passes in swfdec.
    modified:
      libcore/asobj/TextSnapshot_as.cpp
      testsuite/swfdec/PASSING
=== modified file 'libcore/asobj/ClassHierarchy.cpp'
--- a/libcore/asobj/ClassHierarchy.cpp  2009-02-10 15:38:43 +0000
+++ b/libcore/asobj/ClassHierarchy.cpp  2009-03-04 17:52:33 +0000
@@ -306,7 +306,8 @@
        { TextFormat_as::init, NSV::CLASS_TEXT_FORMAT, NSV::CLASS_OBJECT, 
NS_GLOBAL, 5 },
        { key_class_init, NSV::CLASS_KEY, NSV::CLASS_OBJECT, NS_GLOBAL, 5 },
        { AsBroadcaster::init, NSV::CLASS_AS_BROADCASTER, NSV::CLASS_OBJECT, 
NS_GLOBAL, 5 },
-       { textsnapshot_class_init, NSV::CLASS_TEXT_SNAPSHOT, NSV::CLASS_OBJECT, 
NSV::NS_FLASH_TEXT, 6 },
+       { TextSnapshot_as::init, NSV::CLASS_TEXT_SNAPSHOT, NSV::CLASS_OBJECT,
+        NSV::NS_FLASH_TEXT, 5 },
        { video_class_init, NSV::CLASS_VIDEO, NSV::CLASS_OBJECT, 
NSV::NS_FLASH_MEDIA, 6 },
        { camera_class_init, NSV::CLASS_CAMERA, NSV::CLASS_OBJECT, 
NSV::NS_FLASH_UI, 6 },
        { microphone_class_init, NSV::CLASS_MICROPHONE, NSV::CLASS_OBJECT, 
NSV::NS_FLASH_UI, 6 },

=== modified file 'libcore/asobj/TextSnapshot_as.cpp'
--- a/libcore/asobj/TextSnapshot_as.cpp 2009-02-25 22:33:03 +0000
+++ b/libcore/asobj/TextSnapshot_as.cpp 2009-03-04 18:28:12 +0000
@@ -31,33 +31,75 @@
 
 namespace gnash {
 
-as_value textsnapshot_findtext(const fn_call& fn);
-as_value textsnapshot_getcount(const fn_call& fn);
-as_value textsnapshot_getselected(const fn_call& fn);
-as_value textsnapshot_getselectedtext(const fn_call& fn);
-as_value textsnapshot_gettext(const fn_call& fn);
-as_value textsnapshot_hittesttextnearpos(const fn_call& fn);
-as_value textsnapshot_setselectcolor(const fn_call& fn);
-as_value textsnapshot_setselected(const fn_call& fn);
-as_value textsnapshot_ctor(const fn_call& fn);
-
-static void
+// Forward declarations
+namespace {
+
+    as_value textsnapshot_findText(const fn_call& fn);
+    as_value textsnapshot_getCount(const fn_call& fn);
+    as_value textsnapshot_getSelected(const fn_call& fn);
+    as_value textsnapshot_getSelectedText(const fn_call& fn);
+    as_value textsnapshot_getTextRunInfo(const fn_call& fn);
+    as_value textsnapshot_getText(const fn_call& fn);
+    as_value textsnapshot_hitTestTextNearPos(const fn_call& fn);
+    as_value textsnapshot_setSelectColor(const fn_call& fn);
+    as_value textsnapshot_setSelected(const fn_call& fn);
+    as_value textsnapshot_ctor(const fn_call& fn);
+
+    void attachTextSnapshotInterface(as_object& o);
+    as_object* getTextSnapshotInterface();
+}
+
+TextSnapshot_as::TextSnapshot_as()
+    :
+    as_object(getTextSnapshotInterface())
+{
+}
+
+void
+TextSnapshot_as::init(as_object& global)
+{
+       // This is going to be the global TextSnapshot "class"/"function"
+       static boost::intrusive_ptr<builtin_function> cl;
+
+       if ( cl == NULL )
+       {
+               cl=new builtin_function(&textsnapshot_ctor, 
getTextSnapshotInterface());
+       }
+
+       // Register _global.TextSnapshot
+       global.init_member("TextSnapshot", cl.get());
+}
+
+
+namespace {
+
+void
 attachTextSnapshotInterface(as_object& o)
 {
-       // FIXME: check name case of all methods, and only initialize
-       //        the ones expected to be found based on SWF version
-
-       o.init_member("findText", new builtin_function(textsnapshot_findtext));
-       o.init_member("getCount", new builtin_function(textsnapshot_getcount));
-       o.init_member("getSelected", new 
builtin_function(textsnapshot_getselected));
-       o.init_member("getSelectedText", new 
builtin_function(textsnapshot_getselectedtext));
-       o.init_member("getText", new builtin_function(textsnapshot_gettext));
-       o.init_member("hitTestTextNearPos", new 
builtin_function(textsnapshot_hittesttextnearpos));
-       o.init_member("setSelectColor", new 
builtin_function(textsnapshot_setselectcolor));
-       o.init_member("setSelected", new 
builtin_function(textsnapshot_setselected));
+
+    const int flags = as_prop_flags::onlySWF6Up;
+
+       o.init_member("findText", new builtin_function(textsnapshot_findText),
+            flags);
+       o.init_member("getCount", new builtin_function(textsnapshot_getCount),
+            flags);
+       o.init_member("getTextRunInfo",
+            new builtin_function(textsnapshot_getTextRunInfo), flags);
+       o.init_member("getSelected",
+            new builtin_function(textsnapshot_getSelected), flags);
+       o.init_member("getSelectedText",
+            new builtin_function(textsnapshot_getSelectedText), flags);
+       o.init_member("getText",
+            new builtin_function(textsnapshot_getText), flags);
+       o.init_member("hitTestTextNearPos",
+            new builtin_function(textsnapshot_hitTestTextNearPos), flags);
+       o.init_member("setSelectColor",
+            new builtin_function(textsnapshot_setSelectColor), flags);
+       o.init_member("setSelected",
+            new builtin_function(textsnapshot_setSelected), flags);
 }
 
-static as_object*
+as_object*
 getTextSnapshotInterface()
 {
        static boost::intrusive_ptr<as_object> o;
@@ -69,52 +111,39 @@
        return o.get();
 }
 
-class textsnapshot_as_object: public as_object
-{
-
-public:
-
-       textsnapshot_as_object()
-               :
-               as_object(getTextSnapshotInterface())
-       {}
-
-       // override from as_object ?
-       //std::string get_text_value() const { return "TextSnapshot"; }
-
-       // override from as_object ?
-       //double get_numeric_value() const { return 0; }
-};
-
-as_value textsnapshot_findtext(const fn_call& /*fn*/) {
-    log_unimpl (__FUNCTION__);
-    return as_value();
-}
-as_value textsnapshot_getcount(const fn_call& /*fn*/) {
-    log_unimpl (__FUNCTION__);
-    return as_value();
-}
-as_value textsnapshot_getselected(const fn_call& /*fn*/) {
-    log_unimpl (__FUNCTION__);
-    return as_value();
-}
-as_value textsnapshot_getselectedtext(const fn_call& /*fn*/) {
-    log_unimpl (__FUNCTION__);
-    return as_value();
-}
-as_value textsnapshot_gettext(const fn_call& /*fn*/) {
-    log_unimpl (__FUNCTION__);
-    return as_value();
-}
-as_value textsnapshot_hittesttextnearpos(const fn_call& /*fn*/) {
-    log_unimpl (__FUNCTION__);
-    return as_value();
-}
-as_value textsnapshot_setselectcolor(const fn_call& /*fn*/) {
-    log_unimpl (__FUNCTION__);
-    return as_value();
-}
-as_value textsnapshot_setselected(const fn_call& /*fn*/) {
+as_value textsnapshot_getTextRunInfo(const fn_call& /*fn*/) {
+    log_unimpl (__FUNCTION__);
+    return as_value();
+}
+as_value textsnapshot_findText(const fn_call& /*fn*/) {
+    log_unimpl (__FUNCTION__);
+    return as_value();
+}
+as_value textsnapshot_getCount(const fn_call& /*fn*/) {
+    log_unimpl (__FUNCTION__);
+    return as_value();
+}
+as_value textsnapshot_getSelected(const fn_call& /*fn*/) {
+    log_unimpl (__FUNCTION__);
+    return as_value();
+}
+as_value textsnapshot_getSelectedText(const fn_call& /*fn*/) {
+    log_unimpl (__FUNCTION__);
+    return as_value();
+}
+as_value textsnapshot_getText(const fn_call& /*fn*/) {
+    log_unimpl (__FUNCTION__);
+    return as_value();
+}
+as_value textsnapshot_hitTestTextNearPos(const fn_call& /*fn*/) {
+    log_unimpl (__FUNCTION__);
+    return as_value();
+}
+as_value textsnapshot_setSelectColor(const fn_call& /*fn*/) {
+    log_unimpl (__FUNCTION__);
+    return as_value();
+}
+as_value textsnapshot_setSelected(const fn_call& /*fn*/) {
     log_unimpl (__FUNCTION__);
     return as_value();
 }
@@ -122,27 +151,11 @@
 as_value
 textsnapshot_ctor(const fn_call& /* fn */)
 {
-       boost::intrusive_ptr<as_object> obj = new textsnapshot_as_object;
+       boost::intrusive_ptr<as_object> obj = new TextSnapshot_as;
 
        return as_value(obj.get()); // will keep alive
 }
 
-// extern (used by Global.cpp)
-void textsnapshot_class_init(as_object& global)
-{
-       // This is going to be the global TextSnapshot "class"/"function"
-       static boost::intrusive_ptr<builtin_function> cl;
-
-       if ( cl == NULL )
-       {
-               cl=new builtin_function(&textsnapshot_ctor, 
getTextSnapshotInterface());
-               // replicate all interface to class, to be able to access
-               // all methods as static functions
-               attachTextSnapshotInterface(*cl);
-       }
-
-       // Register _global.TextSnapshot
-       global.init_member("TextSnapshot", cl.get());
-}
-
+
+} // anonymous namespace
 } // end of gnash namespace

=== modified file 'libcore/asobj/TextSnapshot_as.h'
--- a/libcore/asobj/TextSnapshot_as.h   2009-02-25 22:33:03 +0000
+++ b/libcore/asobj/TextSnapshot_as.h   2009-03-04 17:52:33 +0000
@@ -16,23 +16,24 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-#ifndef __GNASH_ASOBJ_TEXTSNAPSHOT_H__
-#define __GNASH_ASOBJ_TEXTSNAPSHOT_H__
+#ifndef GNASH_ASOBJ_TEXTSNAPSHOT_H
+#define GNASH_ASOBJ_TEXTSNAPSHOT_H
 
-#include <memory> // for auto_ptr
+#include "as_object.h"
 
 namespace gnash {
 
-class as_object;
-
-/// Initialize the global TextSnapshot_as class
-void textsnapshot_class_init(as_object& global);
-
-/// Return a TextSnapshot_as instance (in case the core lib needs it)
-//std::auto_ptr<as_object> init_textsnapshot_instance();
+class TextSnapshot_as: public as_object
+{
+
+public:
+
+       TextSnapshot_as();
+
+    static void init(as_object& global);
+};
 
 } // end of gnash namespace
 
-// __GNASH_ASOBJ_TEXTSNAPSHOT_H__
 #endif
 

=== modified file 'libcore/builtin_function.h'
--- a/libcore/builtin_function.h        2009-02-25 22:33:03 +0000
+++ b/libcore/builtin_function.h        2009-03-04 19:06:14 +0000
@@ -15,8 +15,8 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-#ifndef __GNASH_BUILTIN_FUNCTION_H__
-#define __GNASH_BUILTIN_FUNCTION_H__
+#ifndef GNASH_BUILTIN_FUNCTION_H
+#define GNASH_BUILTIN_FUNCTION_H
 
 #include "as_function.h" // for inheritance
 #include "fn_call.h" // for call operator

=== modified file 'testsuite/actionscript.all/TextSnapshot.as'
--- a/testsuite/actionscript.all/TextSnapshot.as        2009-02-25 22:33:03 
+0000
+++ b/testsuite/actionscript.all/TextSnapshot.as        2009-03-04 17:52:33 
+0000
@@ -20,42 +20,208 @@
 // compile this test case with Ming makeswf, and then
 // execute it like this gnash -1 -r 0 -v out.swf
 
+// TextSnapshot works only on static text, so this test file only tests
+// AS compatibility (return, argument handling).
+
 
 rcsid="$Id: TextSnapshot.as,v 1.12 2008/03/11 19:31:48 strk Exp $";
 #include "check.as"
 
-#if OUTPUT_VERSION > 5
-
-check_equals ( typeof(TextSnapshot), 'function' );
-
-var textsnapshotObj = new TextSnapshot;
-
-// test the TextSnapshot constuctor
-check_equals ( typeof(textsnapshotObj), 'object' );
-
-// test the TextSnapshot::findtext method
-check_equals (typeof(textsnapshotObj.findText), 'function');
-
-// test the TextSnapshot::getcount method
-check_equals (typeof(textsnapshotObj.getCount), 'function');
-
-// test the TextSnapshot::getselected method
-check_equals (typeof(textsnapshotObj.getSelected), 'function');
-
-// test the TextSnapshot::getselectedtext method
-check_equals (typeof(textsnapshotObj.getSelectedText), 'function');
-
-// test the TextSnapshot::gettext method
-check_equals (typeof(textsnapshotObj.getText), 'function');
-
-// test the TextSnapshot::hittesttextnearpos method
-check_equals (typeof(textsnapshotObj.hitTestTextNearPos), 'function');
-
-// test the TextSnapshot::setselectcolor method
-check_equals (typeof(textsnapshotObj.setSelectColor), 'function');
-
-// test the TextSnapshot::setselected method
-check_equals (typeof(textsnapshotObj.setSelected), 'function');
+#if OUTPUT_VERSION < 6
+
+ check_equals(typeof(TextSnapshot), "function");
+ totals(1);
+
+#else
+
+ check(TextSnapshot.prototype.hasOwnProperty('findText'));
+ check(TextSnapshot.prototype.hasOwnProperty('getCount'));
+ check(TextSnapshot.prototype.hasOwnProperty('getSelected'));
+ check(TextSnapshot.prototype.hasOwnProperty('getSelectedText'));
+ check(TextSnapshot.prototype.hasOwnProperty('getText'));
+ check(TextSnapshot.prototype.hasOwnProperty('setSelectColor'));
+ check(TextSnapshot.prototype.hasOwnProperty('hitTestTextNearPos'));
+ check(TextSnapshot.prototype.hasOwnProperty('setSelected'));
+
+ check_equals( typeof(TextSnapshot), 'function' );
+ 
+ var textsnapshotObj = new TextSnapshot;
+
+ check(textsnapshotObj instanceof TextSnapshot);
+ check(!textsnapshotObj.hasOwnProperty('findText'));
+ check(!textsnapshotObj.hasOwnProperty('getCount'));
+ check(!textsnapshotObj.hasOwnProperty('getSelected'));
+ check(!textsnapshotObj.hasOwnProperty('getSelectedText'));
+ check(!textsnapshotObj.hasOwnProperty('getText'));
+ check(!textsnapshotObj.hasOwnProperty('setSelectColor'));
+ check(!textsnapshotObj.hasOwnProperty('hitTestTextNearPos'));
+ check(!textsnapshotObj.hasOwnProperty('setSelected'));
+
+ // test the TextSnapshot constuctor
+ check_equals( typeof(textsnapshotObj), 'object' );
+ 
+ check_equals(typeof(textsnapshotObj.findText), 'function');
+ check_equals(typeof(textsnapshotObj.getCount), 'function');
+ check_equals(typeof(textsnapshotObj.getSelected), 'function');
+ check_equals(typeof(textsnapshotObj.getSelectedText), 'function');
+ check_equals (typeof(textsnapshotObj.getText), 'function');
+ check_equals (typeof(textsnapshotObj.hitTestTextNearPos), 'function');
+ check_equals (typeof(textsnapshotObj.setSelectColor), 'function');
+ check_equals (typeof(textsnapshotObj.setSelected), 'function');
+
+ ts = _root.getTextSnapshot();
+ xcheck(ts instanceof TextSnapshot);
+ check(!ts.hasOwnProperty('findText'));
+ check(!ts.hasOwnProperty('getCount'));
+ check(!ts.hasOwnProperty('getSelected'));
+ check(!ts.hasOwnProperty('getSelectedText'));
+ check(!ts.hasOwnProperty('getText'));
+ check(!ts.hasOwnProperty('setSelectColor'));
+ check(!ts.hasOwnProperty('hitTestTextNearPos'));
+ check(!ts.hasOwnProperty('setSelected'));
+
+ // getText() and getCount()
+
+ xcheck_equals(typeof(ts.getCount()), "number");
+ check_equals(typeof(ts.getCount(0)), "undefined");
+ check_equals(typeof(ts.getCount("a")), "undefined");
+ check_equals(typeof(ts.getCount(true)), "undefined");
+ check_equals(typeof(ts.getCount(0, 1)), "undefined");
+ xcheck_equals(ts.getCount(), 0);
+
+ check_equals(typeof(ts.findText()), "undefined");
+ check_equals(typeof(ts.findText("a")), "undefined");
+ check_equals(typeof(ts.findText(1)), "undefined");
+ check_equals(typeof(ts.findText(1, "a")), "undefined");
+
+ // Test with no text.
+ xcheck_equals(typeof(ts.findText(1, "a", true)), "number");
+ xcheck_equals(typeof(ts.findText(1, "a", 1)), "number");
+ xcheck_equals(typeof(ts.findText(1, "a", new Date())), "number");
+ xcheck_equals(typeof(ts.findText("6", "a", new Date())), "number");
+ xcheck_equals(typeof(ts.findText("b", "a", new Date())), "number");
+ xcheck_equals(typeof(ts.findText(-1, "a", new Date())), "number");
+ xcheck_equals(typeof(ts.findText(Infinity, "a", new Date())), "number");
+ check_equals(typeof(ts.findText(-1, "a", new Date(), "e")), "undefined");
+ check_equals(typeof(ts.findText(Infinity, "a", new Date(), 3)), "undefined");
+
+ xcheck_equals(ts.findText(1, "a", true), -1);
+ xcheck_equals(ts.findText(1, "a", 1), -1);
+ xcheck_equals(ts.findText(1, "a", new Date()), -1);
+ xcheck_equals(ts.findText("6", "a", false), -1);
+ xcheck_equals(ts.findText("b", "a", true), -1);
+ xcheck_equals(ts.findText(-1, "a", new Date()), -1);
+ xcheck_equals(ts.findText(Infinity, "a", new Date()), -1);
+
+ // Shouldn't work with dynamic text.
+ _root.createTextField("tf", 10, 30, 30, 100, 100);
+ _root.tf.text = "ghjkab";
+ ts = _root.getTextSnapshot();
+ xcheck_equals(ts.getCount(), 0);
+ xcheck_equals(ts.findText(1, "a", true), -1);
+ xcheck_equals(ts.findText(1, "a", false), -1);
+
+ // getSelected
+
+ check_equals(typeof(ts.getSelected()), "undefined");
+ check_equals(typeof(ts.getSelected(0)), "undefined");
+ check_equals(typeof(ts.getSelected("a")), "undefined");
+ check_equals(typeof(ts.getSelected(new Date())), "undefined");
+ check_equals(typeof(ts.getSelected([0, 1])), "undefined");
+ xcheck_equals(typeof(ts.getSelected([0, 1], 2)), "boolean");
+ xcheck_equals(typeof(ts.getSelected(0, 1)), "boolean");
+ xcheck_equals(typeof(ts.getSelected(1, 0)), "boolean");
+ xcheck_equals(typeof(ts.getSelected(-1, 3)), "boolean");
+ xcheck_equals(typeof(ts.getSelected(1, 0)), "boolean");
+ xcheck_equals(typeof(ts.getSelected(1, 0)), "boolean");
+ xcheck_equals(typeof(ts.getSelected(0, "a")), "boolean");
+ xcheck_equals(typeof(ts.getSelected("b", 0)), "boolean");
+ xcheck_equals(typeof(ts.getSelected(true, false)), "boolean");
+ check_equals(typeof(ts.getSelected(0, 10, 10)), "undefined");
+ check_equals(typeof(ts.getSelected(0, 10, true)), "undefined");
+ check_equals(typeof(ts.getSelected(0, 10, "a")), "undefined");
+
+ xcheck_equals(typeof(ts.getSelectedText()), "string");
+ xcheck_equals(typeof(ts.getSelectedText(0)), "string");
+ xcheck_equals(typeof(ts.getSelectedText("a")), "string");
+ xcheck_equals(typeof(ts.getSelectedText(new Date())), "string");
+ xcheck_equals(typeof(ts.getSelectedText([0, 2])), "string");
+ check_equals(typeof(ts.getSelectedText(0, 1)), "undefined");
+ check_equals(typeof(ts.getSelectedText(1, 0)), "undefined");
+ check_equals(typeof(ts.getSelectedText(-1, 3)), "undefined");
+ check_equals(typeof(ts.getSelectedText(1, 0)), "undefined");
+ check_equals(typeof(ts.getSelectedText(1, 0)), "undefined");
+ check_equals(typeof(ts.getSelectedText(0, "a")), "undefined");
+ check_equals(typeof(ts.getSelectedText("b", 0)), "undefined");
+ check_equals(typeof(ts.getSelectedText(true, false)), "undefined");
+ check_equals(typeof(ts.getSelectedText(0, 10, 10)), "undefined");
+ check_equals(typeof(ts.getSelectedText(0, 10, true)), "undefined");
+ check_equals(typeof(ts.getSelectedText(0, 10, "a")), "undefined");
+
+ check_equals(typeof(ts.getText()), "undefined");
+ check_equals(typeof(ts.getText(0)), "undefined");
+ check_equals(typeof(ts.getText("a")), "undefined");
+ check_equals(typeof(ts.getText(new Date())), "undefined");
+ xcheck_equals(typeof(ts.getText(0, 1)), "string");
+ xcheck_equals(typeof(ts.getText(1, 0)), "string");
+ xcheck_equals(typeof(ts.getText(-1, 3)), "string");
+ xcheck_equals(typeof(ts.getText(1, 0)), "string");
+ xcheck_equals(typeof(ts.getText(1, 0)), "string");
+ xcheck_equals(typeof(ts.getText(0, "a")), "string");
+ xcheck_equals(typeof(ts.getText("b", 0)), "string");
+ xcheck_equals(typeof(ts.getText(true, false)), "string");
+ xcheck_equals(typeof(ts.getText(0, 10, 10)), "string");
+ xcheck_equals(typeof(ts.getText(0, 10, true)), "string");
+ check_equals(typeof(ts.getText(0, 10, "a", 11)), "undefined");
+ check_equals(typeof(ts.getText(0, 10, 10, "hello")), "undefined");
+ check_equals(typeof(ts.getText(0, 10, true, [3, 4])), "undefined");
+
+ // setSelectColor(). Returns void
+ check_equals(typeof(ts.setSelectColor()), "undefined");
+ check_equals(typeof(ts.setSelectColor(0)), "undefined");
+ check_equals(typeof(ts.setSelectColor(0, 4)), "undefined");
+ check_equals(typeof(ts.setSelectColor(0, 5, 6)), "undefined");
+ check_equals(typeof(ts.setSelectColor(0, 5, true)), "undefined");
+ check_equals(typeof(ts.setSelectColor(0, 5, 8, 5)), "undefined");
+
+ // hitTestTextNearPos()
+ check_equals(typeof(ts.hitTestTextNearPos()), "undefined");
+ check_equals(typeof(ts.hitTestTextNearPos(0)), "undefined");
+ check_equals(typeof(ts.hitTestTextNearPos("a")), "undefined");
+ check_equals(typeof(ts.hitTestTextNearPos(new Date())), "undefined");
+ xcheck_equals(typeof(ts.hitTestTextNearPos(0, 1)), "number");
+ xcheck_equals(typeof(ts.hitTestTextNearPos(1, 0)), "number");
+ xcheck_equals(typeof(ts.hitTestTextNearPos(-1, 3)), "number");
+ xcheck_equals(typeof(ts.hitTestTextNearPos(1, 0)), "number");
+ xcheck_equals(typeof(ts.hitTestTextNearPos(1, 0)), "number");
+ xcheck_equals(typeof(ts.hitTestTextNearPos(0, "a")), "number");
+ xcheck_equals(typeof(ts.hitTestTextNearPos("b", 0)), "number");
+ xcheck_equals(typeof(ts.hitTestTextNearPos(true, false)), "number");
+ xcheck_equals(typeof(ts.hitTestTextNearPos(0, 10, 10)), "number");
+ xcheck_equals(typeof(ts.hitTestTextNearPos(0, 10, true)), "number");
+ check_equals(typeof(ts.hitTestTextNearPos(0, 10, "a", 11)), "undefined");
+ check_equals(typeof(ts.hitTestTextNearPos(0, 10, 10, "hello")), "undefined");
+ check_equals(typeof(ts.hitTestTextNearPos(0, 10, true, [3, 4])), "undefined");
+ 
+ // setSelected() // Three arguments, returns void.
+ check_equals(typeof(ts.setSelected()), "undefined");
+ check_equals(typeof(ts.setSelected(0)), "undefined");
+ check_equals(typeof(ts.setSelected("a")), "undefined");
+ check_equals(typeof(ts.setSelected(new Date())), "undefined");
+ check_equals(typeof(ts.setSelected(0, 1)), "undefined");
+ check_equals(typeof(ts.setSelected(1, 0)), "undefined");
+ check_equals(typeof(ts.setSelected(-1, 3)), "undefined");
+ check_equals(typeof(ts.setSelected(1, 0)), "undefined");
+ check_equals(typeof(ts.setSelected(1, 0)), "undefined");
+ check_equals(typeof(ts.setSelected(0, "a")), "undefined");
+ check_equals(typeof(ts.setSelected("b", 0)), "undefined");
+ check_equals(typeof(ts.setSelected(true, false)), "undefined");
+ check_equals(typeof(ts.setSelected(0, 10, 10)), "undefined");
+ check_equals(typeof(ts.setSelected(0, 10, true)), "undefined");
+ check_equals(typeof(ts.setSelected(0, 10, "a", 11)), "undefined");
+ check_equals(typeof(ts.setSelected(0, 10, 10, "hello")), "undefined");
+ check_equals(typeof(ts.setSelected(0, 10, true, [3, 4])), "undefined");
+
+ totals(155);
 
 #endif // OUTPUT_VERSION > 5
-totals();

=== modified file 'testsuite/swfdec/PASSING'
--- a/testsuite/swfdec/PASSING  2009-02-27 11:55:27 +0000
+++ b/testsuite/swfdec/PASSING  2009-03-04 18:28:12 +0000
@@ -1187,6 +1187,10 @@
 text-field-type-of-8.swf:bac748e2b13ba9331c27f5ee45109ac4
 textformat-init-5.swf:52dec30885359d5bdda450588076eb10
 textformat-init-5.swf:d45b857148b96635af7d18855cb067ae
+text-snapshot-properties-5.swf:caf502463913e8aa1959715f629b92aa
+text-snapshot-properties-6.swf:b17d4634477fa1e2a5a095fba489d3ed
+text-snapshot-properties-7.swf:48ce09024d43af945101025c62b9848a
+text-snapshot-properties-8.swf:3dfb40092d92a73d1de1f0a23d047818
 this-localfunction-5.swf:f19b0894fdb355070a7358904536a4f4
 this-localfunction-6.swf:02e2d34657330766997697cc52f3f2cf
 this-localfunction-7.swf:9f25bfae3408892742d94ca208e035ac


reply via email to

[Prev in Thread] Current Thread [Next in Thread]