gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ./ChangeLog doc/C/localconnection.xml plu...


From: Rob Savoye
Subject: [Gnash-commit] gnash ./ChangeLog doc/C/localconnection.xml plu...
Date: Sun, 05 Feb 2006 22:17:50 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Branch:         
Changes by:     Rob Savoye <address@hidden>     06/02/05 22:17:50

Modified files:
        .              : ChangeLog 
        doc/C          : localconnection.xml 
        plugin         : player.cpp plugin.cpp plugin.h 
        server         : xml.cpp xml.h 
        testsuite/actionscript.all: XML.as 

Log message:
        * plugin/plugin.cpp (NewStream): Add support to parse the options
        passed in when the plugin is invoked to play a stream. Add special
        debug flags so we can attach GDB at leisure and not have to screw
        with loading shared libraries.
        * server/xml.{h,cpp}: Fix capitalization errors in
        names. Implement getBytesTotal(), getBytesLoaded(),
        and hasChildNodes().
        * testsuite/actionscript.all/XML.as: Add tests for
        getBytesTotal(), getBytesLoaded(), and hasChildNodes().

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/ChangeLog.diff?tr1=1.94&tr2=1.95&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/doc/C/localconnection.xml.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/plugin/player.cpp.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/plugin/plugin.cpp.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/plugin/plugin.h.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/xml.cpp.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/xml.h.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/testsuite/actionscript.all/XML.as.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: gnash/ChangeLog
diff -u gnash/ChangeLog:1.94 gnash/ChangeLog:1.95
--- gnash/ChangeLog:1.94        Sun Feb  5 18:06:28 2006
+++ gnash/ChangeLog     Sun Feb  5 22:17:49 2006
@@ -1,10 +1,20 @@
 2006-02-05  Rob Savoye  <address@hidden>
 
+       * plugin/plugin.cpp (NewStream): Add support to parse the options
+       passed in when the plugin is invoked to play a stream. Add special
+       debug flags so we can attach GDB at leisure and not have to screw
+       with loading shared libraries.
+       * server/xml.{h,cpp}: Fix capitalization errors in
+       names. Implement getBytesTotal(), getBytesLoaded(),
+       and hasChildNodes().
+       * testsuite/actionscript.all/XML.as: Add tests for
+       getBytesTotal(), getBytesLoaded(), and hasChildNodes().
+       
        * server/xml.h: Add stubs for the missing methods and
        properties. Fix bit rot with get_member() so it actually works
        again.
        * server/xml.cpp:  Add stubs for the missing methods and
-       properties.
+       propeties.
        * testsuite/actionscript.all/XML.as: New file to test XML class.
 
 2006-02-05 Sandro Santilli <address@hidden>
Index: gnash/doc/C/localconnection.xml
diff -u gnash/doc/C/localconnection.xml:1.2 gnash/doc/C/localconnection.xml:1.3
--- gnash/doc/C/localconnection.xml:1.2 Tue Jan 31 05:22:49 2006
+++ gnash/doc/C/localconnection.xml     Sun Feb  5 22:17:49 2006
@@ -20,10 +20,12 @@
        </varlistentry>
 
        <varlistentry>
-         <term>connect()</term>
+         <term>connect(const char *)</term>
          <listitem>
            <para>
-             Accept local messages to this object
+             Accept local messages to this object. This creates a
+             <code>tcp/ip</code> based server that waits on a network
+             port for incoming messages.
            </para>
          </listitem>
        </varlistentry>
@@ -32,7 +34,7 @@
          <term>domain()</term>
          <listitem>
            <para>
-             Return the super domain of a SWF file
+             Returns the domain of the local connection.
            </para>
          </listitem>
        </varlistentry>
@@ -109,7 +111,7 @@
              </entry>
              <entry valign="top" align="center">
                <para>
-                 This method is unimplemented.
+                 This method is implemented.
                </para>
              </entry>
            </row>
@@ -119,7 +121,7 @@
              </entry>
              <entry valign="top" align="center">
                <para>
-                 This method is unimplemented.
+                 This method is implemented.
                </para>
              </entry>
            </row>
@@ -129,7 +131,7 @@
              </entry>
              <entry valign="top" align="center">
                <para>
-                 This method is unimplemented.
+                 This method is implemented.
                </para>
              </entry>
            </row>
Index: gnash/plugin/player.cpp
diff -u gnash/plugin/player.cpp:1.3 gnash/plugin/player.cpp:1.4
--- gnash/plugin/player.cpp:1.3 Fri Feb  3 20:50:27 2006
+++ gnash/plugin/player.cpp     Sun Feb  5 22:17:49 2006
@@ -257,7 +257,7 @@
     }    
        
 //    SDL_KillThread(thread);  // kill the network read thread
-//    SDL_Quit();
+//    SDL_Q217.22.58.161uit();
     
     if (md) {
        md->drop_ref();
@@ -344,10 +344,10 @@
     nsPluginInstance *inst = (nsPluginInstance *)arg;
     int retries;
     
-     if (!GLinitialized) {
-        initGL(inst);
+    if (!GLinitialized) {
+       initGL(inst);
        GLinitialized = true;
-     }
+    }
     
      while (retries++ < 2) {
 #if 0
Index: gnash/plugin/plugin.cpp
diff -u gnash/plugin/plugin.cpp:1.11 gnash/plugin/plugin.cpp:1.12
--- gnash/plugin/plugin.cpp:1.11        Fri Feb  3 20:50:27 2006
+++ gnash/plugin/plugin.cpp     Sun Feb  5 22:17:49 2006
@@ -60,6 +60,7 @@
 static float s_scale = 1.0f;
 static bool  s_verbose = false;
 static int   doneYet = 0;
+static bool  waitforgdb = false;
 
 const int INBUFSIZE = 1024;
 
@@ -219,8 +220,8 @@
           // get rid of all other exposure events
           if (plugin) {
               if (GLinitialized) {
-                   drawGLScene();
-//                  printf("HACK ALERT! ignoring expose event!\n");
+//                   drawGLScene();
+                  printf("HACK ALERT! ignoring expose event!\n");
               } else {
                   printf("GL Surface not initialized yet, ignoring expose 
event!\n");
              }
@@ -398,21 +399,78 @@
 // Open a new incoming data stream, which is the flash movie we want to play.
 // A URL can be pretty ugly, like in this example:
 // 
http://www.shockwave.com/swf/navbar/navbar_sw.swf?atomfilms=http%3a//www.atomfilms.com/af/home/&shockwave=http%3a//www.shockwave.com&gameblast=http%3a//gameblast.shockwave.com/gb/gbHome.jsp&known=0
+// 
../flash/gui.swf?ip_addr=foobar.com&ip_port=3660&show_cursor=true&path_prefix=../flash/&trapallkeys=true"
 NPError
 nsPluginInstance::NewStream(NPMIMEType type, NPStream * stream,
                             NPBool seekable, uint16 * stype)
 {
-    char tmp[100];
-    memset(tmp, 0, 100);
+    char tmp[300];
+    memset(tmp, 0, 300);
     string url = stream->url;
-    string fname;
-    int start, end;
+    string fname, opts;
+    int start, end, eq;
+    bool dumpopts = false;
 
     end   = url.find(".swf", 0) + 4;
     start = url.rfind("/", end) + 1;
     fname = "/tmp/";
     fname += url.substr(start, end - start);
 
+    // extract the parameters from the URL
+    start = url.find("?", end);
+    end = url.size();
+    if (start != string::npos) {
+       opts = url.substr(start+1, end);
+    }
+
+    printf("The full URL is %s\n", url.c_str());
+    while (opts.size() > 0) {
+       // Wait for GDB
+       if (waitforgdb) {
+           printf("Attach GDB to PID %d to debug!\n", getpid());
+           printf("This thread will block until then!...\n");
+           printf("Once blocked here, you can set other breakpoints.\n");
+           printf("do a \"set variable waitforgdb=false\" to continue\n");
+           while (waitforgdb) {
+               sleep(1);
+           }
+       }
+
+       start = 0;
+       eq = opts.find("=", 0);
+       if (opts[0] == '&') {
+           start++;
+       }
+       end = opts.find("&", start);
+       if (end <= 0) {
+           end = opts.size();
+       }
+       if (eq == string::npos) {
+           eq = opts.size();
+       }
+       string name = opts.substr(start, eq);
+       string value = opts.substr(eq+1, end-eq-1);
+       if (dumpopts) {
+           printf("Option %s = %s\n", name.c_str(), value.c_str());
+       }
+       // Look for our special debug flags
+       if (name == "debug") {
+           printf("Debug flag is %s\n", value.c_str());
+           if (value == "waitforgdb") {
+               waitforgdb = true;
+           }
+           if (value == "dumpopts") {
+               dumpopts = true;
+           }
+       } else {
+           _options[name] = value;
+       }
+       if (opts[end] == '&') {
+               end++;
+       }
+       opts.erase(start, end);
+    }
+    
     //  printf("%s: URL is %s\n", __PRETTY_FUNCTION__, url.c_str());
     printf("%s: Open stream for %s (%d, %d)\n", __PRETTY_FUNCTION__, 
fname.c_str(), start, end);
 
Index: gnash/plugin/plugin.h
diff -u gnash/plugin/plugin.h:1.4 gnash/plugin/plugin.h:1.5
--- gnash/plugin/plugin.h:1.4   Sat Jan 28 01:14:33 2006
+++ gnash/plugin/plugin.h       Sun Feb  5 22:17:49 2006
@@ -24,6 +24,7 @@
 #include <X11/Intrinsic.h>
 #include <X11/cursorfont.h>
 #include <string>
+#include <map>
 #include "pluginbase.h"
 
 /* ascii codes for various special keys */
@@ -35,19 +36,6 @@
 #define LEFT_ARROW 75
 #define RIGHT_ARROW 77
 
-struct WinData{
-    Window        _window;
-    Display      *_display;
-    int           _x;
-    int           _y;
-    int           _width;
-    int           _height;
-    Visual       *_visual;
-    Colormap      _colormap;
-    unsigned int  _depth;
-    const char   *_file;
-};
-
 class nsPluginInstance : public nsPluginInstanceBase
 {
 public:
@@ -71,7 +59,6 @@
     
     // accessors
     const char  *getVersion();
-    WinData     *getWinData()   { return &windata; };
     Window      getWindow()     { return mWindow; };
     Display     *getDisplay()   { return mDisplay; };
     unsigned int getDepth()     { return mDepth; };
@@ -85,7 +72,6 @@
     Widget        mXtwidget;
     XFontStruct   *mFontInfo;
     std::string      swf_file;
-    struct WinData   windata;
     Window        mWindow;
     Display       *mDisplay;
     int           mX;
@@ -95,8 +81,9 @@
     Visual        *mVisual;
     Colormap      mColormap;
     unsigned int  mDepth;
-    GC            mGC;
+//    GC            mGC;
     int           thr_count;
+    std::map<std::string, std::string> _options;
 };
 
 // end of __PLUGIN_H__
Index: gnash/server/xml.cpp
diff -u gnash/server/xml.cpp:1.4 gnash/server/xml.cpp:1.5
--- gnash/server/xml.cpp:1.4    Sun Feb  5 18:06:28 2006
+++ gnash/server/xml.cpp        Sun Feb  5 22:17:49 2006
@@ -117,14 +117,13 @@
     //  _value.set_undefined();
 }
 
-XML::XML()
+XML::XML() 
+    :_loaded(false),  _nodename(0), _bytes_loaded(0), _bytes_total(0)
 {
 #ifdef DEBUG_MEMORY_ALLOCATION
     log_msg("Creating XML data at %p \n", this);
 #endif
     //log_msg("%s: %p \n", __FUNCTION__, this);
-    _loaded = false;
-    _nodename = 0;
 }
 
 
@@ -216,7 +215,7 @@
     //log_msg("Created new element for %s at %p\n", node->name, element);
     memset(element, 0, sizeof (XMLNode));
 
-    //log_msg("%s: extracting node %s\n", __FUNCTION__, node->name);
+    log_msg("%s: extracting node %s\n", __FUNCTION__, node->name);
 
     // See if we have any Attributes (properties)
     attr = node->properties;
@@ -288,6 +287,7 @@
 bool
 XML::parseDoc(xmlDocPtr document, bool mem)
 {
+    log_msg("%s:\n", __PRETTY_FUNCTION__);
     XMLNode *top;
     xmlNodePtr cur;
 
@@ -315,8 +315,10 @@
 bool
 XML::parseXML(tu_string xml_in)
 {
-    bool ret = true;
-    //log_msg("Parse XML from memory: %s\n", xml_in.c_str());
+    log_msg("%s:\n", __PRETTY_FUNCTION__);
+    bool        ret = true;
+
+    log_msg("Parse XML from memory: %s\n", xml_in.c_str());
 
     if (xml_in.size() == 0) {
         log_error("XML data is empty!\n");
@@ -403,7 +405,7 @@
 XMLNode*
 XML::processNode(xmlTextReaderPtr reader, XMLNode *node)
 {
-    //log_msg("%s: node is %p\n", __FUNCTION__, node);
+    log_msg("%s: node is %p\n", __PRETTY_FUNCTION__, node);
     static XMLNode *parent[10];
     xmlChar *name, *value;
     int   depth;
@@ -511,10 +513,18 @@
 XML::load(const char *filespec)
 {
     bool ret = true;
+    struct stat stats;
     log_msg("Load disk XML file: %s\n", filespec);
   
     //log_msg("%s: mem is %d\n", __FUNCTION__, mem);
 
+    // See if the file exists
+    if (stat(filespec, &stats) == 0) {
+        _bytes_total = stats.st_size;
+        _bytes_loaded = stats.st_size; // FIXME: this should probably
+                                       // be set later on after the
+                                       // file is loaded
+    }
 #ifdef USE_XMLREADER
     XMLNode *node = 0;
     xmlTextReaderPtr reader;  
@@ -699,18 +709,6 @@
 }
 
 void
-XML::getBytesLoaded()
-{
-    log_msg("%s:unimplemented \n", __FUNCTION__);
-}
-
-void
-XML::getBytesTotal()
-{
-    log_msg("%s:unimplemented \n", __FUNCTION__);
-}
-
-void
 XML::insertBefore()
 {
     log_msg("%s:unimplemented \n", __FUNCTION__);
@@ -746,12 +744,54 @@
     log_msg("%s:unimplemented \n", __FUNCTION__);
 }
 
-void
+const char *
 XML::toString()
 {
     log_msg("%s:unimplemented \n", __FUNCTION__);
 }
 
+// 
+const char *
+XML::stringify(XMLNode *xml)
+{
+    int           child, i;
+    const char    *nodename;
+    int           length;
+    as_value      inum;
+    XMLNode       *childnode;
+
+    //log_msg("\t%s: processing node %s for object %p, mem is %d\n", 
__FUNCTION__, xml->_name, obj, mem);
+  
+    // Get the data for this node
+    nodename   = xml->_name;
+    //nodename   = xml->_name.c_str();
+    //nodevalue  = xml->_value;
+    length     = xml->length();
+
+    // Process the attributes, if any
+    if (_nodes->_attributes.size() == 0) {
+        //log_msg("\t\tNo attributes for node %s, created empty object at 
%p\n", nodename, attr_obj);
+    } else {
+        for (i=0; i<xml->_attributes.size(); i++) {
+            log_msg("\t\tAdding attribute as member %s, value is %s to node 
%s\n",
+                    xml->_attributes[i]->_name,
+                    xml->_attributes[i]->_value, nodename);
+        }
+    }
+
+    // Process the children, if there are any
+    if (length) {
+        //log_msg("\tProcessing %d children nodes for %s\n", length, nodename);
+        inum = 0;
+        for (child=0; child<length; child++) {
+            // Create a new AS object for this node's children
+            inum += 1;
+        }
+    } else {
+        //log_msg("\tNode %s has no children\n", nodename);
+    }  
+}
+
 
 //
 // Callbacks. These are the wrappers for the C++ functions so they'll work as
@@ -958,21 +998,21 @@
         //log_msg("\tCreated New XML object at %p\n", xml_obj);
         xml_obj->set_member("loaded", &xml_loaded);
         
-        xml_obj->set_member("addrequestheader", &xml_addrequestheader);
-        xml_obj->set_member("appendchild", &xml_appendchild);
-        xml_obj->set_member("clonenode", &xml_clonenode);
-        xml_obj->set_member("createelement", &xml_createelement);
-        xml_obj->set_member("createtextnode", &xml_createtextnode);
-        xml_obj->set_member("getbytesloaded", &xml_getbytesloaded);
-        xml_obj->set_member("getbytestotal", &xml_getbytestotal);
-        xml_obj->set_member("haschildnodes", &xml_haschildnodes);
-        xml_obj->set_member("insertbefore", &xml_insertbefore);
+        xml_obj->set_member("addRequestHeader", &xml_addrequestheader);
+        xml_obj->set_member("appendChild", &xml_appendchild);
+        xml_obj->set_member("cloneNode", &xml_clonenode);
+        xml_obj->set_member("createElement", &xml_createelement);
+        xml_obj->set_member("createTextNode", &xml_createtextnode);
+        xml_obj->set_member("getBytesLoaded", &xml_getbytesloaded);
+        xml_obj->set_member("getBytesTotal", &xml_getbytestotal);
+        xml_obj->set_member("hasChildNodes", &xml_haschildnodes);
+        xml_obj->set_member("insertBefore", &xml_insertbefore);
         xml_obj->set_member("load", &xml_load);
         xml_obj->set_member("parseXML", &xml_parsexml);
-        xml_obj->set_member("removenode", &xml_removenode);
+        xml_obj->set_member("removeNode", &xml_removenode);
         xml_obj->set_member("send", &xml_send);
-        xml_obj->set_member("sendandload", &xml_sendandload);
-        xml_obj->set_member("tostring", &xml_tostring);
+        xml_obj->set_member("sendAndLoad", &xml_sendandload);
+        xml_obj->set_member("toString", &xml_tostring);
     }
 
     fn.result->set_as_object_interface(xml_obj);
@@ -1037,26 +1077,23 @@
 //    fn.result->set_int(ptr->obj.getAllocated());
     ptr->obj.createTextNode();
 }
+
 void xml_getbytesloaded(const fn_call& fn) {
     xml_as_object *ptr = (xml_as_object*)fn.this_ptr;
     assert(ptr);
-    
-//    fn.result->set_int(ptr->obj.getAllocated());
-    ptr->obj.getBytesLoaded();
+    fn.result->set_int(ptr->obj.getBytesLoaded());
 }
+
 void xml_getbytestotal(const fn_call& fn) {
     xml_as_object *ptr = (xml_as_object*)fn.this_ptr;
     assert(ptr);
-    
-//    fn.result->set_int(ptr->obj.getAllocated());
-    ptr->obj.getBytesTotal();
+    fn.result->set_int(ptr->obj.getBytesTotal());
 }
+
 void xml_haschildnodes(const fn_call& fn) {
     xml_as_object *ptr = (xml_as_object*)fn.this_ptr;
-    assert(ptr);
-    
-//    fn.result->set_int(ptr->obj.getAllocated());
-    ptr->obj.hasChildNodes();
+    assert(ptr);    
+    fn.result->set_bool(ptr->obj.hasChildNodes());
 }
 void xml_insertbefore(const fn_call& fn) {
     xml_as_object *ptr = (xml_as_object*)fn.this_ptr;
@@ -1097,8 +1134,7 @@
     xml_as_object *ptr = (xml_as_object*)fn.this_ptr;
     assert(ptr);
     
-//    fn.result->set_int(ptr->obj.getAllocated());
-    ptr->obj.toString();
+    fn.result->set_string(ptr->obj.toString());
 }
 
 int
Index: gnash/server/xml.h
diff -u gnash/server/xml.h:1.7 gnash/server/xml.h:1.8
--- gnash/server/xml.h:1.7      Sun Feb  5 18:06:28 2006
+++ gnash/server/xml.h  Sun Feb  5 22:17:49 2006
@@ -45,9 +45,10 @@
     XMLAttr();
     ~XMLAttr();
   
-    char        *_name;
-    char        *_value;
-
+    char                *_name;
+    char                *_value;
+    xmlAttributeType    _type;
+    
     XMLAttr *operator = (XMLAttr node) {
         log_msg("\t\tCopying XMLAttr object at %p\n", this);
     
@@ -135,10 +136,11 @@
     
     void  change_stack_frame(int frame, gnash::as_object *xml, 
gnash::as_environment *env);
 
-    char               *_name;
-    char               *_value;
-    array<XMLNode *>   _children;
-    array<XMLAttr *>   _attributes;
+    char                *_name;
+    char                *_value;
+    xmlElementType      _type;
+    array<XMLNode *>    _children;
+    array<XMLAttr *>    _attributes;
 };
 
 /// XML Node ActionScript object
@@ -223,7 +225,8 @@
     array<XMLNode *> childNodes() {
         return _nodes->_children;
     }
-    
+
+    const char *stringify(XMLNode *xml);
     //  Returns true if the specified node has child nodes; otherwise, returns 
false.
     bool hasChildNodes() {
         return _nodes->_children.size();
@@ -233,7 +236,7 @@
     XMLNode *processNode(xmlTextReaderPtr reader, XMLNode *node);
 
     void  change_stack_frame(int frame, gnash::as_object *xml, 
gnash::as_environment *env);
-    void  setupStackFrames(gnash::as_object *xml, gnash::as_environment *env);
+//    void  setupStackFrames(gnash::as_object *xml, gnash::as_environment 
*env);
     void  cleanupStackFrames( XMLNode *data);
     as_object *setupFrame(gnash::as_object *xml, XMLNode *data, bool src);
   
@@ -241,22 +244,23 @@
   
     int length()                 { return _nodes->length(); }
   
-#if 1
     void addRequestHeader();
     void appendChild();
     void cloneNode();
     void createElement();
     void createTextNode();
-    void getBytesLoaded();
-    void getBytesTotal();
+    
     void insertBefore();
     void load();
     void parseXML();
     void removeNode();
     void send();
     void sendAndLoad();
-    void toString();
-#endif
+    const char *toString();
+
+    int getBytesLoaded()         { return _bytes_loaded; };
+    int getBytesTotal()          { return _bytes_total; };
+
     virtual void       on_xml_event(gnash::event_id id) { on_event(id); }
   
     // Special event handler; 
@@ -283,23 +287,23 @@
     bool _loaded;
     const char  *_nodename;
     XMLNode     *_nodes;
+
+    int         _bytes_loaded;
+    int         _bytes_total;
     
-    bool _contentType;
-    bool _attributes;
-    bool _childNodes;
-    bool _xmlDecl;
-    bool _docTypeDecl;
-    bool _ignoreWhite;
-    bool _lastChild;
-    bool _nextSibling;
-    bool _nodeName;
-    bool _nodeType;
-    bool _nodeValue;
-    bool _onData;
-    bool _onLoad;
-    bool _parentNode;
-    bool _status;
-    bool _previousSibling;
+    bool        _contentType;
+    bool        _attributes;
+    bool        _childNodes;
+    bool        _xmlDecl;
+    bool        _docTypeDecl;
+    bool        _ignoreWhite;
+    bool        _lastChild;
+    bool        _nextSibling;
+    bool        _nodeType;
+    bool        _nodeValue;
+    bool        _parentNode;
+    bool        _status;
+    bool        _previousSibling;
 
 };
 
Index: gnash/testsuite/actionscript.all/XML.as
diff -u gnash/testsuite/actionscript.all/XML.as:1.1 
gnash/testsuite/actionscript.all/XML.as:1.2
--- gnash/testsuite/actionscript.all/XML.as:1.1 Sun Feb  5 18:06:28 2006
+++ gnash/testsuite/actionscript.all/XML.as     Sun Feb  5 22:17:50 2006
@@ -31,58 +31,58 @@
 }
 
 // test the XML::addrequestheader method
-if (tmp.addrequestheader) {
-       trace("PASSED: XML::addrequestheader() exists");
+if (tmp.addRequestHeader) {
+       trace("PASSED: XML::addRequestHeader() exists");
 } else {
-       trace("FAILED: XML::addrequestheader() doesn't exist");
+       trace("FAILED: XML::addRequestHeader() doesn't exist");
 }
 // test the XML::appendchild method
-if (tmp.appendchild) {
-       trace("PASSED: XML::appendchild() exists");
+if (tmp.appendChild) {
+       trace("PASSED: XML::appendChild() exists");
 } else {
-       trace("FAILED: XML::appendchild() doesn't exist");
+       trace("FAILED: XML::appendChild() doesn't exist");
 }
 // test the XML::clonenode method
-if (tmp.clonenode) {
-       trace("PASSED: XML::clonenode() exists");
+if (tmp.cloneNode) {
+       trace("PASSED: XML::cloneNode() exists");
 } else {
-       trace("FAILED: XML::clonenode() doesn't exist");
+       trace("FAILED: XML::cloneNode() doesn't exist");
 }
 // test the XML::createelement method
-if (tmp.createelement) {
-       trace("PASSED: XML::createelement() exists");
+if (tmp.createElement) {
+       trace("PASSED: XML::createElement() exists");
 } else {
-       trace("FAILED: XML::createelement() doesn't exist");
+       trace("FAILED: XML::createElement() doesn't exist");
 }
 // test the XML::createtextnode method
-if (tmp.createtextnode) {
-       trace("PASSED: XML::createtextnode() exists");
+if (tmp.createTextNode) {
+       trace("PASSED: XML::createTextNode() exists");
 } else {
-       trace("FAILED: XML::createtextnode() doesn't exist");
+       trace("FAILED: XML::createTextNode() doesn't exist");
 }
 // test the XML::getbytesloaded method
-if (tmp.getbytesloaded) {
-       trace("PASSED: XML::getbytesloaded() exists");
+if (tmp.getBytesLoaded) {
+       trace("PASSED: XML::getBytesLoaded() exists");
 } else {
-       trace("FAILED: XML::getbytesloaded() doesn't exist");
+       trace("FAILED: XML::getBytesLoaded() doesn't exist");
 }
 // test the XML::getbytestotal method
-if (tmp.getbytestotal) {
-       trace("PASSED: XML::getbytestotal() exists");
+if (tmp.getBytesTotal) {
+       trace("PASSED: XML::getBytesTotal() exists");
 } else {
-       trace("FAILED: XML::getbytestotal() doesn't exist");
+       trace("FAILED: XML::getBytesTotal() doesn't exist");
 }
 // test the XML::haschildnodes method
-if (tmp.haschildnodes) {
-       trace("PASSED: XML::haschildnodes() exists");
+if (tmp.hasChildNodes) {
+       trace("PASSED: XML::hasChildNodes() exists");
 } else {
-       trace("FAILED: XML::haschildnodes() doesn't exist");
+       trace("FAILED: XML::hasChildNodes() doesn't exist");
 }
 // test the XML::insertbefore method
-if (tmp.insertbefore) {
-       trace("PASSED: XML::insertbefore() exists");
+if (tmp.insertBefore) {
+       trace("PASSED: XML::insertBefore() exists");
 } else {
-       trace("FAILED: XML::insertbefore() doesn't exist");
+       trace("FAILED: XML::insertBefore() doesn't exist");
 }
 // test the XML::load method
 if (tmp.load) {
@@ -103,10 +103,10 @@
        trace("FAILED: XML::parseXML() doesn't exist");
 }
 // test the XML::removenode method
-if (tmp.removenode) {
-       trace("PASSED: XML::removenode() exists");
+if (tmp.removeNode) {
+       trace("PASSED: XML::removeNode() exists");
 } else {
-       trace("FAILED: XML::removenode() doesn't exist");
+       trace("FAILED: XML::removeNode() doesn't exist");
 }
 // test the XML::send method
 if (tmp.send) {
@@ -115,14 +115,45 @@
        trace("FAILED: XML::send() doesn't exist");
 }
 // test the XML::sendandload method
-if (tmp.sendandload) {
-       trace("PASSED: XML::sendandload() exists");
+if (tmp.sendAndLoad) {
+       trace("PASSED: XML::sendAndLoad() exists");
 } else {
-       trace("FAILED: XML::sendandload() doesn't exist");
+       trace("FAILED: XML::sendAndLoad() doesn't exist");
 }
 // test the XML::tostring method
-if (tmp.tostring) {
-       trace("PASSED: XML::tostring() exists");
+if (tmp.toString) {
+       trace("PASSED: XML::toString() exists");
 } else {
-       trace("FAILED: XML::tostring() doesn't exist");
+       trace("FAILED: XML::toString() doesn't exist");
+}
+
+// Load
+if (tmp.load("testin.xml")) {
+       trace("PASSED: XML::load() works");
+} else {
+       trace("FAILED: XML::load() doesn't works");
+}
+//
+if (tmp.hasChildNodes() == true) {
+       trace("PASSED: XML::hasChildNodes() works");
+} else {
+       trace("FAILED: XML::hasChildNodes() works");
+}
+
+if (tmp.getBytesLoaded() > 1) {
+       trace("PASSED: XML::getBytesLoaded() works");
+} else {
+       trace("FAILED: XML::getBytesLoaded() works");
+}
+
+if (tmp.getBytesTotal() > 1) {
+       trace("PASSED: XML::getBytesTotal() works");
+} else {
+       trace("FAILED: XML::getBytesTotal() works");
+}
+
+if (tmp.getBytesLoaded() == tmp.getBytesTotal()) {
+       trace("PASSED: bytes count are the same");
+} else {
+       trace("FAILED: bytes counts are not the same");
 }




reply via email to

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