[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r10300: Some tests for our sadly bro
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r10300: Some tests for our sadly broken XMLNode attributes. |
Date: |
Wed, 19 Nov 2008 12:08:30 +0100 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 10300
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Wed 2008-11-19 12:08:30 +0100
message:
Some tests for our sadly broken XMLNode attributes.
modified:
testsuite/actionscript.all/XMLNode.as
------------------------------------------------------------
revno: 10295.1.4
committer: Benjamin Wolsey <address@hidden>
branch nick: test
timestamp: Wed 2008-11-19 10:39:20 +0100
message:
Tests for attributes.
modified:
testsuite/actionscript.all/XMLNode.as
=== modified file 'testsuite/actionscript.all/XMLNode.as'
--- a/testsuite/actionscript.all/XMLNode.as 2008-11-19 08:41:47 +0000
+++ b/testsuite/actionscript.all/XMLNode.as 2008-11-19 09:39:20 +0000
@@ -55,12 +55,16 @@
check(XMLNode.prototype.hasOwnProperty("prefix"));
check(XMLNode.prototype.hasOwnProperty("previousSibling"));
+check_equals(typeof(XMLNode.prototype.attributes), "undefined");
+
var doc = new XML();
check(doc);
var textnode = doc.createTextNode("text content");
check_equals(typeOf(textnode), 'object');
+check_equals(typeof(textnode.attributes), "object");
+check_equals(textnode.attributes.toString(), undefined);
check(textnode.appendChild);
check(textnode.cloneNode);
check(textnode.hasChildNodes);
@@ -189,9 +193,29 @@
// TODO: test removeNode, insertNode
-// for (var aNode = node1.firstChild; node1 != null; aNode =
node1.nextSibling) {
-// trace(aNode);
-// }
+// Test attributes. It's just a normal object.
+check_equals(node2.attributes, undefined);
+check_equals(typeof(node2.attributes), "object");
+node2.attributes[3] = "a3";
+check_equals(node2.attributes[3], "a3");
+check_equals(node2.attributes["3"], "a3");
+node2.attributes.a = "aa";
+check_equals(node2.attributes.a, "aa");
+check_equals(node2.attributes["a"], "aa");
+check_equals(node2.toString(), '<node2 a="aa" 3="a3">second text
node</node2>');
+
+// Seems not to be overwritable
+node2.attributes = 3;
+check_equals(node2.toString(), '<node2 a="aa" 3="a3">second text
node</node2>');
+
+ASSetPropFlags(XMLNode.prototype, "attributes", 0, 1);
+node77 = doc.createElement("tag");
+node77.attributes.a1 = "at1";
+check_equals(node77.toString(), '<tag a1="at1" />');
+node77.attributes = 5;
+check_equals(node77.toString(), '<tag a1="at1" />');
+
+// Check namespace functions.
// Standard namespace
x = new XML('<tag xmlns="standard" att="u"></tag>');
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r10300: Some tests for our sadly broken XMLNode attributes.,
Benjamin Wolsey <=