[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r9638: Some maintenance on XMLSocket
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r9638: Some maintenance on XMLSocket class. |
Date: |
Mon, 25 Aug 2008 11:26:17 +0200 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 9638
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Mon 2008-08-25 11:26:17 +0200
message:
Some maintenance on XMLSocket class.
Tests for XMLNode.
Update swfdec testsuite results.
renamed:
libcore/asobj/xmlsocket.cpp => libcore/asobj/XMLSocket_as.cpp
libcore/asobj/xmlsocket.h => libcore/asobj/XMLSocket_as.h
modified:
libcore/asobj/ClassHierarchy.cpp
libcore/asobj/Global.cpp
libcore/asobj/Makefile.am
libcore/asobj/xmlnode.h
testsuite/actionscript.all/XMLNode.as
testsuite/swfdec/PASSING
libcore/asobj/XMLSocket_as.cpp
------------------------------------------------------------
revno: 9637.1.1
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Mon 2008-08-25 08:51:40 +0200
message:
sec-0.6.2-local-access-6.swf only ever passed for a couple of days several
months ago, and since no one looks like fixing it it can be an expected
failure.
Four passes in new tests.
modified:
testsuite/swfdec/PASSING
------------------------------------------------------------
revno: 9637.1.2
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Mon 2008-08-25 08:59:44 +0200
message:
Rename xmlsocket.{cpp,h} to reflect name of class.
renamed:
libcore/asobj/xmlsocket.cpp => libcore/asobj/XMLSocket_as.cpp
libcore/asobj/xmlsocket.h => libcore/asobj/XMLSocket_as.h
modified:
libcore/asobj/ClassHierarchy.cpp
libcore/asobj/Global.cpp
libcore/asobj/Makefile.am
libcore/asobj/XMLSocket_as.cpp
------------------------------------------------------------
revno: 9637.1.3
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Mon 2008-08-25 09:26:39 +0200
message:
Drop DSOLOCAL, as this is the default.
Add tests showing the XMLNode.childNodes is just an AS array.
modified:
libcore/asobj/xmlnode.h
testsuite/actionscript.all/XMLNode.as
------------------------------------------------------------
revno: 9637.1.4
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Mon 2008-08-25 11:14:12 +0200
message:
More tests for XMLNode, show Gnash isn't doing it very well.
modified:
testsuite/actionscript.all/XMLNode.as
------------------------------------------------------------
revno: 9637.1.5
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Mon 2008-08-25 11:25:20 +0200
message:
More tests for properties, some of which Gnash doesn't have.
modified:
testsuite/actionscript.all/XMLNode.as
=== modified file 'libcore/asobj/ClassHierarchy.cpp'
--- a/libcore/asobj/ClassHierarchy.cpp 2008-07-30 07:51:07 +0000
+++ b/libcore/asobj/ClassHierarchy.cpp 2008-08-25 06:59:44 +0000
@@ -62,7 +62,7 @@
#include "namedStrings.h"
#include "ClassHierarchy.h"
#include "builtin_function.h"
-#include "xmlsocket.h"
+#include "XMLSocket_as.h"
#include "xml.h"
#include "xmlnode.h"
#include "asClass.h"
=== modified file 'libcore/asobj/Global.cpp'
--- a/libcore/asobj/Global.cpp 2008-08-18 23:53:04 +0000
+++ b/libcore/asobj/Global.cpp 2008-08-25 06:59:44 +0000
@@ -73,7 +73,7 @@
#include "sprite_instance.h"
#include "xml.h"
-#include "xmlsocket.h"
+#include "XMLSocket_as.h"
#include <limits> // for numeric_limits<double>::infinity
#include <sstream>
=== modified file 'libcore/asobj/Makefile.am'
--- a/libcore/asobj/Makefile.am 2008-07-22 21:24:49 +0000
+++ b/libcore/asobj/Makefile.am 2008-08-25 06:59:44 +0000
@@ -74,7 +74,7 @@
xml.cpp \
xmlattrs.cpp \
xmlnode.cpp \
- xmlsocket.cpp \
+ XMLSocket_as.cpp \
flash/display/BitmapData_as.cpp \
flash/display_pkg.cpp \
flash/external/ExternalInterface_as.cpp \
@@ -142,7 +142,7 @@
TextSnapshot.h \
String_as.h \
xml.h \
- xmlsocket.h \
+ XMLSocket_as.h \
xmlattrs.h \
xmlnode.h \
flash/display/BitmapData_as.h \
=== renamed file 'libcore/asobj/xmlsocket.cpp' =>
'libcore/asobj/XMLSocket_as.cpp'
--- a/libcore/asobj/xmlsocket.cpp 2008-08-22 16:00:37 +0000
+++ b/libcore/asobj/XMLSocket_as.cpp 2008-08-25 06:59:44 +0000
@@ -28,7 +28,7 @@
#include "network.h"
#include "utility.h"
#include "xml.h"
-#include "xmlsocket.h"
+#include "XMLSocket_as.h"
#include "timers.h"
#include "as_function.h"
#include "fn_call.h"
=== renamed file 'libcore/asobj/xmlsocket.h' => 'libcore/asobj/XMLSocket_as.h'
=== modified file 'libcore/asobj/xmlnode.h'
--- a/libcore/asobj/xmlnode.h 2008-08-21 14:30:29 +0000
+++ b/libcore/asobj/xmlnode.h 2008-08-25 07:26:39 +0000
@@ -45,7 +45,7 @@
//
/// This is the base class for the XML ActionScript class
///
-class DSOLOCAL XMLNode : public gnash::as_object
+class XMLNode : public gnash::as_object
{
public:
=== modified file 'testsuite/actionscript.all/XMLNode.as'
--- a/testsuite/actionscript.all/XMLNode.as 2008-03-11 19:31:46 +0000
+++ b/testsuite/actionscript.all/XMLNode.as 2008-08-25 09:25:20 +0000
@@ -23,7 +23,37 @@
rcsid="$Id: XMLNode.as,v 1.17 2008/03/11 19:31:48 strk Exp $";
#include "check.as"
-//#include "dejagnu.as"
+
+
+// Test properties
+
+#if OUTPUT_VERSION < 6
+XMLNode.prototype.hasOwnProperty = ASnative(101, 5);
+#endif
+
+check(XMLNode.prototype.hasOwnProperty("appendChild"));
+check(XMLNode.prototype.hasOwnProperty("cloneNode"));
+check(XMLNode.prototype.hasOwnProperty("hasChildNodes"));
+check(XMLNode.prototype.hasOwnProperty("insertBefore"));
+check(XMLNode.prototype.hasOwnProperty("removeNode"));
+check(XMLNode.prototype.hasOwnProperty("toString"));
+
+xcheck(XMLNode.prototype.hasOwnProperty("getPrefixForNamespace"));
+xcheck(XMLNode.prototype.hasOwnProperty("getNamespaceForPrefix"));
+
+check(XMLNode.prototype.hasOwnProperty("firstChild"));
+check(XMLNode.prototype.hasOwnProperty("lastChild"));
+xcheck(XMLNode.prototype.hasOwnProperty("namespaceURI"));
+xcheck(XMLNode.prototype.hasOwnProperty("localName"));
+check(XMLNode.prototype.hasOwnProperty("attributes"));
+check(XMLNode.prototype.hasOwnProperty("childNodes"));
+check(XMLNode.prototype.hasOwnProperty("nextSibling"));
+check(XMLNode.prototype.hasOwnProperty("nodeName"));
+check(XMLNode.prototype.hasOwnProperty("nodeType"));
+check(XMLNode.prototype.hasOwnProperty("nodeValue"));
+check(XMLNode.prototype.hasOwnProperty("parentNode"));
+xcheck(XMLNode.prototype.hasOwnProperty("prefix"));
+check(XMLNode.prototype.hasOwnProperty("previousSibling"));
var doc = new XML();
@@ -31,15 +61,6 @@
var textnode = doc.createTextNode("text content");
check_equals(typeOf(textnode), 'object');
-// test the XMLNode constuctor
-//dejagnu(node, "XMLNode::XMLNode()");
-
-//note("Test the existance of all the methods");
-
-//check_equals(typeOf(myXML.createElement), 'function');
-
-
-
check(textnode.appendChild);
check(textnode.cloneNode);
check(textnode.hasChildNodes);
@@ -47,7 +68,7 @@
check(textnode.removeNode);
check(textnode.toString);
-//note("Now test the functionality of the properties");
+// functionality of the properties
textnode.nodeName = "foo";
check_equals(textnode.nodeName, "foo");
@@ -87,19 +108,82 @@
node3.appendChild(textnode3);
node1.appendChild(node3);
-// trace(node1.toString());
-trace("===========================================");
-
-// trace(node1.firstChild.nodeValue);
-// trace(node1.lastChild.nodeValue);
+
+// Childnodes is an array.
+check_equals(typeOf(node1.childNodes), "object");
+check(node1.childNodes.push);
+check(node1.childNodes instanceOf Array);
+
+// node1 has three children (textnode1, node2, node 3)
+check_equals(node1.childNodes.length, 3);
+
+// Now it has 4, but the latest element is not an XMLNode
+node1.childNodes.push("not a node");
+xcheck_equals(node1.childNodes.length, 4);
+check(!node1.childNodes[3] instanceOf XMLNode);
+
+// Now 5. The latest element is an XMLNode, but it does not become
+// lastChild
+node1.childNodes.push(new XMLNode (1, "an XMLNode"));
+xcheck_equals(node1.childNodes.length, 5);
+xcheck(node1.childNodes[4] instanceOf XMLNode);
+check_equals(node1.lastChild.toString(), "<node3>third text node</node3>");
+
+// childNodes really is just an array: it can be sorted
+check_equals(node1.childNodes[0].toString(), "first text node");
+check_equals(node1.childNodes[2].toString(), "<node3>third text node</node3>");
+xcheck_equals(node1.childNodes[3].toString(), "not a node");
+node1.childNodes.sort();
+xcheck_equals(node1.childNodes[0].toString(), "<an XMLNode />");
+check_equals(node1.childNodes[2].toString(), "<node3>third text node</node3>");
+xcheck_equals(node1.childNodes[3].toString(), "first text node");
+
+// It can store anything
+node1.childNodes.push(new Date());
+xcheck_equals(node1.childNodes.length, 6);
+xcheck(node1.childNodes[5] instanceOf Date);
+check_equals(node1.childNodes.childNodes[5].hasChildNodes(), undefined);
+
+node1.childNodes.lastChild.appendChild(new XMLNode(1, "datenode"));
+check_equals(node1.childNodes.childNodes[5].hasChildNodes(), undefined);
+
+o = {};
+o.toString = function() {
+ return "o.toString()";
+};
+
+xcheck_equals(node1.childNodes.length, 6);
+node1.childNodes.push(o);
+xcheck_equals(node1.childNodes.length, 7);
+xcheck_equals(node1.childNodes[6].toString(), "o.toString()");
+
+// The last child is still node3
+check(node1.lastChild != node1.childNodes[6]);
+check_equals(node1.lastChild.nodeName, "node3");
+check_equals(node1.firstChild.toString(), "first text node");
+
+// Only when a new valid element is added does the lastChild change, and the
'fake'
+// items disappear.
+var node4 = doc.createElement("4node");
+node1.appendChild(node4);
+check_equals(node1.lastChild.toString(), "<4node />");
+check_equals(node1.childNodes.length, 4);
+check_equals(node1.childNodes[node1.childNodes.length - 1].toString(), "<4node
/>")
+
+// And sorting makes no difference to the lastChild, only to the last in the
+// array of childNodes.
+node1.childNodes.sort();
+check_equals(node1.lastChild.toString(), "<4node />");
+xcheck_equals(node1.childNodes[node1.childNodes.length - 1].toString(), "first
text node")
+
+
+
+
check_equals(node1.firstChild.nodeValue, "first text node");
check_equals(typeof(node1.lastChild.nodeValue), 'null');
-trace(node1.lastChild.previousSibling);
-trace(node1.firstChild.nextSibling);
-
check_equals(typeof(node1.firstChild.nodeName), "null");
-check_equals(node1.lastChild.nodeName, "node3");
+check_equals(node1.lastChild.nodeName, "4node");
check_equals(node2.previousSibling.nodeValue, "first text node");
@@ -110,4 +194,4 @@
// }
-check_totals(27);
+check_totals(78);
=== modified file 'testsuite/swfdec/PASSING'
--- a/testsuite/swfdec/PASSING 2008-08-14 21:52:09 +0000
+++ b/testsuite/swfdec/PASSING 2008-08-25 06:51:40 +0000
@@ -340,6 +340,10 @@
external-interface-properties-5.swf:6c1da3512318203a18e0d5c3454f4a7e
external-interface-properties-6.swf:1042fe711f2229195781f9ea1405fe66
external-interface-properties-7.swf:1209e63fc5cadd41f854b3686ec9984f
+filename-with-%-character-5.swf:3c41dca0ae8b3c7b7331fb4ce7de24c3
+filename-with-%-character-6.swf:7363947c9d60636ca005fe5f1228bc8f
+filename-with-%-character-7.swf:0b30fab3f932a704f280a2cc36763271
+filename-with-%-character-8.swf:faa93013d8b18c6847720b6cb4c3a0f1
file-reference-list-properties-5.swf:47e812391ae3b295a7f85dc5ab988179
file-reference-list-properties-5.swf:4d13076bcc6ab1cd02fea9f62d4013cf
file-reference-properties-5.swf:238ae6d8bf7d0ee8a241f20cf1247e6e
@@ -852,10 +856,6 @@
scope-chain-with-and-scope-chain-7.swf:6287e166df07684fc7b55fb19925280f
scope-chain-with-and-scope-chain-8.swf:7185d1d16490d2daf41bb1fc444e5fd3
scope.swf:09ecbb50f2ac03ebf401a1511d4b1334
-sec-0.6.2-local-access-5.swf:8c45f49018cb9b2e3975e0cc4845d5e6
-sec-0.6.2-local-access-6.swf:94b8c7bc4e289160bc53de131a2decc1
-sec-0.6.2-local-access-7.swf:9402e9972b368ef760b2012704cb0534
-sec-0.6.2-local-access-8.swf:4847062f673da030642e878b1f5241d4
selection-focus-events-5.swf:03ef025ff52765706b0154b972fce288
setinterval2.swf:f2a17dbddcd0a72a672fbb9a63e0ea5b
setinterval-arguments.swf:bf5653c905e58846b5a9ee8841c3bcb3
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r9638: Some maintenance on XMLSocket class.,
Benjamin Wolsey <=