diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597/Test.as
new file mode 100644
index 000000000..8bafc2eef
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597/Test.as
@@ -0,0 +1,123 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+import com.adobe.test.Utils;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("bug157597 - XML insertChildAfter()");
+
+//TEST(1, true, XML.prototype.hasOwnProperty("insertChildAfter"));
+
+var example:XML =
+2
+;
+
+correct =
+
+2
+3
+;
+
+example.insertChildAfter(example.two, 3);
+
+TEST(2, correct, example);
+
+
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597/output.txt
new file mode 100644
index 000000000..689110c48
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597/output.txt
@@ -0,0 +1 @@
+2 PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597/test.swf
new file mode 100644
index 000000000..384171aad
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597_2/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597_2/Test.as
new file mode 100644
index 000000000..1226b10b4
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597_2/Test.as
@@ -0,0 +1,123 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+import com.adobe.test.Utils;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("bug157597 - XML insertChildBefore()");
+
+
+
+var example:XML =
+2
+;
+
+correct =
+
+1
+2
+;
+
+example.insertChildBefore(example.two, 1);
+
+TEST(2, correct, example);
+
+
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597_2/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597_2/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597_2/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597_2/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597_2/output.txt
new file mode 100644
index 000000000..689110c48
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597_2/output.txt
@@ -0,0 +1 @@
+2 PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597_2/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597_2/test.swf
new file mode 100644
index 000000000..b0356403c
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597_2/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597_2/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597_2/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157597_2/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157735/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157735/Test.as
new file mode 100644
index 000000000..497634a4c
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157735/Test.as
@@ -0,0 +1,113 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+import com.adobe.test.Utils;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("bug157735 - XML comments()");
+
+XML.ignoreComments = false;
+
+var p =
this is normal text
;
+
+TEST(1, "this is normal text", p.toString());
+
+
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157735/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157735/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157735/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157735/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157735/output.txt
new file mode 100644
index 000000000..2844c2eaf
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157735/output.txt
@@ -0,0 +1 @@
+1 PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157735/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157735/test.swf
new file mode 100644
index 000000000..3b9ba96db
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157735/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157735/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157735/test.toml
new file mode 100644
index 000000000..cf6123969
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug157735/test.toml
@@ -0,0 +1 @@
+num_ticks = 1
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug158506/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug158506/Test.as
new file mode 100644
index 000000000..4b0abe605
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug158506/Test.as
@@ -0,0 +1,118 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+import com.adobe.test.Utils;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("bug158506");
+
+
+var x:XML =
+
+
+for each( var node:XML in x..author )
+{ var name:String = node.@name;
+var sign:String = node.@sign;
+TEST(1, "Contino Chuck", name);
+}
+
+
+
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug158506/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug158506/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug158506/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug158506/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug158506/output.txt
new file mode 100644
index 000000000..2844c2eaf
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug158506/output.txt
@@ -0,0 +1 @@
+1 PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug158506/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug158506/test.swf
new file mode 100644
index 000000000..649c61cae
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug158506/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug158506/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug158506/test.toml
new file mode 100644
index 000000000..cf6123969
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug158506/test.toml
@@ -0,0 +1 @@
+num_ticks = 1
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug_564468/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug_564468/Test.as
new file mode 100644
index 000000000..22cdb5a71
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug_564468/Test.as
@@ -0,0 +1,164 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+import com.adobe.test.Utils;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+ /*
+*
+*
+* See http://bugzilla.mozilla.org/show_bug.cgi?id=564468
+*
+*/
+//-----------------------------------------------------------------------------
+
+// var SECTION = "564468";
+// var VERSION = "";
+// var TITLE = " XMLParser need to use caseless compares for ?XML and CDATA tags";
+// var bug = "564468";
+
+
+
+// Unable to access xml declaration node via AS code so instead cause an
+// XMLParser::kUnterminatedXMLDeclaration error to be thrown by XMLParser.getNext().
+// Prior to this fix this code would throw an XMLParser::kUnterminatedProcessingInstruction
+// error was thrown since it fell into the "" processing instruction check block
+var err:String = "no error";
+try {
+ var y:String = " is some cdata!]]>";
+var lowerCDATA:XML = new XML(lowerdata);
+Assert.expectEq("lower CDATA", " is some cdata!]]>", lowerCDATA.toXMLString() );
+
+var mixeddata:String = " is some cdata!]]>";
+var mixedCDATA:XML = new XML(mixeddata);
+Assert.expectEq("mixed CDATA", " is some cdata!]]>", mixedCDATA.toXMLString() );
+
+var upperdata:String = " is some cdata!]]>";
+var upperCDATA:XML = new XML(upperdata);
+Assert.expectEq("upper CDATA", " is some cdata!]]>", upperCDATA.toXMLString() );
+
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug_564468/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug_564468/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug_564468/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug_564468/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug_564468/output.txt
new file mode 100644
index 000000000..655d15e2f
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug_564468/output.txt
@@ -0,0 +1,9 @@
+Asserting for TypeError PASSED!
+lowercase xml PASSED!
+Asserting for TypeError PASSED!
+uppercase xml PASSED!
+Asserting for TypeError PASSED!
+mixed xml PASSED!
+lower CDATA PASSED!
+mixed CDATA PASSED!
+upper CDATA PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug_564468/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug_564468/test.swf
new file mode 100644
index 000000000..6a1e89afc
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug_564468/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug_564468/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug_564468/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/bug_564468/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_1/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_1/Test.as
new file mode 100644
index 000000000..b961f6e88
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_1/Test.as
@@ -0,0 +1,189 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.1 - XML Constructor as Function");
+
+x1 = XML();
+TEST(1, "xml", typeof(x1));
+TEST(2, true, x1 instanceof XML);
+
+correct =
+
+
+
+ DIS
+
+
+;
+
+x1 = XML(correct);
+TEST(3, correct, x1);
+
+text =
+"" +
+" " +
+" " +
+" DIS" +
+" " +
+" " +
+"";
+
+x1 = XML(text);
+TEST(4, correct, x1);
+
+// Make sure it's not copied if it's XML
+x1 =
+
+ two
+;
+
+y1 = XML(x1);
+
+x1.bravo = "three";
+
+correct =
+
+ three
+;
+
+TEST(5, correct, y1);
+
+// Make text node
+x1 = XML("4");
+TEST_XML(6, 4, x1);
+
+x1 = XML(4);
+TEST_XML(7, 4, x1);
+
+// Undefined and null should behave like ""
+x1 = XML(null);
+TEST_XML(8, "", x1);
+
+x1 = XML(undefined);
+TEST_XML(9, "", x1);
+
+XML.prettyPrinting = false;
+
+var thisXML = "GiantsSan Francisco";
+var NULL_OBJECT = null;
+// value is null
+Assert.expectEq( "XML(null).valueOf().toString()", "", XML(null).valueOf().toString() );
+Assert.expectEq( "typeof XML(null)", "xml", typeof XML(null) );
+
+// value is undefined
+Assert.expectEq( "XML(undefined).valueOf().toString()", "", XML(undefined).valueOf().toString() );
+Assert.expectEq( "typeof XML(undefined)", "xml", typeof XML(undefined) );
+
+// value is not supplied
+Assert.expectEq( "XML().valueOf().toString()", "", XML().valueOf().toString() );
+Assert.expectEq( "typeof XML()", "xml", typeof XML() );
+
+// value is supplied
+Assert.expectEq( "XML(thisXML).valueOf().toString()", thisXML, XML(thisXML).valueOf().toString() );
+Assert.expectEq( "typeof XML(thisXML)", "xml", typeof XML(thisXML) );
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_1/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_1/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_1/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_1/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_1/output.txt
new file mode 100644
index 000000000..269aac748
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_1/output.txt
@@ -0,0 +1,17 @@
+1 PASSED!
+2 PASSED!
+3 PASSED!
+4 PASSED!
+5 PASSED!
+6 PASSED!
+7 PASSED!
+8 PASSED!
+9 PASSED!
+XML(null).valueOf().toString() PASSED!
+typeof XML(null) PASSED!
+XML(undefined).valueOf().toString() PASSED!
+typeof XML(undefined) PASSED!
+XML().valueOf().toString() PASSED!
+typeof XML() PASSED!
+XML(thisXML).valueOf().toString() PASSED!
+typeof XML(thisXML) PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_1/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_1/test.swf
new file mode 100644
index 000000000..d329c070a
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_1/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_1/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_1/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_1/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_2/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_2/Test.as
new file mode 100644
index 000000000..b2a9139a3
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_2/Test.as
@@ -0,0 +1,241 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+import com.adobe.test.Utils;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+
+START("13.4.2 - XML Constructor");
+
+x1 = new XML();
+TEST(1, "xml", typeof(x1));
+TEST(2, true, x1 instanceof XML);
+
+correct =
+
+
+
+ DIS
+
+
+;
+
+x1 = new XML(correct);
+TEST_XML(3, correct.toXMLString(), x1);
+
+text =
+"" +
+" " +
+" " +
+" DIS" +
+" " +
+" " +
+"";
+
+x1 = new XML(text);
+TEST(4, correct, x1);
+
+// Make sure it's a copy
+x1 =
+
+ one
+;
+
+y1 = new XML(x1);
+
+x1.bravo.prependChild(two);
+
+correct =
+
+ one
+;
+
+TEST(5, correct, y1);
+
+// Make text node
+x1 = new XML("4");
+TEST_XML(6, "4", x1);
+
+x1 = new XML(4);
+TEST_XML(7, "4", x1);
+
+// Undefined and null should behave like ""
+x1 = new XML(null);
+TEST_XML(8, "", x1);
+
+x1 = new XML(undefined);
+TEST_XML(9, "", x1);
+
+var thisXML = "GiantsSan Francisco";
+
+// value is null
+Assert.expectEq( "typeof new XML(null)", "xml", typeof new XML(null) );
+Assert.expectEq( "new XML(null) instanceof XML", true, new XML(null) instanceof XML);
+Assert.expectEq( "(new XML(null).nodeKind())", "text", (new XML(null)).nodeKind());
+Assert.expectEq( "MYOB = new XML(null); MYOB.toString()", "",
+ (MYOB = new XML(null), MYOB.toString(), MYOB.toString()) );
+
+// value is undefined
+Assert.expectEq( "typeof new XML(undefined)", "xml", typeof new XML(undefined) );
+Assert.expectEq( "new XML(undefined) instanceof XML", true, new XML(undefined) instanceof XML);
+Assert.expectEq( "(new XML(undefined).nodeKind())", "text", (new XML(undefined)).nodeKind());
+Assert.expectEq( "MYOB = new XML(undefined); MYOB.toString()", "",
+ (MYOB = new XML(undefined), MYOB.toString(), MYOB.toString()) );
+
+// value is not supplied
+Assert.expectEq( "typeof new XML()", "xml", typeof new XML() );
+Assert.expectEq( "new XML() instanceof XML", true, new XML() instanceof XML);
+Assert.expectEq( "(new XML().nodeKind())", "text", (new XML()).nodeKind());
+Assert.expectEq( "MYOB = new XML(); MYOB.toString()", "",
+ (MYOB = new XML(), MYOB.toString(), MYOB.toString()) );
+
+//value is a number
+Assert.expectEq( "typeof new XML(5)", "xml", typeof new XML(5) );
+Assert.expectEq( "new XML(5) instanceof XML", true, new XML(5) instanceof XML);
+Assert.expectEq( "(new XML(5).nodeKind())", "text", (new XML(5)).nodeKind());
+Assert.expectEq( "MYOB = new XML(5); MYOB.toString()", "5",
+ (MYOB = new XML(5), MYOB.toString(), MYOB.toString()) );
+
+//value is
+
+// value is supplied
+XML.prettyPrinting = false;
+Assert.expectEq( "typeof new XML(thisXML)", "xml", typeof new XML(thisXML) );
+Assert.expectEq( "new XML(thisXML) instanceof XML", true, new XML(thisXML) instanceof XML);
+Assert.expectEq( "MYOB = new XML(thisXML); MYOB.toString()", "GiantsSan Francisco",
+ (MYOB = new XML(thisXML), MYOB.toString(), MYOB.toString()) );
+
+// Strongly typed XML objects
+var MYXML1:XML = new XML(thisXML);
+Assert.expectEq("Strongly typed XML object", new XML(thisXML).toString(), MYXML1.toString());
+
+var MYXML2:XML = new XML(GiantsSan Francisco);
+Assert.expectEq("var MYXML:XML = new XML(bd);", new XML(thisXML).toString(), MYXML2.toString());
+
+var MYXML3:XML = GiantsSan Francisco;
+Assert.expectEq("var MYXML:XML = bd;", new XML(thisXML).toString(), MYXML3.toString());
+
+var MYXML4:XML = new XML();
+var someXML = new XML();
+var someXML = someXML.toString();
+Assert.expectEq("var MYXML:XML = new XML()", someXML, MYXML4.toString());
+
+var MYXML5:XML = new XML(5);
+Assert.expectEq("var MYXML:XML = new XML(5)", "5", MYXML5.toString());
+
+var a = new XML(" compiled");
+
+Assert.expectEq("XML with PI and comments", "compiled", a.toString());
+
+try {
+ var b = new XML("");
+ result = b;
+} catch(e1) {
+ result = Utils.typeError(e1.toString());
+}
+
+Assert.expectEq("new XML(\"\")", "TypeError: Error #1088", result);
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_2/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_2/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_2/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_2/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_2/output.txt
new file mode 100644
index 000000000..0a1cf1c36
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_2/output.txt
@@ -0,0 +1,35 @@
+1 PASSED!
+2 PASSED!
+3 PASSED!
+4 PASSED!
+5 PASSED!
+6 PASSED!
+7 PASSED!
+8 PASSED!
+9 PASSED!
+typeof new XML(null) PASSED!
+new XML(null) instanceof XML PASSED!
+(new XML(null).nodeKind()) PASSED!
+MYOB = new XML(null); MYOB.toString() PASSED!
+typeof new XML(undefined) PASSED!
+new XML(undefined) instanceof XML PASSED!
+(new XML(undefined).nodeKind()) PASSED!
+MYOB = new XML(undefined); MYOB.toString() PASSED!
+typeof new XML() PASSED!
+new XML() instanceof XML PASSED!
+(new XML().nodeKind()) PASSED!
+MYOB = new XML(); MYOB.toString() PASSED!
+typeof new XML(5) PASSED!
+new XML(5) instanceof XML PASSED!
+(new XML(5).nodeKind()) PASSED!
+MYOB = new XML(5); MYOB.toString() PASSED!
+typeof new XML(thisXML) PASSED!
+new XML(thisXML) instanceof XML PASSED!
+MYOB = new XML(thisXML); MYOB.toString() PASSED!
+Strongly typed XML object PASSED!
+var MYXML:XML = new XML(bd); PASSED!
+var MYXML:XML = bd; PASSED!
+var MYXML:XML = new XML() PASSED!
+var MYXML:XML = new XML(5) PASSED!
+XML with PI and comments PASSED!
+new XML("") PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_2/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_2/test.swf
new file mode 100644
index 000000000..33e2814d5
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_2/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_2/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_2/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_2/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3/Test.as
new file mode 100644
index 000000000..e92cd5d32
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3/Test.as
@@ -0,0 +1,276 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+import com.adobe.test.Utils;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.3 - XML Properties");
+
+// Test defaults
+TEST(1, true, XML.ignoreComments);
+TEST(2, true, XML.ignoreProcessingInstructions);
+TEST(3, true, XML.ignoreWhitespace);
+TEST(4, true, XML.prettyPrinting);
+TEST(5, 2, XML.prettyIndent);
+
+// ignoreComments
+x1 = one;
+
+correct = one;
+
+TEST(6, correct, x1);
+
+XML.ignoreComments = false;
+
+x1 = one;
+
+correct =
+"" + NL() +
+" " + NL() +
+" one" + NL() +
+"";
+
+TEST_XML(7, correct, x1);
+
+
+// ignoreProcessingInstructions
+XML.defaultSettings();
+x1 =
+<>
+
+
+ one
+
+>;
+
+correct =
+
+ one
+;
+
+TEST(8, correct, x1);
+
+XML.ignoreProcessingInstructions = false;
+
+x1 =
+<>
+
+
+ one
+
+>;
+
+correct =
+"" + NL() +
+" " + NL() +
+" one" + NL() +
+"";
+
+TEST_XML(9, correct, x1);
+
+// ignoreWhitespace
+XML.defaultSettings();
+x1 = new XML(" \t\r\n\r\n \t\r\n\r\none \t\r\n\r\n");
+
+correct =
+"" + NL() +
+" one" + NL() +
+"";
+
+TEST_XML(10, correct, x1);
+
+XML.ignoreWhitespace = false;
+XML.prettyPrinting = false;
+
+correct = " \n\n \n\none \n\n";
+x1 = new XML(correct);
+
+TEST_XML(11, correct, x1);
+
+// prettyPrinting
+XML.prettyPrinting = true;
+
+x1 =onetwothreefour;
+
+correct = "" + NL() +
+ " one" + NL() +
+ " two" + NL() +
+ " " + NL() +
+ " " + NL() +
+ " three" + NL() +
+ " four" + NL() +
+ " " + NL() +
+ "";
+
+TEST(12, correct, x1.toString());
+TEST(13, correct, x1.toXMLString());
+
+XML.prettyPrinting = false;
+
+correct = "onetwothreefour";
+TEST(14, correct, x1.toString());
+TEST(15, correct, x1.toXMLString());
+
+// prettyIndent
+XML.prettyPrinting = true;
+XML.prettyIndent = 3;
+
+correct = "" + NL() +
+ " one" + NL() +
+ " two" + NL() +
+ " " + NL() +
+ " " + NL() +
+ " three" + NL() +
+ " four" + NL() +
+ " " + NL() +
+ "";
+
+TEST(16, correct, x1.toString());
+TEST(17, correct, x1.toXMLString());
+
+XML.prettyIndent = 0;
+
+correct = "" + NL() +
+ "one" + NL() +
+ "two" + NL() +
+ "" + NL() +
+ "" + NL() +
+ "three" + NL() +
+ "four" + NL() +
+ "" + NL() +
+ "";
+
+TEST(18, correct, x1.toString());
+TEST(19, correct, x1.toXMLString());
+
+// settings()
+XML.defaultSettings();
+o = XML.settings();
+TEST(20, false, o.ignoreComments);
+TEST(21, false, o.ignoreProcessingInstructions);
+TEST(22, false, o.ignoreWhitespace);
+TEST(23, true, o.prettyPrinting);
+TEST(24, 0, o.prettyIndent);
+
+// setSettings()
+o = XML.settings();
+o.ignoreComments = false;
+o.ignoreProcessingInstructions = false;
+o.ignoreWhitespace = false;
+o.prettyPrinting = false;
+o.prettyIndent = 7;
+
+XML.setSettings(o);
+o = XML.settings();
+TEST(25, false, o.ignoreComments);
+TEST(26, false, o.ignoreProcessingInstructions);
+TEST(27, false, o.ignoreWhitespace);
+TEST(28, false, o.prettyPrinting);
+TEST(29, 7, o.prettyIndent);
+
+// defaultSettings()
+XML.defaultSettings();
+o = XML.settings();
+TEST(30, false, o.ignoreComments);
+TEST(31, false, o.ignoreProcessingInstructions);
+TEST(32, false, o.ignoreWhitespace);
+TEST(33, false, o.prettyPrinting);
+TEST(34, 7, o.prettyIndent);
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3/output.txt
new file mode 100644
index 000000000..ce2b685dd
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3/output.txt
@@ -0,0 +1,34 @@
+1 PASSED!
+2 PASSED!
+3 PASSED!
+4 PASSED!
+5 PASSED!
+6 PASSED!
+7 PASSED!
+8 PASSED!
+9 PASSED!
+10 PASSED!
+11 PASSED!
+12 PASSED!
+13 PASSED!
+14 PASSED!
+15 PASSED!
+16 PASSED!
+17 PASSED!
+18 PASSED!
+19 PASSED!
+20 PASSED!
+21 PASSED!
+22 PASSED!
+23 PASSED!
+24 PASSED!
+25 PASSED!
+26 PASSED!
+27 PASSED!
+28 PASSED!
+29 PASSED!
+30 PASSED!
+31 PASSED!
+32 PASSED!
+33 PASSED!
+34 PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3/test.swf
new file mode 100644
index 000000000..845c9d62d
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_1/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_1/Test.as
new file mode 100644
index 000000000..a41ef626a
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_1/Test.as
@@ -0,0 +1,110 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.3.1 - XML.prototype");
+
+Assert.expectEq( "typeof XML.prototype", "object", typeof XML.prototype);
+Assert.expectEq( "XML.prototype instanceof XML", false, XML.prototype instanceof XML);
+Assert.expectEq( "new XML().prototype instanceof XML", false, new XML().prototype instanceof XML);
+Assert.expectEq( "typeof (new XML().prototype)", "xml", typeof (new XML().prototype));
+
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_1/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_1/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_1/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_1/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_1/output.txt
new file mode 100644
index 000000000..c75bf523b
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_1/output.txt
@@ -0,0 +1,4 @@
+typeof XML.prototype PASSED!
+XML.prototype instanceof XML PASSED!
+new XML().prototype instanceof XML PASSED!
+typeof (new XML().prototype) PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_1/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_1/test.swf
new file mode 100644
index 000000000..394a8c364
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_1/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_1/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_1/test.toml
new file mode 100644
index 000000000..cf6123969
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_1/test.toml
@@ -0,0 +1 @@
+num_ticks = 1
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_2/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_2/Test.as
new file mode 100644
index 000000000..2f70d19a0
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_2/Test.as
@@ -0,0 +1,139 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.3.2 - XML.ignoreComments");
+
+var thisXML = "GiantsSan Francisco"
+
+XML.prettyPrinting = false;
+
+// a) initial value of ignoreComments is true
+
+Assert.expectEq( "XML.ignoreComments", true, XML.ignoreComments);
+
+// toggling value works ok
+Assert.expectEq( "XML.ignoreComments = false, XML.ignoreComments", false, (XML.ignoreComments = false, XML.ignoreComments));
+Assert.expectEq( "XML.ignoreComments = true, XML.ignoreComments", true, (XML.ignoreComments = true, XML.ignoreComments));
+
+// b) if ignoreComments is true, XML comments are ignored when construction the new XML objects
+Assert.expectEq( "MYXML = new XML(thisXML), MYXML.toString()", "GiantsSan Francisco",
+ (XML.ignoreComments = true, MYXML = new XML(thisXML), MYXML.toString() ));
+Assert.expectEq( "MYXML = new XML(thisXML), MYXML.toString() with ignoreComemnts=false", "GiantsSan Francisco",
+ (XML.ignoreComments = false, MYXML = new XML(thisXML), MYXML.toString() ));
+
+// If ignoreComments is true, XML constructor from another XML node ignores comments
+XML.ignoreComments = false;
+var MYXML = new XML(thisXML); // this XML node has comments
+XML.ignoreComments = true;
+var xml2 = new XML(MYXML); // this XML tree should not have comments
+Assert.expectEq( "xml2 = new XML(MYXML), xml2.toString()", "GiantsSan Francisco",
+ (xml2.toString()) );
+XML.ignoreComments = false;
+var xml3 = new XML(MYXML); // this XML tree will have comments
+Assert.expectEq( "xml3 = new XML(MYXML), xml3.toString()", "GiantsSan Francisco",
+ (xml3.toString()) );
+
+
+// c) two attributes { DontEnum, DontDelete }
+// !!@
+
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_2/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_2/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_2/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_2/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_2/output.txt
new file mode 100644
index 000000000..d8d3354ad
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_2/output.txt
@@ -0,0 +1,7 @@
+XML.ignoreComments PASSED!
+XML.ignoreComments = false, XML.ignoreComments PASSED!
+XML.ignoreComments = true, XML.ignoreComments PASSED!
+MYXML = new XML(thisXML), MYXML.toString() PASSED!
+MYXML = new XML(thisXML), MYXML.toString() with ignoreComemnts=false PASSED!
+xml2 = new XML(MYXML), xml2.toString() PASSED!
+xml3 = new XML(MYXML), xml3.toString() PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_2/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_2/test.swf
new file mode 100644
index 000000000..4f7f13500
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_2/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_2/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_2/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_2/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_3/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_3/Test.as
new file mode 100644
index 000000000..c2c89876d
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_3/Test.as
@@ -0,0 +1,140 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.3.3 - XML.ignoreProcessingInstructions");
+
+// We set this to false so we can more easily compare string output
+XML.prettyPrinting = false;
+
+// xml string with processing instructions
+var xmlDoc = "GiantsSan Francisco"
+
+// a) value of ignoreProcessingInstructions
+Assert.expectEq ("XML.ignoreProcessingInstructions", true, (XML.ignoreProcessingInstructions));
+Assert.expectEq( "XML.ignoreProcessingInstructions = false, XML.ignoreProcessingInstructions", false, (XML.ignoreProcessingInstructions = false, XML.ignoreProcessingInstructions));
+Assert.expectEq( "XML.ignoreProcessingInstructions = true, XML.ignoreProcessingInstructions", true, (XML.ignoreProcessingInstructions = true, XML.ignoreProcessingInstructions));
+
+// b) if ignoreProcessingInstructions is true, XML processing instructions are ignored when construction the new XML objects
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.toString()", "GiantsSan Francisco",
+ (XML.ignoreProcessingInstructions = true, MYXML = new XML(xmlDoc), MYXML.toString() ));
+
+// !!@ note that the "" tag magically disappeared.
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.toString() with ignoreProcessingInstructions=false",
+ "GiantsSan Francisco",
+ (XML.ignoreProcessingInstructions = false, MYXML = new XML(xmlDoc), MYXML.toString() ));
+
+
+// If ignoreProcessingInstructions is true, XML constructor from another XML node ignores processing instructions
+XML.ignoreProcessingInstructions = false;
+var MYXML = new XML(xmlDoc); // this XML node has processing instructions
+XML.ignoreProcessingInstructions = true;
+var xml2 = new XML(MYXML); // this XML tree should not have processing instructions
+Assert.expectEq( "xml2 = new XML(MYXML), xml2.toString()", "GiantsSan Francisco",
+ (xml2.toString()) );
+XML.ignoreProcessingInstructions = false;
+var xml3 = new XML(MYXML); // this XML tree will have processing instructions
+Assert.expectEq( "xml3 = new XML(MYXML), xml3.toString()",
+ "GiantsSan Francisco",
+ (xml3.toString()) );
+
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_3/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_3/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_3/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_3/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_3/output.txt
new file mode 100644
index 000000000..dd1dbc71f
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_3/output.txt
@@ -0,0 +1,7 @@
+XML.ignoreProcessingInstructions PASSED!
+XML.ignoreProcessingInstructions = false, XML.ignoreProcessingInstructions PASSED!
+XML.ignoreProcessingInstructions = true, XML.ignoreProcessingInstructions PASSED!
+MYXML = new XML(xmlDoc), MYXML.toString() PASSED!
+MYXML = new XML(xmlDoc), MYXML.toString() with ignoreProcessingInstructions=false PASSED!
+xml2 = new XML(MYXML), xml2.toString() PASSED!
+xml3 = new XML(MYXML), xml3.toString() PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_3/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_3/test.swf
new file mode 100644
index 000000000..d752b07f7
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_3/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_3/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_3/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_3/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_4/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_4/Test.as
new file mode 100644
index 000000000..31e93b355
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_4/Test.as
@@ -0,0 +1,152 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.3.4 - XML.ignoreWhitespace");
+
+// We set this to false so we can more easily compare string output
+XML.prettyPrinting = false;
+
+// xml doc with white space
+var xmlDoc = " Giants\u000DSan\u0020Francisco\u000ABaseball\u0009"
+
+
+// a) value of ignoreWhitespace
+Assert.expectEq( "XML.ignoreWhitespace = false, XML.ignoreWhitespace", false, (XML.ignoreWhitespace = false, XML.ignoreWhitespace));
+Assert.expectEq( "XML.ignoreWhitespace = true, XML.ignoreWhitespace", true, (XML.ignoreWhitespace = true, XML.ignoreWhitespace));
+
+
+// b) whitespace is ignored when true, not ignored when false
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.toString()", "GiantsSan FranciscoBaseball",
+ (XML.ignoreWhitespace = true, MYXML = new XML(xmlDoc), MYXML.toString() ));
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.toString() with ignoreWhitespace=false",
+ " Giants\u000DSan\u0020Francisco\u000ABaseball\u0009",
+ (XML.ignoreWhitespace = false, MYXML = new XML(xmlDoc), MYXML.toString() ));
+
+// c) whitespace characters
+// tab
+xmlDoc = "\ttab";
+Assert.expectEq( "XML with tab and XML.ignoreWhiteSpace = true", "tab",
+ (XML.ignoreWhitespace = true, MYXML = new XML(xmlDoc), MYXML.toString() ));
+
+Assert.expectEq( "XML with tab and XML.ignoreWhiteSpace = false", "\ttab",
+ (XML.ignoreWhitespace = false, MYXML = new XML(xmlDoc), MYXML.toString() ));
+
+// new line
+xmlDoc = "\n\n\ntab\n";
+Assert.expectEq( "XML with new line and XML.ignoreWhiteSpace = true", "tab",
+ (XML.ignoreWhitespace = true, MYXML = new XML(xmlDoc), MYXML.toString() ));
+
+xmlDoc = "\r\ntab\r\n";
+Assert.expectEq( "XML with new line and XML.ignoreWhiteSpace = false", "\r\ntab\r\n",
+ (XML.ignoreWhitespace = false, MYXML = new XML(xmlDoc), MYXML.toString() ));
+
+// d) attributes
+
+xmlDoc = "tab";
+Assert.expectEq( "new XML(\"tab\")", "tab",
+ (XML.ignoreWhitespace = true, MYXML = new XML(xmlDoc), MYXML.toString() ));
+
+Assert.expectEq( "new XML(\"tab\")", "tab",
+ (XML.ignoreWhitespace = false, MYXML = new XML(xmlDoc), MYXML.toString() ));
+
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_4/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_4/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_4/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_4/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_4/output.txt
new file mode 100644
index 000000000..3a68b34c0
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_4/output.txt
@@ -0,0 +1,10 @@
+XML.ignoreWhitespace = false, XML.ignoreWhitespace PASSED!
+XML.ignoreWhitespace = true, XML.ignoreWhitespace PASSED!
+MYXML = new XML(xmlDoc), MYXML.toString() PASSED!
+MYXML = new XML(xmlDoc), MYXML.toString() with ignoreWhitespace=false PASSED!
+XML with tab and XML.ignoreWhiteSpace = true PASSED!
+XML with tab and XML.ignoreWhiteSpace = false PASSED!
+XML with new line and XML.ignoreWhiteSpace = true PASSED!
+XML with new line and XML.ignoreWhiteSpace = false PASSED!
+new XML("tab") PASSED!
+new XML("tab") PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_4/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_4/test.swf
new file mode 100644
index 000000000..0591029cc
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_4/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_4/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_4/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_4/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_5/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_5/Test.as
new file mode 100644
index 000000000..adfe41a3a
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_5/Test.as
@@ -0,0 +1,129 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.3.5 - XML.prettyPrinting");
+
+// xml doc
+var xmlDoc = "GiantsSan FranciscoBaseball"
+
+
+// a) value of prettyPrinting
+Assert.expectEq( "XML.prettyPrinting = false, XML.prettyPrinting", false, (XML.prettyPrinting = false, XML.prettyPrinting));
+Assert.expectEq( "XML.prettyPrinting = true, XML.prettyPrinting", true, (XML.prettyPrinting = true, XML.prettyPrinting));
+
+// b) pretty printing
+
+Assert.expectEq( "MYOB = new XML(xmlDoc); XML.prettyPrinting = false; MYOB.toString()",
+ "GiantsSan FranciscoBaseball",
+ (MYOB = new XML(xmlDoc), XML.prettyPrinting = false, MYOB.toString()));
+
+// !!@ very simple example of printing output
+
+Assert.expectEq( "MYOB = new XML(xmlDoc); XML.prettyPrinting = true; MYOB.toString()",
+ "" + NL() + " Giants" + NL() + " San Francisco" + NL() + " Baseball" + NL() + "",
+ (MYOB = new XML(xmlDoc), XML.prettyPrinting = true, MYOB.toString()));
+
+
+// c) attributes
+
+// TODO
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_5/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_5/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_5/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_5/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_5/output.txt
new file mode 100644
index 000000000..0ad61400d
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_5/output.txt
@@ -0,0 +1,4 @@
+XML.prettyPrinting = false, XML.prettyPrinting PASSED!
+XML.prettyPrinting = true, XML.prettyPrinting PASSED!
+MYOB = new XML(xmlDoc); XML.prettyPrinting = false; MYOB.toString() PASSED!
+MYOB = new XML(xmlDoc); XML.prettyPrinting = true; MYOB.toString() PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_5/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_5/test.swf
new file mode 100644
index 000000000..ec9cbf32d
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_5/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_5/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_5/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_5/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_6/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_6/Test.as
new file mode 100644
index 000000000..9a8ab5af2
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_6/Test.as
@@ -0,0 +1,153 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.3.6 - XML.prettyIndent");
+
+// xml doc
+XML.prettyPrinting = true;
+var xmlDoc = "GiantsSan FranciscoBaseball"
+
+
+// a) value of prettyIndent
+Assert.expectEq( "XML.prettyIndent = 4, XML.prettyIndent", 4, (XML.prettyIndent = 4, XML.prettyIndent));
+Assert.expectEq( "XML.prettyIndent = 2, XML.prettyIndent", 2, (XML.prettyIndent = 2, XML.prettyIndent));
+Assert.expectEq( "XML.prettyIndent = -1, XML.prettyIndent", -1, (XML.prettyIndent = -1, XML.prettyIndent));
+
+// b) pretty printing
+
+Assert.expectEq( "MYOB = new XML(xmlDoc); XML.prettyIndent = 2; MYOB.toString()",
+ "" + NL() + " Giants" + NL() + " San Francisco" + NL() + " Baseball" + NL() + "",
+ (MYOB = new XML(xmlDoc), XML.prettyIndent = 2, MYOB.toString()));
+
+Assert.expectEq( "MYOB = new XML(xmlDoc); XML.prettyIdent = 4; MYOB.toString()",
+ "" + NL() + " Giants" + NL() + " San Francisco" + NL() + " Baseball" + NL() + "",
+ (MYOB = new XML(xmlDoc), XML.prettyIndent = 4, MYOB.toString()));
+
+Assert.expectEq( "MYOB = new XML(xmlDoc); XML.prettyIndent = 1; MYOB.toString()",
+ "" + NL() + " Giants" + NL() + " San Francisco" + NL() + " Baseball" + NL() + "",
+ (MYOB = new XML(xmlDoc), XML.prettyIndent = 1, MYOB.toString()));
+
+// !!@ bad value causes pretty printing to be disabled
+Assert.expectEq( "MYOB = new XML(xmlDoc); XML.prettyIndent = -5; MYOB.toString()",
+ "GiantsSan FranciscoBaseball",
+ //"" + NL() + " Giants" + NL() + " San Francisco" + NL() + " Baseball" + NL() + "",
+ (MYOB = new XML(xmlDoc), XML.prettyIndent = -5, MYOB.toString()));
+
+
+
+// !!@ very simple example of printing output
+XML.prettyPrinting = true;
+XML.prettyIndent = 10;
+Assert.expectEq( "MYOB = new XML(xmlDoc); XML.prettyPrinting = true; MYOB.toString()",
+ "" + NL() + " Giants" + NL() + " San Francisco" + NL() + " Baseball" + NL() + "",
+ (MYOB = new XML(xmlDoc), XML.prettyPrinting = true, MYOB.toString()));
+
+
+// d) attributes
+
+XML.prettyIndent = 5;
+xmlDoc = "GiantsSan FranciscoBaseball"
+Assert.expectEq( "MYOB = new XML(xmlDoc); XML.prettyPrinting = true; MYOB.toString()",
+ "" + NL() + " Giants" + NL() + " San Francisco" + NL() + " Baseball" + NL() + "",
+ (MYOB = new XML(xmlDoc), XML.prettyPrinting = true, MYOB.toString()));
+
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_6/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_6/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_6/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_6/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_6/output.txt
new file mode 100644
index 000000000..4dd55e0c4
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_6/output.txt
@@ -0,0 +1,9 @@
+XML.prettyIndent = 4, XML.prettyIndent PASSED!
+XML.prettyIndent = 2, XML.prettyIndent PASSED!
+XML.prettyIndent = -1, XML.prettyIndent PASSED!
+MYOB = new XML(xmlDoc); XML.prettyIndent = 2; MYOB.toString() PASSED!
+MYOB = new XML(xmlDoc); XML.prettyIdent = 4; MYOB.toString() PASSED!
+MYOB = new XML(xmlDoc); XML.prettyIndent = 1; MYOB.toString() PASSED!
+MYOB = new XML(xmlDoc); XML.prettyIndent = -5; MYOB.toString() PASSED!
+MYOB = new XML(xmlDoc); XML.prettyPrinting = true; MYOB.toString() PASSED!
+MYOB = new XML(xmlDoc); XML.prettyPrinting = true; MYOB.toString() PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_6/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_6/test.swf
new file mode 100644
index 000000000..13d6d7930
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_6/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_6/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_6/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_6/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_7/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_7/Test.as
new file mode 100644
index 000000000..40605e742
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_7/Test.as
@@ -0,0 +1,149 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.3.7 - XML.settings");
+
+// xmlDoc
+
+var settings = XML.settings();
+
+Assert.expectEq( "XML.settings().ignoreComments; ", true, (XML.settings().ignoreComments) );
+Assert.expectEq( "XML.settings().ignoreProcessingInstructions; ", true, (XML.settings().ignoreProcessingInstructions) );
+Assert.expectEq( "XML.settings().ignoreWhitespace; ", true, (XML.settings().ignoreWhitespace) );
+Assert.expectEq( "XML.settings().prettyPrinting; ", true, (XML.settings().prettyPrinting) );
+Assert.expectEq( "XML.settings().prettyIndent; ", 2, (XML.settings().prettyIndent) );
+
+XML.ignoreComments = false;
+Assert.expectEq( "XML.settings().ignoreComments; ", false, (XML.settings().ignoreComments) );
+Assert.expectEq( "XML.settings().ignoreProcessingInstructions; ", true, (XML.settings().ignoreProcessingInstructions) );
+Assert.expectEq( "XML.settings().ignoreWhitespace; ", true, (XML.settings().ignoreWhitespace) );
+Assert.expectEq( "XML.settings().prettyPrinting; ", true, (XML.settings().prettyPrinting) );
+Assert.expectEq( "XML.settings().prettyIndent; ", 2, (XML.settings().prettyIndent) );
+
+XML.ignoreProcessingInstructions = false;
+Assert.expectEq( "XML.settings().ignoreComments; ", false, (XML.settings().ignoreComments) );
+Assert.expectEq( "XML.settings().ignoreProcessingInstructions; ", false, (XML.settings().ignoreProcessingInstructions) );
+Assert.expectEq( "XML.settings().ignoreWhitespace; ", true, (XML.settings().ignoreWhitespace) );
+Assert.expectEq( "XML.settings().prettyPrinting; ", true, (XML.settings().prettyPrinting) );
+Assert.expectEq( "XML.settings().prettyIndent; ", 2, (XML.settings().prettyIndent) );
+
+XML.ignoreWhitespace = false;
+Assert.expectEq( "XML.settings().ignoreComments; ", false, (XML.settings().ignoreComments) );
+Assert.expectEq( "XML.settings().ignoreProcessingInstructions; ", false, (XML.settings().ignoreProcessingInstructions) );
+Assert.expectEq( "XML.settings().ignoreWhitespace; ", false, (XML.settings().ignoreWhitespace) );
+Assert.expectEq( "XML.settings().prettyPrinting; ", true, (XML.settings().prettyPrinting) );
+Assert.expectEq( "XML.settings().prettyIndent; ", 2, (XML.settings().prettyIndent) );
+
+XML.prettyPrinting = false;
+Assert.expectEq( "XML.settings().ignoreComments; ", false, (XML.settings().ignoreComments) );
+Assert.expectEq( "XML.settings().ignoreProcessingInstructions; ", false, (XML.settings().ignoreProcessingInstructions) );
+Assert.expectEq( "XML.settings().ignoreWhitespace; ", false, (XML.settings().ignoreWhitespace) );
+Assert.expectEq( "XML.settings().prettyPrinting; ", false, (XML.settings().prettyPrinting) );
+Assert.expectEq( "XML.settings().prettyIndent; ", 2, (XML.settings().prettyIndent) );
+
+XML.prettyIndent = 4;
+Assert.expectEq( "XML.settings().ignoreComments; ", false, (XML.settings().ignoreComments) );
+Assert.expectEq( "XML.settings().ignoreProcessingInstructions; ", false, (XML.settings().ignoreProcessingInstructions) );
+Assert.expectEq( "XML.settings().ignoreWhitespace; ", false, (XML.settings().ignoreWhitespace) );
+Assert.expectEq( "XML.settings().prettyPrinting; ", false, (XML.settings().prettyPrinting) );
+Assert.expectEq( "XML.settings().prettyIndent; ", 4, (XML.settings().prettyIndent) );
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_7/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_7/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_7/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_7/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_7/output.txt
new file mode 100644
index 000000000..fedea2ec2
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_7/output.txt
@@ -0,0 +1,30 @@
+XML.settings().ignoreComments; PASSED!
+XML.settings().ignoreProcessingInstructions; PASSED!
+XML.settings().ignoreWhitespace; PASSED!
+XML.settings().prettyPrinting; PASSED!
+XML.settings().prettyIndent; PASSED!
+XML.settings().ignoreComments; PASSED!
+XML.settings().ignoreProcessingInstructions; PASSED!
+XML.settings().ignoreWhitespace; PASSED!
+XML.settings().prettyPrinting; PASSED!
+XML.settings().prettyIndent; PASSED!
+XML.settings().ignoreComments; PASSED!
+XML.settings().ignoreProcessingInstructions; PASSED!
+XML.settings().ignoreWhitespace; PASSED!
+XML.settings().prettyPrinting; PASSED!
+XML.settings().prettyIndent; PASSED!
+XML.settings().ignoreComments; PASSED!
+XML.settings().ignoreProcessingInstructions; PASSED!
+XML.settings().ignoreWhitespace; PASSED!
+XML.settings().prettyPrinting; PASSED!
+XML.settings().prettyIndent; PASSED!
+XML.settings().ignoreComments; PASSED!
+XML.settings().ignoreProcessingInstructions; PASSED!
+XML.settings().ignoreWhitespace; PASSED!
+XML.settings().prettyPrinting; PASSED!
+XML.settings().prettyIndent; PASSED!
+XML.settings().ignoreComments; PASSED!
+XML.settings().ignoreProcessingInstructions; PASSED!
+XML.settings().ignoreWhitespace; PASSED!
+XML.settings().prettyPrinting; PASSED!
+XML.settings().prettyIndent; PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_7/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_7/test.swf
new file mode 100644
index 000000000..ce882e3cb
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_7/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_7/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_7/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_7/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_8/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_8/Test.as
new file mode 100644
index 000000000..26598d521
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_8/Test.as
@@ -0,0 +1,183 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.3.8 - XML.setSettings(settings)");
+
+// a) called with a settings object
+var settings = XML.settings();
+
+settings.ignoreComments = false;
+settings.ignoreProcessingInstructions = false;
+settings.ignoreWhitespace = false;
+settings.prettyPrinting = false;
+settings.prettyIndent = 4;
+
+Assert.expectEq( "XML.settings().ignoreComments; ", true, (XML.settings().ignoreComments) );
+Assert.expectEq( "XML.settings().ignoreProcessingInstructions; ", true, (XML.settings().ignoreProcessingInstructions) );
+Assert.expectEq( "XML.settings().ignoreWhitespace; ", true, (XML.settings().ignoreWhitespace) );
+Assert.expectEq( "XML.settings().prettyPrinting; ", true, (XML.settings().prettyPrinting) );
+Assert.expectEq( "XML.settings().prettyIndent; ", 2, (XML.settings().prettyIndent) );
+
+XML.setSettings (settings);
+
+Assert.expectEq( "XML.settings().ignoreComments; ", false, (XML.settings().ignoreComments) );
+Assert.expectEq( "XML.settings().ignoreProcessingInstructions; ", false, (XML.settings().ignoreProcessingInstructions) );
+Assert.expectEq( "XML.settings().ignoreWhitespace; ", false, (XML.settings().ignoreWhitespace) );
+Assert.expectEq( "XML.settings().prettyPrinting; ", false, (XML.settings().prettyPrinting) );
+Assert.expectEq( "XML.settings().prettyIndent; ", 4, (XML.settings().prettyIndent) );
+
+// setting null restores defaults
+XML.setSettings (null);
+
+Assert.expectEq( "XML.settings(null); XML.settings().ignoreComments; ", true, (XML.settings().ignoreComments) );
+Assert.expectEq( "XML.settings(null); XML.settings().ignoreProcessingInstructions; ", true, (XML.settings().ignoreProcessingInstructions) );
+Assert.expectEq( "XML.settings(null); XML.settings().ignoreWhitespace; ", true, (XML.settings().ignoreWhitespace) );
+Assert.expectEq( "XML.settings(null); XML.settings().prettyPrinting; ", true, (XML.settings().prettyPrinting) );
+Assert.expectEq( "XML.settings(null); XML.settings().prettyIndent; ", 2, (XML.settings().prettyIndent) );
+
+XML.setSettings (settings);
+// does setting a bogus value restore defaults? No.
+XML.setSettings ([1, 2, 3, 4]);
+
+Assert.expectEq( "XML.settings().ignoreComments; ", false, (XML.settings().ignoreComments) );
+Assert.expectEq( "XML.settings().ignoreProcessingInstructions; ", false, (XML.settings().ignoreProcessingInstructions) );
+Assert.expectEq( "XML.settings().ignoreWhitespace; ", false, (XML.settings().ignoreWhitespace) );
+Assert.expectEq( "XML.settings().prettyPrinting; ", false, (XML.settings().prettyPrinting) );
+Assert.expectEq( "XML.settings().prettyIndent; ", 4, (XML.settings().prettyIndent) );
+
+// does setting a bogus value restore defaults? No.
+XML.setSettings (5);
+
+Assert.expectEq( "XML.settings().ignoreComments; ", false, (XML.settings().ignoreComments) );
+Assert.expectEq( "XML.settings().ignoreProcessingInstructions; ", false, (XML.settings().ignoreProcessingInstructions) );
+Assert.expectEq( "XML.settings().ignoreWhitespace; ", false, (XML.settings().ignoreWhitespace) );
+Assert.expectEq( "XML.settings().prettyPrinting; ", false, (XML.settings().prettyPrinting) );
+Assert.expectEq( "XML.settings().prettyIndent; ", 4, (XML.settings().prettyIndent) );
+
+// does setting a bogus value restore defaults? No.
+XML.setSettings ("");
+
+Assert.expectEq( "XML.setSettings (\"\"); XML.settings().ignoreComments; ", false, (XML.settings().ignoreComments) );
+Assert.expectEq( "XML.setSettings (\"\"); XML.settings().ignoreProcessingInstructions; ", false, (XML.settings().ignoreProcessingInstructions) );
+Assert.expectEq( "XML.setSettings (\"\"); XML.settings().ignoreWhitespace; ", false, (XML.settings().ignoreWhitespace) );
+Assert.expectEq( "XML.setSettings (\"\"); XML.settings().prettyPrinting; ", false, (XML.settings().prettyPrinting) );
+Assert.expectEq( "XML.setSettings (\"\"); XML.settings().prettyIndent; ", 4, (XML.settings().prettyIndent) );
+
+// this restores defaults
+XML.setSettings (undefined);
+
+Assert.expectEq( "XML.setSettings (undefined); XML.settings().ignoreComments; ", true, (XML.settings().ignoreComments) );
+Assert.expectEq( "XML.setSettings (undefined); XML.settings().ignoreProcessingInstructions; ", true, (XML.settings().ignoreProcessingInstructions) );
+Assert.expectEq( "XML.setSettings (undefined); XML.settings().ignoreWhitespace; ", true, (XML.settings().ignoreWhitespace) );
+Assert.expectEq( "XML.setSettings (undefined); XML.settings().prettyPrinting; ", true, (XML.settings().prettyPrinting) );
+Assert.expectEq( "XML.setSettings (undefined); XML.settings().prettyIndent; ", 2, (XML.settings().prettyIndent) );
+
+// this restore defaults
+XML.setSettings (settings);
+XML.setSettings ();
+
+Assert.expectEq( "XML.setSettings (); XML.settings().ignoreComments; ", true, (XML.settings().ignoreComments) );
+Assert.expectEq( "XML.setSettings (); XML.settings().ignoreProcessingInstructions; ", true, (XML.settings().ignoreProcessingInstructions) );
+Assert.expectEq( "XML.setSettings (); XML.settings().ignoreWhitespace; ", true, (XML.settings().ignoreWhitespace) );
+Assert.expectEq( "XML.setSettings (); XML.settings().prettyPrinting; ", true, (XML.settings().prettyPrinting) );
+Assert.expectEq( "XML.setSettings (); XML.settings().prettyIndent; ", 2, (XML.settings().prettyIndent) );
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_8/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_8/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_8/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_8/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_8/output.txt
new file mode 100644
index 000000000..96e854b41
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_8/output.txt
@@ -0,0 +1,40 @@
+XML.settings().ignoreComments; PASSED!
+XML.settings().ignoreProcessingInstructions; PASSED!
+XML.settings().ignoreWhitespace; PASSED!
+XML.settings().prettyPrinting; PASSED!
+XML.settings().prettyIndent; PASSED!
+XML.settings().ignoreComments; PASSED!
+XML.settings().ignoreProcessingInstructions; PASSED!
+XML.settings().ignoreWhitespace; PASSED!
+XML.settings().prettyPrinting; PASSED!
+XML.settings().prettyIndent; PASSED!
+XML.settings(null); XML.settings().ignoreComments; PASSED!
+XML.settings(null); XML.settings().ignoreProcessingInstructions; PASSED!
+XML.settings(null); XML.settings().ignoreWhitespace; PASSED!
+XML.settings(null); XML.settings().prettyPrinting; PASSED!
+XML.settings(null); XML.settings().prettyIndent; PASSED!
+XML.settings().ignoreComments; PASSED!
+XML.settings().ignoreProcessingInstructions; PASSED!
+XML.settings().ignoreWhitespace; PASSED!
+XML.settings().prettyPrinting; PASSED!
+XML.settings().prettyIndent; PASSED!
+XML.settings().ignoreComments; PASSED!
+XML.settings().ignoreProcessingInstructions; PASSED!
+XML.settings().ignoreWhitespace; PASSED!
+XML.settings().prettyPrinting; PASSED!
+XML.settings().prettyIndent; PASSED!
+XML.setSettings (""); XML.settings().ignoreComments; PASSED!
+XML.setSettings (""); XML.settings().ignoreProcessingInstructions; PASSED!
+XML.setSettings (""); XML.settings().ignoreWhitespace; PASSED!
+XML.setSettings (""); XML.settings().prettyPrinting; PASSED!
+XML.setSettings (""); XML.settings().prettyIndent; PASSED!
+XML.setSettings (undefined); XML.settings().ignoreComments; PASSED!
+XML.setSettings (undefined); XML.settings().ignoreProcessingInstructions; PASSED!
+XML.setSettings (undefined); XML.settings().ignoreWhitespace; PASSED!
+XML.setSettings (undefined); XML.settings().prettyPrinting; PASSED!
+XML.setSettings (undefined); XML.settings().prettyIndent; PASSED!
+XML.setSettings (); XML.settings().ignoreComments; PASSED!
+XML.setSettings (); XML.settings().ignoreProcessingInstructions; PASSED!
+XML.setSettings (); XML.settings().ignoreWhitespace; PASSED!
+XML.setSettings (); XML.settings().prettyPrinting; PASSED!
+XML.setSettings (); XML.settings().prettyIndent; PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_8/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_8/test.swf
new file mode 100644
index 000000000..ccb64ea32
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_8/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_8/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_8/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_8/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_9/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_9/Test.as
new file mode 100644
index 000000000..a583298dd
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_9/Test.as
@@ -0,0 +1,133 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.3.9 - XML.defaultSettings()");
+
+Assert.expectEq( "settings = XML.defaultSettings(), settings.ignoreComments", true,
+ (settings = XML.defaultSettings(), settings.ignoreComments) );
+Assert.expectEq( "settings = XML.defaultSettings(), settings.ignoreProcessingInstructions", true,
+ (settings = XML.defaultSettings(), settings.ignoreProcessingInstructions) );
+Assert.expectEq( "settings = XML.defaultSettings(), settings.ignoreWhitespace", true,
+ (settings = XML.defaultSettings(), settings.ignoreWhitespace) );
+Assert.expectEq( "settings = XML.defaultSettings(), settings.prettyPrinting", true,
+ (settings = XML.defaultSettings(), settings.prettyPrinting) );
+Assert.expectEq( "settings = XML.defaultSettings(), settings.prettyIndent", 2,
+ (settings = XML.defaultSettings(), settings.prettyIndent) );
+
+var tempSettings = XML.settings();
+tempSettings.ignoreComments = false;
+tempSettings.ignoreProcessingInstructions = false;
+tempSettings.ignoreWhitespace = false;
+tempSettings.prettyPrinting = false;
+tempSettings.prettyIndent = 4;
+
+Assert.expectEq( "XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.ignoreComments", true,
+ (XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.ignoreComments) );
+Assert.expectEq( "XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.ignoreProcessingInstructions", true,
+ (XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.ignoreProcessingInstructions) );
+Assert.expectEq( "XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.ignoreWhitespace", true,
+ (XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.ignoreWhitespace) );
+Assert.expectEq( "XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.prettyPrinting", true,
+ (XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.prettyPrinting) );
+Assert.expectEq( "XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.prettyIndent", 2,
+ (XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.prettyIndent) );
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_9/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_9/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_9/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_9/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_9/output.txt
new file mode 100644
index 000000000..e8558e241
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_9/output.txt
@@ -0,0 +1,10 @@
+settings = XML.defaultSettings(), settings.ignoreComments PASSED!
+settings = XML.defaultSettings(), settings.ignoreProcessingInstructions PASSED!
+settings = XML.defaultSettings(), settings.ignoreWhitespace PASSED!
+settings = XML.defaultSettings(), settings.prettyPrinting PASSED!
+settings = XML.defaultSettings(), settings.prettyIndent PASSED!
+XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.ignoreComments PASSED!
+XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.ignoreProcessingInstructions PASSED!
+XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.ignoreWhitespace PASSED!
+XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.prettyPrinting PASSED!
+XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.prettyIndent PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_9/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_9/test.swf
new file mode 100644
index 000000000..cd7263bce
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_9/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_9/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_9/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_3_9/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_1/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_1/Test.as
new file mode 100644
index 000000000..4be640e55
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_1/Test.as
@@ -0,0 +1,107 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.4.1 - XML Constructor");
+
+Assert.expectEq( "XML.prototype.constructor == XML", true, XML.prototype.constructor == XML);
+Assert.expectEq( "XML.prototype.constructor === XML", true, XML.prototype.constructor === XML);
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_1/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_1/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_1/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_1/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_1/output.txt
new file mode 100644
index 000000000..2bea6214a
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_1/output.txt
@@ -0,0 +1,2 @@
+XML.prototype.constructor == XML PASSED!
+XML.prototype.constructor === XML PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_1/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_1/test.swf
new file mode 100644
index 000000000..64295db78
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_1/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_1/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_1/test.toml
new file mode 100644
index 000000000..cf6123969
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_1/test.toml
@@ -0,0 +1 @@
+num_ticks = 1
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_10/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_10/Test.as
new file mode 100644
index 000000000..f39ece1d2
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_10/Test.as
@@ -0,0 +1,147 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.4.10 - XML contains()");
+
+//TEST(1, true, XML.prototype.hasOwnProperty("contains"));
+
+emps =
+
+ Jim25
+ Joe20
+;
+
+TEST(2, true, emps.contains(emps));
+
+var xmlDoc = "GiantsSan FranciscoPadresSan Diego";
+
+// same object, returns true
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.contains(MYMXL)", true,
+ (MYXML = new XML(xmlDoc), MYXML.contains(MYXML)) );
+
+// duplicated object, returns true
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.contains(MYMXL.copy())", true,
+ (MYXML = new XML(xmlDoc), MYXML.contains(MYXML.copy())) );
+
+// identical objects, returns true
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML2 = new XML(xmlDoc), MYXML.contains(MYMXL2)", true,
+ (MYXML = new XML(xmlDoc), MYXML2 = new XML(xmlDoc), MYXML.contains(MYXML2)) );
+
+// identical objects, returns true
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML2 = new XML(xmlDoc), MYXML2.contains(MYMXL)", true,
+ (MYXML = new XML(xmlDoc), MYXML2 = new XML(xmlDoc), MYXML2.contains(MYXML)) );
+
+// slightly different objects, returns false
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML2 = new XML(xmlDoc), MYXML2.foo = 'bar', MYXML.contains(MYMXL2)", false,
+ (MYXML = new XML(xmlDoc), MYXML2 = new XML(xmlDoc), MYXML2.foo = 'bar', MYXML.contains(MYXML2)) );
+
+// slightly different objects #2, returns false
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML2 = new XML(xmlDoc), MYXML2.Team[0].foo = 'bar', MYXML.contains(MYMXL2)", false,
+ (MYXML = new XML(xmlDoc), MYXML2 = new XML(xmlDoc), MYXML2.Team[0].foo = 'bar', MYXML.contains(MYXML2)) );
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.Team[0].contains('Giants')", false,
+ (MYXML = new XML(xmlDoc), MYXML.Team[0].contains('Giants')) );
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.Team[1].contains('Giants')", false,
+ (MYXML = new XML(xmlDoc), MYXML.Team[1].contains('Giants')) );
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.City.contains('Giants')", false,
+ (MYXML = new XML(xmlDoc), MYXML.City.contains('Giants')) );
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_10/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_10/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_10/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_10/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_10/output.txt
new file mode 100644
index 000000000..06a657c96
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_10/output.txt
@@ -0,0 +1,10 @@
+2 PASSED!
+MYXML = new XML(xmlDoc), MYXML.contains(MYMXL) PASSED!
+MYXML = new XML(xmlDoc), MYXML.contains(MYMXL.copy()) PASSED!
+MYXML = new XML(xmlDoc), MYXML2 = new XML(xmlDoc), MYXML.contains(MYMXL2) PASSED!
+MYXML = new XML(xmlDoc), MYXML2 = new XML(xmlDoc), MYXML2.contains(MYMXL) PASSED!
+MYXML = new XML(xmlDoc), MYXML2 = new XML(xmlDoc), MYXML2.foo = 'bar', MYXML.contains(MYMXL2) PASSED!
+MYXML = new XML(xmlDoc), MYXML2 = new XML(xmlDoc), MYXML2.Team[0].foo = 'bar', MYXML.contains(MYMXL2) PASSED!
+MYXML = new XML(xmlDoc), MYXML.Team[0].contains('Giants') PASSED!
+MYXML = new XML(xmlDoc), MYXML.Team[1].contains('Giants') PASSED!
+MYXML = new XML(xmlDoc), MYXML.City.contains('Giants') PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_10/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_10/test.swf
new file mode 100644
index 000000000..e79429e61
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_10/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_10/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_10/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_10/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_11/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_11/Test.as
new file mode 100644
index 000000000..9adffc512
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_11/Test.as
@@ -0,0 +1,169 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.4.11 - XML copy()");
+
+//TEST(1, true, XML.prototype.hasOwnProperty("copy"));
+
+emps =
+
+ Jim25
+ Joe20
+;
+
+correct =
+Jim25;
+
+x1 = emps.employee[0].copy();
+
+TEST(2, undefined, x1.parent());
+TEST(3, correct, x1);
+
+// Make sure we're getting a copy, not a ref to orig.
+emps =
+
+ Jim25
+ Joe20
+;
+
+correct =
+Jim25
+
+empCopy = emps.employee[0].copy();
+
+emps.employee[0].fname[0] = "Sally";
+
+TEST(4, correct, empCopy);
+
+// Try copying whole XML twice
+emps =
+
+ Jim25
+ Joe20
+;
+
+empCopy = emps.copy();
+x1 = empCopy.copy();
+
+TEST(5, x1, emps);
+
+XML.prettyPrinting = false;
+var xmlDoc = "GiantsSan FranciscoPadresSan Diego";
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), XMLCOPY = MYXML.copy()", xmlDoc,
+ (MYXML = new XML(xmlDoc), XMLCOPY = MYXML.copy(), XMLCOPY.toString()) );
+Assert.expectEq( "MYXML = new XML(null), XMLCOPY = MYXML.copy()", "",
+ (MYXML = new XML(null), XMLCOPY = MYXML.copy(), XMLCOPY.toString()) );
+Assert.expectEq( "MYXML = new XML(undefined), XMLCOPY = MYXML.copy()", MYXML.toString(),
+ (MYXML = new XML(undefined), XMLCOPY = MYXML.copy(), XMLCOPY.toString()) );
+Assert.expectEq( "MYXML = new XML(), XMLCOPY = MYXML.copy()", MYXML.toString(),
+ (MYXML = new XML(), XMLCOPY = MYXML.copy(), XMLCOPY.toString()) );
+Assert.expectEq( "MYXML = new XML(xmlDoc), XMLCOPY = MYXML.Team.copy()", "Giants" + NL() + "Padres",
+ (MYXML = new XML(xmlDoc), XMLCOPY = MYXML.Team.copy(), XMLCOPY.toString()) );
+
+// Make sure it's a copy
+var MYXML = new XML(xmlDoc);
+var MYXML2 = MYXML.copy();
+Assert.expectEq ("MYXML == MYXML.copy()", true, (MYXML == MYXML.copy()));
+MYXML2.foo = "bar";
+Assert.expectEq ("MYXML == MYXML2 where MYXML2 is a copy that has been changed", false, (MYXML == MYXML2));
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_11/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_11/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_11/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_11/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_11/output.txt
new file mode 100644
index 000000000..a6c5a9c2b
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_11/output.txt
@@ -0,0 +1,11 @@
+2 PASSED!
+3 PASSED!
+4 PASSED!
+5 PASSED!
+MYXML = new XML(xmlDoc), XMLCOPY = MYXML.copy() PASSED!
+MYXML = new XML(null), XMLCOPY = MYXML.copy() PASSED!
+MYXML = new XML(undefined), XMLCOPY = MYXML.copy() PASSED!
+MYXML = new XML(), XMLCOPY = MYXML.copy() PASSED!
+MYXML = new XML(xmlDoc), XMLCOPY = MYXML.Team.copy() PASSED!
+MYXML == MYXML.copy() PASSED!
+MYXML == MYXML2 where MYXML2 is a copy that has been changed PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_11/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_11/test.swf
new file mode 100644
index 000000000..f74cca676
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_11/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_11/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_11/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_11/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_12/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_12/Test.as
new file mode 100644
index 000000000..961fa7b97
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_12/Test.as
@@ -0,0 +1,169 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.4.12 - XML descendants");
+
+//TEST(1, true, XML.prototype.hasOwnProperty("descendants"));
+
+x1 =
+
+ one
+
+ two
+ three
+
+;
+
+TEST(2, three, x1.charlie.descendants("bravo"));
+TEST(3, new XMLList("onethree"), x1.descendants("bravo"));
+
+// Test *
+correct = new XMLList("oneonetwothreetwothreethree");
+
+XML.prettyPrinting = false;
+TEST(4, correct, x1.descendants("*"));
+TEST(5, correct, x1.descendants());
+XML.prettyPrinting = true;
+
+XML.prettyPrinting = false;
+
+var xmlDoc = "barGiantsbarbarSan FranciscoPadresSan Diego";
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.descendants('Team')", "Giantsbar" + NL() + "Padres",
+ (MYXML = new XML(xmlDoc), MYXML.descendants('Team').toString()) );
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.descendants('Team').length()", 2,
+ (MYXML = new XML(xmlDoc), MYXML.descendants('Team').length()) );
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.descendants('Team') instanceof XMLList", true,
+ (MYXML = new XML(xmlDoc), MYXML.descendants('Team') instanceof XMLList) );
+
+// find multiple levels of descendants
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.descendants('foo')", "bar" + NL() + "bar" + NL() + "bar",
+ (MYXML = new XML(xmlDoc), MYXML.descendants('foo').toString()) );
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.descendants('foo').length()", 3,
+ (MYXML = new XML(xmlDoc), MYXML.descendants('foo').length()) );
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.descendants('foo') instanceof XMLList", true,
+ (MYXML = new XML(xmlDoc), MYXML.descendants('foo') instanceof XMLList) );
+
+// no matching descendants
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.descendants('nomatch')", "",
+ (MYXML = new XML(xmlDoc), MYXML.descendants('nomatch').toString()) );
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.descendants('nomatch').length()", 0,
+ (MYXML = new XML(xmlDoc), MYXML.descendants('nomatch').length()) );
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.descendants('nomatch') instanceof XMLList", true,
+ (MYXML = new XML(xmlDoc), MYXML.descendants('nomatch') instanceof XMLList) );
+
+// descendant with hyphen
+
+e =
+
+ Joe20
+ Sue30
+
+
+correct =
+Joe +
+Sue;
+
+names = e.descendants("first-name");
+
+Assert.expectEq("Descendant with hyphen", correct.toString(), names.toString());
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_12/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_12/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_12/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_12/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_12/output.txt
new file mode 100644
index 000000000..aa22e6d3f
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_12/output.txt
@@ -0,0 +1,14 @@
+2 PASSED!
+3 PASSED!
+4 PASSED!
+5 PASSED!
+MYXML = new XML(xmlDoc), MYXML.descendants('Team') PASSED!
+MYXML = new XML(xmlDoc), MYXML.descendants('Team').length() PASSED!
+MYXML = new XML(xmlDoc), MYXML.descendants('Team') instanceof XMLList PASSED!
+MYXML = new XML(xmlDoc), MYXML.descendants('foo') PASSED!
+MYXML = new XML(xmlDoc), MYXML.descendants('foo').length() PASSED!
+MYXML = new XML(xmlDoc), MYXML.descendants('foo') instanceof XMLList PASSED!
+MYXML = new XML(xmlDoc), MYXML.descendants('nomatch') PASSED!
+MYXML = new XML(xmlDoc), MYXML.descendants('nomatch').length() PASSED!
+MYXML = new XML(xmlDoc), MYXML.descendants('nomatch') instanceof XMLList PASSED!
+Descendant with hyphen PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_12/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_12/test.swf
new file mode 100644
index 000000000..dcbc88582
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_12/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_12/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_12/test.toml
new file mode 100644
index 000000000..cf6123969
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_12/test.toml
@@ -0,0 +1 @@
+num_ticks = 1
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_13/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_13/Test.as
new file mode 100644
index 000000000..7282c7c69
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_13/Test.as
@@ -0,0 +1,134 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.4.13 - XML elements()");
+
+//TEST(1, true, XML.prototype.hasOwnProperty("elements"));
+
+var xmlDoc = "GiantsSan FranciscoPadresSan Diego";
+
+// !!@ need to verify results of these test cases
+// !!@ elements appears to be broken in Rhino
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.elements('Team').toString()", "Giants" + NL() + "Padres",
+ (MYXML = new XML(xmlDoc), MYXML.elements('Team').toString()) );
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.elements('TEAM').toString()", "",
+ (MYXML = new XML(xmlDoc), MYXML.elements('TEAM').toString()) );
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.elements('bogus').toString()", "",
+ (MYXML = new XML(xmlDoc), MYXML.elements('bogus').toString()) );
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.elements()", "Giants" + NL() + "San Francisco" + NL() + "Padres" + NL() + "San Diego",
+ (MYXML = new XML(xmlDoc), MYXML.elements().toString()) );
+
+xmlDoc = "GiantsSan Francisco";
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.elements('City').toString()", "San Francisco",
+ (MYXML = new XML(xmlDoc), MYXML.elements('City').toString()) );
+
+xmlDoc = "GiantsSan FranciscoPadresSan Diego";
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.elements('MLB')", "" + NL() + " Giants" + NL() + " San Francisco" + NL() + " Padres" + NL() + " San Diego" + NL() + "",
+ (MYXML = new XML(xmlDoc), MYXML.elements('MLB').toString()) );
+
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_13/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_13/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_13/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_13/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_13/output.txt
new file mode 100644
index 000000000..fc207b85a
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_13/output.txt
@@ -0,0 +1,6 @@
+MYXML = new XML(xmlDoc), MYXML.elements('Team').toString() PASSED!
+MYXML = new XML(xmlDoc), MYXML.elements('TEAM').toString() PASSED!
+MYXML = new XML(xmlDoc), MYXML.elements('bogus').toString() PASSED!
+MYXML = new XML(xmlDoc), MYXML.elements() PASSED!
+MYXML = new XML(xmlDoc), MYXML.elements('City').toString() PASSED!
+MYXML = new XML(xmlDoc), MYXML.elements('MLB') PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_13/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_13/test.swf
new file mode 100644
index 000000000..1ce7ae961
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_13/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_13/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_13/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_13/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_14/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_14/Test.as
new file mode 100644
index 000000000..66f5debd8
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_14/Test.as
@@ -0,0 +1,144 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.4.14 - XML hasOwnProperty()");
+
+//TEST(1, true, XML.prototype.hasOwnProperty("hasOwnProperty"));
+
+x1 =
+
+ one
+
+ two
+ three
+ four
+
+
+;
+
+// Returns true for elements/attributes
+TEST(2, true, x1.hasOwnProperty("bravo"));
+TEST(3, true, x1.hasOwnProperty("@attr1"));
+TEST(4, false, x1.hasOwnProperty("foobar"));
+
+// Test for XML Prototype Object - returns true for XML methods.
+TEST(5, true, XML.prototype.hasOwnProperty("toString"));
+TEST(6, false, XML.prototype.hasOwnProperty("foobar"));
+
+var xmlDoc = "JohnWalton25"
+
+// !!@ we're not supporting prototype properties
+// propertyName as a string
+Assert.expectEq( "XML.prototype.hasOwnProperty('copy')", true,
+ (XML.prototype.hasOwnProperty('copy')));
+Assert.expectEq( "XML.prototype.hasOwnProperty('hasSimpleContent')", true,
+ (XML.prototype.hasOwnProperty('hasSimpleContent')));
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.hasOwnProperty('copy')", false,
+ (MYXML = new XML(xmlDoc), MYXML.hasOwnProperty('copy')));
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.hasOwnProperty('hasSimpleContent')", false,
+ (MYXML = new XML(xmlDoc), MYXML.hasOwnProperty('hasSimpleContent')));
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.hasOwnProperty('firstname')", true,
+ (MYXML = new XML(xmlDoc), MYXML.hasOwnProperty('firstname')));
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.hasOwnProperty('lastname')", true,
+ (MYXML = new XML(xmlDoc), MYXML.hasOwnProperty('lastname')));
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_14/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_14/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_14/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_14/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_14/output.txt
new file mode 100644
index 000000000..bc064f869
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_14/output.txt
@@ -0,0 +1,11 @@
+2 PASSED!
+3 PASSED!
+4 PASSED!
+5 PASSED!
+6 PASSED!
+XML.prototype.hasOwnProperty('copy') PASSED!
+XML.prototype.hasOwnProperty('hasSimpleContent') PASSED!
+MYXML = new XML(xmlDoc), MYXML.hasOwnProperty('copy') PASSED!
+MYXML = new XML(xmlDoc), MYXML.hasOwnProperty('hasSimpleContent') PASSED!
+MYXML = new XML(xmlDoc), MYXML.hasOwnProperty('firstname') PASSED!
+MYXML = new XML(xmlDoc), MYXML.hasOwnProperty('lastname') PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_14/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_14/test.swf
new file mode 100644
index 000000000..ee9a9fedd
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_14/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_14/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_14/test.toml
new file mode 100644
index 000000000..cf6123969
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_14/test.toml
@@ -0,0 +1 @@
+num_ticks = 1
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_15/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_15/Test.as
new file mode 100644
index 000000000..28388ddb4
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_15/Test.as
@@ -0,0 +1,160 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.4.15 - hasComplexContent()");
+
+//TEST(1, true, XML.prototype.hasOwnProperty("hasComplexContent"));
+
+x1 =
+
+ one
+
+ two
+ three
+ four
+
+
+ five
+
+
+ six
+ seven
+
+
+;
+
+TEST(2, true, x1.hasComplexContent());
+TEST(3, false, x1.bravo.hasComplexContent());
+TEST(4, true, x1.charlie.hasComplexContent());
+TEST(5, false, x1.delta.hasComplexContent());
+TEST(6, false, x1.foxtrot.hasComplexContent());
+TEST(7, false, x1.golf.hasComplexContent());
+TEST(8, false, x1.hotel.hasComplexContent());
+TEST(9, false, x1.@attr1.hasComplexContent());
+TEST(10, false, x1.bravo.child(0).hasComplexContent());
+TEST(11, true, x1.india.hasComplexContent());
+
+var xmlDoc = "JohnWalton25"
+
+// propertyName as a string
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.hasComplexContent()", true,
+ (MYXML = new XML(xmlDoc), MYXML.hasComplexContent()));
+
+xmlDoc = "John"
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.hasComplexContent()", false,
+ (MYXML = new XML(xmlDoc), MYXML.hasComplexContent()));
+
+XML.ignoreComments = false;
+xmlDoc = ""
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.hasComplexContent()", false,
+ (MYXML = new XML(xmlDoc), MYXML.hasComplexContent()));
+
+XML.ignoreProcessingInstructions = false;
+xmlDoc = ""
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.hasComplexContent()", false,
+ (MYXML = new XML(xmlDoc), MYXML.hasComplexContent()));
+
+XML.ignoreComments = false;
+xmlDoc = "foo"
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.hasComplexContent()", false,
+ (MYXML = new XML(xmlDoc), MYXML.hasComplexContent()));
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_15/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_15/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_15/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_15/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_15/output.txt
new file mode 100644
index 000000000..2cfe68756
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_15/output.txt
@@ -0,0 +1,15 @@
+2 PASSED!
+3 PASSED!
+4 PASSED!
+5 PASSED!
+6 PASSED!
+7 PASSED!
+8 PASSED!
+9 PASSED!
+10 PASSED!
+11 PASSED!
+MYXML = new XML(xmlDoc), MYXML.hasComplexContent() PASSED!
+MYXML = new XML(xmlDoc), MYXML.hasComplexContent() PASSED!
+MYXML = new XML(xmlDoc), MYXML.hasComplexContent() PASSED!
+MYXML = new XML(xmlDoc), MYXML.hasComplexContent() PASSED!
+MYXML = new XML(xmlDoc), MYXML.hasComplexContent() PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_15/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_15/test.swf
new file mode 100644
index 000000000..85f62c071
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_15/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_15/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_15/test.toml
new file mode 100644
index 000000000..cf6123969
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_15/test.toml
@@ -0,0 +1 @@
+num_ticks = 1
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_16/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_16/Test.as
new file mode 100644
index 000000000..0357f4206
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_16/Test.as
@@ -0,0 +1,177 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.4.16 - XML hasSimpleContent()");
+
+//TEST(1, true, XML.prototype.hasOwnProperty("hasSimpleContent"));
+
+x1 =
+
+ one
+
+ two
+ three
+ four
+
+
+ five
+
+
+ six
+ seven
+
+
+;
+
+TEST(2, false, x1.hasSimpleContent());
+TEST(3, true, x1.bravo.hasSimpleContent());
+TEST(4, false, x1.charlie.hasSimpleContent());
+TEST(5, true, x1.delta.hasSimpleContent());
+TEST(6, true, x1.foxtrot.hasSimpleContent());
+TEST(7, true, x1.golf.hasSimpleContent());
+TEST(8, true, x1.hotel.hasSimpleContent());
+TEST(9, true, x1.@attr1.hasSimpleContent());
+TEST(10, true, x1.bravo.child(0).hasSimpleContent());
+TEST(11, false, x1.india.hasSimpleContent());
+
+var xmlDoc = "JohnWalton25"
+
+// propertyName as a string
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.hasSimpleContent()", false,
+ (MYXML = new XML(xmlDoc), MYXML.hasSimpleContent()));
+
+xmlDoc = "John"
+Assert.expectEq ("MYXML = new XML(xmlDoc), MYXML.children().length()", 1,
+ (MYXML = new XML(xmlDoc), MYXML.children().length()));
+Assert.expectEq ("MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind()", "text",
+ (MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind()));
+Assert.expectEq ("MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind()", "text",
+ (MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind()));
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent()", true,
+ (MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent()));
+
+XML.ignoreComments = false;
+xmlDoc = ""
+Assert.expectEq ("MYXML = new XML(xmlDoc), MYXML.children().length()", 1,
+ (MYXML = new XML(xmlDoc), MYXML.children().length()));
+Assert.expectEq ("MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind()", "comment",
+ (MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind()));
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent()", false,
+ (MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent()));
+
+XML.ignoreProcessingInstructions = false;
+xmlDoc = ""
+Assert.expectEq ("MYXML = new XML(xmlDoc), MYXML.children().length()", 1,
+ (MYXML = new XML(xmlDoc), MYXML.children().length()));
+Assert.expectEq ("MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind()", "processing-instruction",
+ (MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind()));
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent()", false,
+ (MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent()));
+
+xmlDoc = "foo"
+Assert.expectEq ("MYXML = new XML(xmlDoc), MYXML.children().length()", 1,
+ (MYXML = new XML(xmlDoc), MYXML.children().length()));
+Assert.expectEq ("MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind()", "text",
+ (MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind()));
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent()", true,
+ (MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent()));
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_16/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_16/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_16/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_16/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_16/output.txt
new file mode 100644
index 000000000..a1fe71db8
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_16/output.txt
@@ -0,0 +1,24 @@
+2 PASSED!
+3 PASSED!
+4 PASSED!
+5 PASSED!
+6 PASSED!
+7 PASSED!
+8 PASSED!
+9 PASSED!
+10 PASSED!
+11 PASSED!
+MYXML = new XML(xmlDoc), MYXML.hasSimpleContent() PASSED!
+MYXML = new XML(xmlDoc), MYXML.children().length() PASSED!
+MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind() PASSED!
+MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind() PASSED!
+MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent() PASSED!
+MYXML = new XML(xmlDoc), MYXML.children().length() PASSED!
+MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind() PASSED!
+MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent() PASSED!
+MYXML = new XML(xmlDoc), MYXML.children().length() PASSED!
+MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind() PASSED!
+MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent() PASSED!
+MYXML = new XML(xmlDoc), MYXML.children().length() PASSED!
+MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind() PASSED!
+MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent() PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_16/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_16/test.swf
new file mode 100644
index 000000000..23172eeb1
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_16/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_16/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_16/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_16/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_17/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_17/Test.as
new file mode 100644
index 000000000..53fab8a66
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_17/Test.as
@@ -0,0 +1,178 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.4.17 - XML inScopeNamespaces()");
+
+//TEST(1, true, XML.prototype.hasOwnProperty("inScopeNamespaces"));
+
+x1 =
+
+ one
+;
+
+namespaces = x1.bravo.inScopeNamespaces();
+
+
+TEST(2, "foo", namespaces[0].prefix);
+TEST(3, "http://foo/", namespaces[0].uri);
+TEST(4, "bar", namespaces[1].prefix);
+TEST(5, "http://bar/", namespaces[1].uri);
+//TEST(6, "", namespaces[2].prefix);
+//TEST(7, "", namespaces[2].uri);
+TEST(8, 2, namespaces.length);
+
+var n1 = new Namespace('pfx', 'http://w3.org');
+var n2 = new Namespace('http://us.gov');
+var n3 = new Namespace('boo', 'http://us.gov');
+var n4 = new Namespace('boo', 'http://hk.com');
+var xml = "55bird5dinosaur";
+
+
+Assert.expectEq( "Two namespaces in toplevel scope:", ('http://hk.com'),
+ ( x1 = new XML(xml), x1.addNamespace(n1), x1.addNamespace(n4), x1.inScopeNamespaces()[1].toString()));
+
+Assert.expectEq( "Two namespaces in toplevel scope:", ('http://w3.org'),
+ ( x1 = new XML(xml), x1.addNamespace(n1), x1.addNamespace(n4), x1.inScopeNamespaces()[0].toString()));
+
+Assert.expectEq( "No namespace:", (''),
+ ( x1 = new XML(xml), x1.inScopeNamespaces().toString()));
+
+try {
+ x1 = new XML(xml);
+ x1.addNamespace();
+ result = "no exception";
+} catch (e1) {
+ result = "exception";
+}
+
+Assert.expectEq( "Undefined namespace:", "exception", result);
+
+Assert.expectEq( "Undefined namespace, length:", 1,
+ ( x1 = new XML(xml), x1.addNamespace(null), x1.inScopeNamespaces().length));
+
+Assert.expectEq( "One namespace w/o prefix, length:", 1,
+ ( x1 = new XML(xml), x1.addNamespace(n2), x1.inScopeNamespaces().length));
+
+Assert.expectEq( "One namespace w/ prefix, length:", 1,
+ ( x1 = new XML(xml), x1.addNamespace(n1), x1.inScopeNamespaces().length));
+
+Assert.expectEq( "One namespace at toplevel, one at child, length at toplevel:", 1,
+ ( x1 = new XML(xml), x1.addNamespace(n3), x1.b[0].c.addNamespace(n4), x1.inScopeNamespaces().length));
+
+Assert.expectEq( "One namespace at toplevel, two at child, length at child:", 2,
+ ( x1 = new XML(xml), x1.addNamespace(n3), x1.b[1].c.addNamespace(n4), x1.b[1].c.addNamespace(n1), x1.b[1].c.inScopeNamespaces().length));
+
+Assert.expectEq( "inScopeNamespaces[0].typeof:", "object",
+ ( x1 = new XML(xml), x1.addNamespace(n1), x1.addNamespace(n4), typeof x1.inScopeNamespaces()[0]));
+
+Assert.expectEq( "inScopeNamespaces[1].prefix:", "boo",
+ ( x1 = new XML(xml), x1.addNamespace(n1), x1.addNamespace(n4), x1.inScopeNamespaces()[1].prefix));
+
+
+var xmlDoc = "hi";
+
+Assert.expectEq( "Reading one toplevel namespace:", (["http://www.w3.org/TR/xsl"]).toString(),
+ ( x1 = new XML(xmlDoc), x1.inScopeNamespaces().toString()));
+
+Assert.expectEq( "Reading two namespaces up parent chain:", (["http://www.foo.org/","http://www.w3.org/TR/xsl"]).toString(),
+ ( x1 = new XML(xmlDoc), x1.b.c.inScopeNamespaces().toString()));
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_17/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_17/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_17/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_17/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_17/output.txt
new file mode 100644
index 000000000..9b2c7488d
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_17/output.txt
@@ -0,0 +1,18 @@
+2 PASSED!
+3 PASSED!
+4 PASSED!
+5 PASSED!
+8 PASSED!
+Two namespaces in toplevel scope: PASSED!
+Two namespaces in toplevel scope: PASSED!
+No namespace: PASSED!
+Undefined namespace: PASSED!
+Undefined namespace, length: PASSED!
+One namespace w/o prefix, length: PASSED!
+One namespace w/ prefix, length: PASSED!
+One namespace at toplevel, one at child, length at toplevel: PASSED!
+One namespace at toplevel, two at child, length at child: PASSED!
+inScopeNamespaces[0].typeof: PASSED!
+inScopeNamespaces[1].prefix: PASSED!
+Reading one toplevel namespace: PASSED!
+Reading two namespaces up parent chain: PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_17/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_17/test.swf
new file mode 100644
index 000000000..4bf02b0f6
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_17/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_17/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_17/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_17/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_18/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_18/Test.as
new file mode 100644
index 000000000..631a5ab70
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_18/Test.as
@@ -0,0 +1,242 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+import com.adobe.test.Utils;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+
+START("13.4.4.18 - XML insertChildAfter()");
+
+//TEST(1, true, XML.prototype.hasOwnProperty("insertChildAfter"));
+
+x1 =
+
+ one
+ two
+;
+
+correct =
+
+ one
+ three
+ two
+;
+
+x1.insertChildAfter(x1.bravo[0], three);
+
+TEST(2, correct, x1);
+
+x1 =
+
+ one
+ two
+;
+
+correct =
+
+ three
+ one
+ two
+;
+
+x2 = new XML();
+
+x2 = x1.insertChildAfter(null, three);
+
+TEST(3, correct, x1);
+
+TEST(4, correct, x2);
+
+// to simplify string matching
+XML.prettyPrinting = false;
+
+var xmlDoc = "";
+var child1 = new XML("John");
+var child2 = new XML("Sue");
+var child3 = new XML("Bob");
+
+var allChildren = new XMLList("JohnSueBob");
+var twoChildren = new XMLList("SueBob");
+
+var wholeString = "JohnSueBob";
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.insertChildAfter(null, child1), MYXML.toString()",
+ "John",
+ (MYXML = new XML(xmlDoc), MYXML.insertChildAfter(null, child1), MYXML.toString()));
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.insertChildAfter(null, child1), MYXML.children()[0].parent() == MYXML",
+ true,
+ (MYXML = new XML(xmlDoc), MYXML.insertChildAfter(null, child1), MYXML.children()[0].parent() == MYXML));
+
+// The child is equal to child1 (but not the same object)
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.insertChildAfter(null, child1), MYXML.children()[0] == child1",
+ true,
+ (MYXML = new XML(xmlDoc), MYXML.insertChildAfter(null, child1), MYXML.children()[0] == child1));
+
+// The child is a duplicate of child1
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.insertChildAfter(null, child1), MYXML.children()[0] === child1",
+ true,
+ (MYXML = new XML(xmlDoc), MYXML.insertChildAfter(null, child1), MYXML.children()[0] === child1));
+
+var MYXML = new XML(xmlDoc);
+MYXML.insertChildAfter(null, child1);
+
+// !!@ this crashes Rhino's implementation
+Assert.expectEq( "MYXML.insertChildAfter(child1, child2), MYXML.toString()",
+ "JohnSue",
+ (MYXML.insertChildAfter(child1, child2), MYXML.toString()));
+
+MYXML = new XML(xmlDoc);
+MYXML.insertChildAfter(null, child1);
+
+Assert.expectEq( "MYXML.insertChildAfter(MYXML.children()[0], child2), MYXML.toString()",
+ "JohnSue",
+ (MYXML.insertChildAfter(MYXML.children()[0], child2), MYXML.toString()));
+
+MYXML = new XML(xmlDoc);
+MYXML.insertChildAfter(null, child1);
+MYXML.insertChildAfter(MYXML.children()[0], child2);
+
+// !!@ this crashes Rhino's implementation
+Assert.expectEq( "MYXML.insertChildAfter(child2, child3), MYXML.toString()",
+ "JohnSueBob",
+ (MYXML.insertChildAfter(child2, child3), MYXML.toString()));
+
+MYXML = new XML(xmlDoc);
+MYXML.insertChildAfter(null, child1);
+MYXML.insertChildAfter(MYXML.children()[0], child2);
+
+Assert.expectEq( "MYXML.insertChildAfter(MYXML.children()[1], child3), MYXML.toString()",
+ "JohnSueBob",
+ (MYXML.insertChildAfter(MYXML.children()[1], child3), MYXML.toString()));
+
+
+MYXML = new XML(xmlDoc);
+
+Assert.expectEq("MYXML.insertChildAfter(null, XMLList), MYXML.toString()",
+ new XML(wholeString).toString(),
+ (MYXML.insertChildAfter(null, allChildren), MYXML.toString()));
+
+MYXML = new XML(xmlDoc);
+MYXML.insertChildAfter(null, child1);
+
+Assert.expectEq("MYXML.insertChildAfter(child1, XMLList), MYXML.toString()",
+ new XML(wholeString).toString(),
+ (MYXML.insertChildAfter(MYXML.children()[0], twoChildren), MYXML.toString()));
+
+MYXML = new XML(xmlDoc);
+MYXML.insertChildAfter(null, child1);
+
+Assert.expectEq("MYXML.insertChildAfter(child1, \"string\"), MYXML.toString()",
+ new XML("Johnstring").toString(),
+ (MYXML.insertChildAfter(MYXML.children()[0], "string"), MYXML.toString()));
+
+
+var a = ;
+
+try {
+ a.b.c.insertChildAfter (null, a);
+ result = a;
+} catch (e1) {
+ result = Utils.typeError(e1.toString());
+}
+Assert.expectEq("a = , a.b.c.insertChildAfter(null, a)", "TypeError: Error #1118", result);
+
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_18/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_18/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_18/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_18/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_18/output.txt
new file mode 100644
index 000000000..6aa7e77ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_18/output.txt
@@ -0,0 +1,15 @@
+2 PASSED!
+3 PASSED!
+4 PASSED!
+MYXML = new XML(xmlDoc), MYXML.insertChildAfter(null, child1), MYXML.toString() PASSED!
+MYXML = new XML(xmlDoc), MYXML.insertChildAfter(null, child1), MYXML.children()[0].parent() == MYXML PASSED!
+MYXML = new XML(xmlDoc), MYXML.insertChildAfter(null, child1), MYXML.children()[0] == child1 PASSED!
+MYXML = new XML(xmlDoc), MYXML.insertChildAfter(null, child1), MYXML.children()[0] === child1 PASSED!
+MYXML.insertChildAfter(child1, child2), MYXML.toString() PASSED!
+MYXML.insertChildAfter(MYXML.children()[0], child2), MYXML.toString() PASSED!
+MYXML.insertChildAfter(child2, child3), MYXML.toString() PASSED!
+MYXML.insertChildAfter(MYXML.children()[1], child3), MYXML.toString() PASSED!
+MYXML.insertChildAfter(null, XMLList), MYXML.toString() PASSED!
+MYXML.insertChildAfter(child1, XMLList), MYXML.toString() PASSED!
+MYXML.insertChildAfter(child1, "string"), MYXML.toString() PASSED!
+a = , a.b.c.insertChildAfter(null, a) PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_18/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_18/test.swf
new file mode 100644
index 000000000..f39d2ca51
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_18/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_18/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_18/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_18/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_19/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_19/Test.as
new file mode 100644
index 000000000..6ba72ab73
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_19/Test.as
@@ -0,0 +1,242 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+import com.adobe.test.Utils;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+
+START("13.4.4.19 - insertChildBefore()");
+
+//TEST(1, true, XML.prototype.hasOwnProperty("insertChildBefore"));
+
+x1 =
+
+ one
+ two
+;
+
+correct =
+
+ three
+ one
+ two
+;
+
+x1.insertChildBefore(x1.bravo[0], three);
+
+TEST(2, correct, x1);
+
+x1 =
+
+ one
+ two
+;
+
+correct =
+
+ one
+ two
+ three
+;
+x2 = new XML();
+
+x2 = x1.insertChildBefore(null, three);
+
+TEST(3, correct, x1);
+
+TEST(4, correct, x2);
+
+// to simplify string matching
+XML.prettyPrinting = false;
+
+var xmlDoc = "";
+var child1 = new XML("John");
+var child2 = new XML("Sue");
+var child3 = new XML("Bob");
+
+var allChildren = new XMLList("JohnSueBob");
+var twoChildren = new XMLList("JohnSue");
+
+var wholeString = "JohnSueBob";
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.insertChildBefore(null, child1), MYXML.toString()",
+ "John",
+ (MYXML = new XML(xmlDoc), MYXML.insertChildBefore(null, child1), MYXML.toString()));
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.insertChildBefore(null, child1), MYXML.children()[0].parent() == MYXML",
+ true,
+ (MYXML = new XML(xmlDoc), MYXML.insertChildBefore(null, child1), MYXML.children()[0].parent() == MYXML));
+
+// The child is equal to child1 (but not the same object)
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.insertChildBefore(null, child1), MYXML.children()[0] == child1",
+ true,
+ (MYXML = new XML(xmlDoc), MYXML.insertChildBefore(null, child1), MYXML.children()[0] == child1));
+
+// The child is a duplicate of child1
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.insertChildBefore(null, child1), MYXML.children()[0] === child1",
+ true,
+ (MYXML = new XML(xmlDoc), MYXML.insertChildBefore(null, child1), MYXML.children()[0] === child1));
+
+var MYXML = new XML(xmlDoc);
+MYXML.insertChildBefore(null, child1);
+
+// !!@ this crashes Rhino's implementation
+Assert.expectEq( "MYXML.insertChildBefore(child1, child2), MYXML.toString()",
+ "SueJohn",
+ (MYXML.insertChildBefore(child1, child2), MYXML.toString()));
+
+
+var MYXML = new XML(xmlDoc);
+MYXML.insertChildBefore(null, child1);
+
+Assert.expectEq( "MYXML.insertChildBefore(MYXML.children()[0], child2), MYXML.toString()",
+ "SueJohn",
+ (MYXML.insertChildBefore(MYXML.children()[0], child2), MYXML.toString()));
+
+MYXML = new XML(xmlDoc);
+MYXML.insertChildBefore(null, child2);
+MYXML.insertChildBefore(MYXML.children()[0], child1);
+
+// !!@ this crashes Rhino's implementation
+Assert.expectEq( "MYXML.insertChildBefore(child2, child3), MYXML.toString()",
+ "JohnBobSue",
+ (MYXML.insertChildBefore(child2, child3), MYXML.toString()));
+
+MYXML = new XML(xmlDoc);
+MYXML.insertChildBefore(null, child2);
+MYXML.insertChildBefore(MYXML.children()[0], child1);
+
+Assert.expectEq( "MYXML.insertChildBefore(MYXML.children()[1], child3), MYXML.toString()",
+ "JohnBobSue",
+ (MYXML.insertChildBefore(MYXML.children()[1], child3), MYXML.toString()));
+
+MYXML = new XML(xmlDoc);
+
+Assert.expectEq("MYXML.insertChildBefore(null, XMLList), MYXML.toString()",
+ new XML(wholeString).toString(),
+ (MYXML.insertChildBefore(null, allChildren), MYXML.toString()));
+
+MYXML = new XML(xmlDoc);
+MYXML.insertChildBefore(null, child3);
+
+Assert.expectEq("MYXML.insertChildBefore(child3, XMLList), MYXML.toString()",
+ new XML(wholeString).toString(),
+ (MYXML.insertChildBefore(MYXML.children()[0], twoChildren), MYXML.toString()));
+
+MYXML = new XML(xmlDoc);
+MYXML.insertChildBefore(null, child1);
+
+Assert.expectEq("MYXML.insertChildBefore(child1, \"string\"), MYXML.toString()",
+ new XML("stringJohn").toString(),
+ (MYXML.insertChildBefore(MYXML.children()[0], "string"), MYXML.toString()));
+
+var a = ;
+
+try {
+ a.b.c.insertChildBefore (null, a);
+ result = a;
+} catch (e1) {
+ result = Utils.typeError(e1.toString());
+}
+Assert.expectEq("a = , a.b.c.insertChildBefore(null,a)", "TypeError: Error #1118", result);
+
+
+
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_19/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_19/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_19/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_19/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_19/output.txt
new file mode 100644
index 000000000..0893bb9ee
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_19/output.txt
@@ -0,0 +1,15 @@
+2 PASSED!
+3 PASSED!
+4 PASSED!
+MYXML = new XML(xmlDoc), MYXML.insertChildBefore(null, child1), MYXML.toString() PASSED!
+MYXML = new XML(xmlDoc), MYXML.insertChildBefore(null, child1), MYXML.children()[0].parent() == MYXML PASSED!
+MYXML = new XML(xmlDoc), MYXML.insertChildBefore(null, child1), MYXML.children()[0] == child1 PASSED!
+MYXML = new XML(xmlDoc), MYXML.insertChildBefore(null, child1), MYXML.children()[0] === child1 PASSED!
+MYXML.insertChildBefore(child1, child2), MYXML.toString() PASSED!
+MYXML.insertChildBefore(MYXML.children()[0], child2), MYXML.toString() PASSED!
+MYXML.insertChildBefore(child2, child3), MYXML.toString() PASSED!
+MYXML.insertChildBefore(MYXML.children()[1], child3), MYXML.toString() PASSED!
+MYXML.insertChildBefore(null, XMLList), MYXML.toString() PASSED!
+MYXML.insertChildBefore(child3, XMLList), MYXML.toString() PASSED!
+MYXML.insertChildBefore(child1, "string"), MYXML.toString() PASSED!
+a = , a.b.c.insertChildBefore(null,a) PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_19/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_19/test.swf
new file mode 100644
index 000000000..a2328ef13
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_19/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_19/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_19/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_19/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_2/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_2/Test.as
new file mode 100644
index 000000000..2bcc17b92
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_2/Test.as
@@ -0,0 +1,198 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+import com.adobe.test.Utils;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+
+START("13.4.4.2 - XML addNamespace()");
+
+//TEST(1, true, XML.prototype.hasOwnProperty("addNamespace"));
+//TEST(2, true, XML.prototype.hasOwnProperty("children"));
+
+e =
+
+ Jim25
+ Joe20
+;
+
+n = "http://foobar/";
+e.addNamespace(n);
+
+n = new Namespace();
+e.addNamespace(n);
+
+n = new Namespace("http://foobar/");
+e.addNamespace(n);
+
+x1 = ;
+n = new Namespace("ns", "uri");
+x1.addNamespace(n);
+TEST(2, "", x1.toXMLString());
+
+var n1 = new Namespace('pfx', 'http://w3.org');
+var n2 = new Namespace('http://us.gov');
+var n3 = new Namespace('boo', 'http://us.gov');
+var n4 = new Namespace('boo', 'http://hk.com');
+var xml = "55bird5dinosaur";
+var xmlwithns = "55bird5dinosaur";
+
+Assert.expectEq( "addNamespace with prefix:", "http://w3.org",
+ ( x1 = new XML(xml), x1.addNamespace(n1), myGetNamespace(x1,'pfx').toString()));
+
+Assert.expectEq( "addNamespace without prefix:", undefined,
+ ( x1 = new XML(xml), x1.addNamespace(n2), myGetNamespace(x1, 'blah')));
+
+expectedStr = "ArgumentError: Error #1063: Argument count mismatch on XML/addNamespace(). Expected 1, got 0";
+expected = "Error #1063";
+actual = "No error";
+
+try {
+ x1.addNamespace();
+} catch(e1) {
+ actual = Utils.grabError(e1, e1.toString());
+}
+
+Assert.expectEq( "addNamespace(): Error. Needs 1 argument", expected, actual);
+
+Assert.expectEq( "Does namespace w/o prefix change XML object:", true,
+ ( x1 = new XML(xml), y1 = new XML(xml), x1.addNamespace(n1), (x1 == y1)));
+
+Assert.expectEq( "Does namespace w/ prefix change XML object:", true,
+ ( x1 = new XML(xml), y1 = new XML(xml), x1.addNamespace(n2), (x1 == y1)));
+
+Assert.expectEq( "Adding two different namespaces:", 'http://w3.org',
+ ( x1 = new XML(xml), x1.addNamespace(n1), x1.addNamespace(n3), myGetNamespace(x1, 'pfx').toString()));
+
+Assert.expectEq( "Adding two different namespaces:", 'http://us.gov',
+ ( x1 = new XML(xml), x1.addNamespace(n1), x1.addNamespace(n3), myGetNamespace(x1, 'boo').toString()));
+
+Assert.expectEq( "Adding namespace with pre-existing prefix:", 'http://hk.com',
+ ( x1 = new XML(xml), x1.addNamespace(n3), x1.addNamespace(n4), myGetNamespace(x1, 'boo').toString()));
+
+
+Assert.expectEq( "Adding namespace to something other than top node:", 'http://hk.com',
+ ( x1 = new XML(xml), x1.b[0].d.addNamespace(n4), myGetNamespace(x1.b[0].d, 'boo').toString()));
+
+
+Assert.expectEq( "Adding namespace to XMLList element:", 'http://hk.com',
+ ( x1 = new XMLList(xml), x1.b[1].addNamespace(n4), myGetNamespace(x1.b[1], 'boo').toString()));
+
+
+
+// namespaces with prefixes are preserved
+
+x2 = text;
+x2s = x2.toString();
+correct = '\n text\n';
+Assert.expectEq("Original XML", x2s, correct);
+
+// Adding a namespace to a node will clear a conflicting prefix
+var ns = new Namespace ("ns2", "newuri");
+x2.addNamespace (ns);
+x2s = x2.toString();
+
+correct = '\n text\n';
+
+Assert.expectEq("Adding namespace that previously existed with a different prefix", correct,
+ x2s);
+
+
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_2/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_2/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_2/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_2/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_2/output.txt
new file mode 100644
index 000000000..8ab1106f6
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_2/output.txt
@@ -0,0 +1,14 @@
+2 PASSED!
+addNamespace with prefix: PASSED!
+addNamespace without prefix: PASSED!
+Asserting for ArgumentError PASSED!
+addNamespace(): Error. Needs 1 argument PASSED!
+Does namespace w/o prefix change XML object: PASSED!
+Does namespace w/ prefix change XML object: PASSED!
+Adding two different namespaces: PASSED!
+Adding two different namespaces: PASSED!
+Adding namespace with pre-existing prefix: PASSED!
+Adding namespace to something other than top node: PASSED!
+Adding namespace to XMLList element: PASSED!
+Original XML PASSED!
+Adding namespace that previously existed with a different prefix PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_2/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_2/test.swf
new file mode 100644
index 000000000..a78c84c4e
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_2/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_2/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_2/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_2/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_20/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_20/Test.as
new file mode 100644
index 000000000..c18040bf5
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_20/Test.as
@@ -0,0 +1,145 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.4.20 - XML length()");
+
+//TEST(1, true, XML.prototype.hasOwnProperty("length"));
+
+x1 =
+
+ one
+
+ two
+ three
+ four
+
+
+;
+
+TEST(2, 1, x1.length());
+TEST(3, 1, x1.bravo.length());
+TEST(4, 1, x1.charlie.length());
+TEST(5, 1, x1.delta.length());
+
+var xmlDoc = "JohnWalton25SueDay32"
+
+
+// propertyName as a string
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.length()", 1,
+ (MYXML = new XML(xmlDoc), MYXML.length()));
+
+Assert.expectEq( "MYXML = new XML(), MYXML.length()", 1,
+ (MYXML = new XML(), MYXML.length()));
+
+Assert.expectEq( "MYXML = new XML(null), MYXML.length()", 1,
+ (MYXML = new XML(null), MYXML.length()));
+
+Assert.expectEq( "MYXML = new XML(undefined), MYXML.length()", 1,
+ (MYXML = new XML(undefined), MYXML.length()));
+
+Assert.expectEq( "MYXML = new XML('foo'), MYXML.length()", 1,
+ (MYXML = new XML("foo"), MYXML.length()));
+
+XML.ignoreComments = false;
+Assert.expectEq( "MYXML = new XML(''), MYXML.length()", 1,
+ (MYXML = new XML(""), MYXML.length()));
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_20/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_20/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_20/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_20/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_20/output.txt
new file mode 100644
index 000000000..2580d1004
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_20/output.txt
@@ -0,0 +1,10 @@
+2 PASSED!
+3 PASSED!
+4 PASSED!
+5 PASSED!
+MYXML = new XML(xmlDoc), MYXML.length() PASSED!
+MYXML = new XML(), MYXML.length() PASSED!
+MYXML = new XML(null), MYXML.length() PASSED!
+MYXML = new XML(undefined), MYXML.length() PASSED!
+MYXML = new XML('foo'), MYXML.length() PASSED!
+MYXML = new XML(''), MYXML.length() PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_20/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_20/test.swf
new file mode 100644
index 000000000..d6bcae4d7
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_20/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_20/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_20/test.toml
new file mode 100644
index 000000000..cf6123969
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_20/test.toml
@@ -0,0 +1 @@
+num_ticks = 1
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_21/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_21/Test.as
new file mode 100644
index 000000000..e010ba69b
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_21/Test.as
@@ -0,0 +1,168 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.4.21 - XML localName()");
+
+//TEST(1, true, XML.prototype.hasOwnProperty("localName"));
+
+x1 = new XML("onetwo");
+var y1;
+y1 = x1.localName();
+TEST(2, "string", typeof(y1));
+TEST(3, "alpha", y1);
+
+y1 = x1.bravo.localName();
+x1.bravo.setNamespace("http://someuri");
+TEST(4, "bravo", y1);
+
+x1 =
+
+ one
+;
+
+ns = new Namespace("http://foo/");
+y1 = x1.ns::bravo.localName();
+TEST(5, "string", typeof(y1));
+TEST(6, "bravo", y1);
+
+y1 = x1.ns::bravo.@name.localName();
+TEST(7, "name", y1);
+
+y1 = x1.ns::bravo.@ns::value.localName();
+TEST(8, "value", y1);
+
+var xmlDoc = "John California ";
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.localName()",
+ "company",
+ (MYXML = new XML(xmlDoc), MYXML.localName()));
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.localName() instanceof QName",
+ false,
+ (MYXML = new XML(xmlDoc), MYXML.localName() instanceof QName));
+
+// !!@ fails in Rhino??
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.localName() instanceof String",
+ true,
+ (MYXML = new XML(xmlDoc), MYXML.localName() instanceof String));
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), typeof(MYXML.localName())",
+ "string",
+ (MYXML = new XML(xmlDoc), typeof(MYXML.localName())));
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.children()[0].localName()",
+ "employee",
+ (MYXML = new XML(xmlDoc), MYXML.children()[0].localName()));
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.children()[0].localName() instanceof QName",
+ false,
+ (MYXML = new XML(xmlDoc), MYXML.children()[0].localName() instanceof QName));
+
+// !!@ fails in Rhino??
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.children()[0].localName() instanceof String",
+ true,
+ (MYXML = new XML(xmlDoc), MYXML.children()[0].localName() instanceof String));
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), typeof(MYXML.children()[0].localName())",
+ "string",
+ (MYXML = new XML(xmlDoc), typeof(MYXML.children()[0].localName())));
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_21/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_21/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_21/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_21/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_21/output.txt
new file mode 100644
index 000000000..fd415992a
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_21/output.txt
@@ -0,0 +1,15 @@
+2 PASSED!
+3 PASSED!
+4 PASSED!
+5 PASSED!
+6 PASSED!
+7 PASSED!
+8 PASSED!
+MYXML = new XML(xmlDoc), MYXML.localName() PASSED!
+MYXML = new XML(xmlDoc), MYXML.localName() instanceof QName PASSED!
+MYXML = new XML(xmlDoc), MYXML.localName() instanceof String PASSED!
+MYXML = new XML(xmlDoc), typeof(MYXML.localName()) PASSED!
+MYXML = new XML(xmlDoc), MYXML.children()[0].localName() PASSED!
+MYXML = new XML(xmlDoc), MYXML.children()[0].localName() instanceof QName PASSED!
+MYXML = new XML(xmlDoc), MYXML.children()[0].localName() instanceof String PASSED!
+MYXML = new XML(xmlDoc), typeof(MYXML.children()[0].localName()) PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_21/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_21/test.swf
new file mode 100644
index 000000000..ecaa40741
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_21/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_21/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_21/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_21/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_22/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_22/Test.as
new file mode 100644
index 000000000..094cc0f3d
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_22/Test.as
@@ -0,0 +1,171 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.4.22 - XML name()");
+
+//TEST(1, true, XML.prototype.hasOwnProperty("name"));
+
+x1 =
+
+ one
+
+ two
+
+;
+
+y1 = x1.bravo.name();
+
+TEST(2, "object", typeof(y1));
+TEST(3, QName("bravo"), y1);
+
+x1 =
+
+ one
+;
+
+ns = new Namespace("http://foo/");
+y1 = x1.ns::bravo.name();
+
+TEST(4, "object", typeof(y1));
+TEST(5, QName("http://foo/", "bravo"), y1);
+
+y1 = x1.ns::bravo.@name.name();
+TEST(6, QName("name"), y1);
+
+y1 = x1.ns::bravo.@ns::value.name();
+TEST(7, "http://foo/", y1.uri);
+TEST(8, "value", y1.localName);
+TEST(9, QName("http://foo/", "value"), y1);
+
+function convertToString(o:Object){
+ return o.toString();
+}
+
+var xmlDoc = "John California ";
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.name()",
+ convertToString(new QName("company")),
+ (MYXML = new XML(xmlDoc), MYXML.name()).toString());
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.name() instanceof QName",
+ true,
+ (MYXML = new XML(xmlDoc), MYXML.name() instanceof QName));
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.name().toString()",
+ "company",
+ (MYXML = new XML(xmlDoc), MYXML.name().toString()));
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.children()[0].name()",
+
+ convertToString(new QName("http://colors.com/printer/", "employee")),
+
+ (MYXML = new XML(xmlDoc), MYXML.children()[0].name()).toString()
+ );
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.children()[0].name() instanceof QName",
+ true,
+ (MYXML = new XML(xmlDoc), MYXML.children()[0].name() instanceof QName));
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.children()[0].name().toString()",
+ "http://colors.com/printer/::employee",
+ (MYXML = new XML(xmlDoc), MYXML.children()[0].name().toString()));
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_22/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_22/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_22/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_22/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_22/output.txt
new file mode 100644
index 000000000..ec14c8827
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_22/output.txt
@@ -0,0 +1,14 @@
+2 PASSED!
+3 PASSED!
+4 PASSED!
+5 PASSED!
+6 PASSED!
+7 PASSED!
+8 PASSED!
+9 PASSED!
+MYXML = new XML(xmlDoc), MYXML.name() PASSED!
+MYXML = new XML(xmlDoc), MYXML.name() instanceof QName PASSED!
+MYXML = new XML(xmlDoc), MYXML.name().toString() PASSED!
+MYXML = new XML(xmlDoc), MYXML.children()[0].name() PASSED!
+MYXML = new XML(xmlDoc), MYXML.children()[0].name() instanceof QName PASSED!
+MYXML = new XML(xmlDoc), MYXML.children()[0].name().toString() PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_22/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_22/test.swf
new file mode 100644
index 000000000..09c6b802d
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_22/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_22/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_22/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_22/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_23/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_23/Test.as
new file mode 100644
index 000000000..6a15ac8f6
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_23/Test.as
@@ -0,0 +1,207 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+import com.adobe.test.Utils;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+
+START("13.4.4.23 - XML getNamespace()");
+
+//TEST(1, true, XML.prototype.hasOwnProperty("getNamespace"));
+
+// Prefix case
+x1 =
+
+ one
+;
+
+//y = x1.getNamespace();
+y1 = myGetNamespace(x1);
+TEST(2, "object", typeof(y1));
+TEST(3, Namespace("http://foo/"), y1);
+
+//y = x1.getNamespace("bar");
+y1 = myGetNamespace(x1, "bar");
+TEST(4, "object", typeof(y1));
+TEST(5, Namespace("http://bar/"), y1);
+
+// No Prefix Case
+x1 =
+
+ one
+;
+
+//y = x1.getNamespace();
+y1 = myGetNamespace(x1);
+TEST(6, "object", typeof(y1));
+TEST(7, Namespace("http://foobar/"), y1);
+
+// No Namespace case
+x1 =
+
+ one
+;
+//TEST(8, Namespace(""), x1.getNamespace());
+TEST(8, Namespace(""), myGetNamespace(x1));
+
+// Namespaces of attributes
+x1 =
+
+ one
+;
+
+var ns = new Namespace("http://bar");
+//y1 = x1.ns::bravo.@name.getNamespace();
+y1 = myGetNamespace(x1.ns::bravo.@name);
+TEST(9, Namespace(""), y1);
+
+//y1 = x1.ns::bravo.@ns::value.getNamespace();
+y1 = myGetNamespace(x1.ns::bravo.@ns::value);
+TEST(10, ns.toString(), y1.toString());
+
+var xmlDoc = "hi";
+var ns1 = Namespace ("xsl", "http://www.w3.org/TR/xsl");
+var ns2 = Namespace ("foo", "http://www.foo.org");
+
+
+function convertToString(o:Object){
+ return o.toString();
+}
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.getNamespace()",
+ "http://www.w3.org/TR/xsl",
+ (MYXML = new XML(xmlDoc), myGetNamespace(MYXML).toString()));
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.getNamespace()",
+ convertToString(new Namespace("http://www.w3.org/TR/xsl")),
+ (MYXML = new XML(xmlDoc), myGetNamespace(MYXML)).toString());
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.getNamespace('stylesheet')",
+ convertToString(new Namespace ("http://www.w3.org/TR/xsl")),
+ (MYXML = new XML(xmlDoc), myGetNamespace(MYXML, 'xsl')).toString());
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.getNamespace('xsl')",
+ "http://www.w3.org/TR/xsl", (MYXML = new XML(xmlDoc),
+ myGetNamespace(MYXML, 'xsl').toString()));
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.getNamespace('foo')",
+ undefined, (MYXML = new XML(xmlDoc),
+ myGetNamespace(MYXML, 'foo')));
+
+
+Assert.expectEq( "MYXML = new XML(xmlDoc), MYXML.b.c.getNamespace('foo')",
+ "http://www.foo.org/", (MYXML = new XML(xmlDoc),
+ myGetNamespace(MYXML.b.c, 'foo').toString()));
+
+
+x1 =
+<>
+one
+b>;
+
+try {
+ ns = x1.namespace();
+ result = ns;
+} catch (e1) {
+ result = Utils.typeError(e1.toString());
+}
+
+Assert.expectEq("Calling namespace on list with two items", "TypeError: Error #1086", result);
+
+END();
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_23/config.xml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_23/config.xml
new file mode 100644
index 000000000..18d27f9ba
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_23/config.xml
@@ -0,0 +1,13 @@
+
+
+
+ .
+ ../../../lib
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_23/output.txt b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_23/output.txt
new file mode 100644
index 000000000..b2a237b36
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_23/output.txt
@@ -0,0 +1,16 @@
+2 PASSED!
+3 PASSED!
+4 PASSED!
+5 PASSED!
+6 PASSED!
+7 PASSED!
+8 PASSED!
+9 PASSED!
+10 PASSED!
+MYXML = new XML(xmlDoc), MYXML.getNamespace() PASSED!
+MYXML = new XML(xmlDoc), MYXML.getNamespace() PASSED!
+MYXML = new XML(xmlDoc), MYXML.getNamespace('stylesheet') PASSED!
+MYXML = new XML(xmlDoc), MYXML.getNamespace('xsl') PASSED!
+MYXML = new XML(xmlDoc), MYXML.getNamespace('foo') PASSED!
+MYXML = new XML(xmlDoc), MYXML.b.c.getNamespace('foo') PASSED!
+Calling namespace on list with two items PASSED!
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_23/test.swf b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_23/test.swf
new file mode 100644
index 000000000..dbffd8c2c
Binary files /dev/null and b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_23/test.swf differ
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_23/test.toml b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_23/test.toml
new file mode 100644
index 000000000..29f3cef79
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_23/test.toml
@@ -0,0 +1,2 @@
+num_ticks = 1
+known_failure = true
diff --git a/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_24/Test.as b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_24/Test.as
new file mode 100644
index 000000000..879a84f29
--- /dev/null
+++ b/tests/tests/swfs/avm2/from_avmplus/e4x/XML/e13_4_4_24/Test.as
@@ -0,0 +1,181 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package {
+public class Test {}
+}
+
+import com.adobe.test.Assert;
+
+function START(summary)
+{
+ // print out bugnumber
+
+ /*if ( BUGNUMBER ) {
+ writeLineToLog ("BUGNUMBER: " + BUGNUMBER );
+ }*/
+ XML.setSettings (null);
+ testcases = new Array();
+
+ // text field for results
+ tc = 0;
+ /*this.addChild ( tf );
+ tf.x = 30;
+ tf.y = 50;
+ tf.width = 200;
+ tf.height = 400;*/
+
+ //_print(summary);
+ var summaryParts = summary.split(" ");
+ //_print("section: " + summaryParts[0] + "!");
+ //fileName = summaryParts[0];
+
+}
+
+function TEST(section, expected, actual)
+{
+ AddTestCase(section, expected, actual);
+}
+
+
+function TEST_XML(section, expected, actual)
+{
+ var actual_t = typeof actual;
+ var expected_t = typeof expected;
+
+ if (actual_t != "xml") {
+ // force error on type mismatch
+ TEST(section, new XML(), actual);
+ return;
+ }
+
+ if (expected_t == "string") {
+
+ TEST(section, expected, actual.toXMLString());
+ } else if (expected_t == "number") {
+
+ TEST(section, String(expected), actual.toXMLString());
+ } else {
+ reportFailure ("", 'Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string');
+ }
+}
+
+function reportFailure (section, msg)
+{
+ trace("~FAILURE: " + section + " | " + msg);
+}
+
+function AddTestCase( description, expect, actual ) {
+ testcases[tc++] = Assert.expectEq(description, "|"+expect+"|", "|"+actual+"|" );
+}
+
+function myGetNamespace (obj, ns) {
+ if (ns != undefined) {
+ return obj.namespace(ns);
+ } else {
+ return obj.namespace();
+ }
+}
+
+
+
+
+function NL()
+{
+ //return java.lang.System.getProperty("line.separator");
+ return "\n";
+}
+
+
+function BUG(arg){
+ // nothing here
+}
+
+function END()
+{
+ //test();
+}
+
+START("13.4.4.24 - XML namespaceDeclarations()");
+
+//TEST(1, true, XML.prototype.hasOwnProperty("namespaceDeclarations"));
+
+x1 =
+
+ one
+;
+
+y1 = x1.namespaceDeclarations();
+
+TEST(2, 2, y1.length);
+TEST(3, "object", typeof(y1[0]));
+TEST(4, "object", typeof(y1[1]));
+TEST(5, "foo", y1[0].prefix);
+TEST(6, Namespace("http://foo/"), y1[0]);
+TEST(7, "bar", y1[1].prefix);
+TEST(8, Namespace("http://bar/"), y1[1]);
+
+var n1 = new Namespace('pfx', 'http://w3.org');
+var n2 = new Namespace('http://us.gov');
+var n3 = new Namespace('boo', 'http://us.gov');
+var n4 = new Namespace('boo', 'http://hk.com');
+var xml1 = "55bird5dinosaur";
+
+//Assert.expectEq( "Undefined declaration:", (''),
+// ( x1 = new XML(xml1), x1.addNamespace(), x1.namespaceDeclarations().toString()));
+
+Assert.expectEq( "Undefined declaration, length:", 0,
+ ( x1 = new XML(xml1), x1.addNamespace(null), x1.namespaceDeclarations().length));
+
+Assert.expectEq( "Two declarations in toplevel scope:", ('http://hk.com'),
+ ( x1 = new XML(xml1), x1.addNamespace(n1), x1.addNamespace(n4), x1.namespaceDeclarations()[1].toString()));
+
+Assert.expectEq( "Two declarations in toplevel scope:", ('http://w3.org'),
+ ( x1 = new XML(xml1), x1.addNamespace(n1), x1.addNamespace(n4), x1.namespaceDeclarations()[0].toString()));
+
+Assert.expectEq( "No declaration:", (''),
+ ( x1 = new XML(xml1), x1.namespaceDeclarations().toString()));
+
+Assert.expectEq( "One declaration w/o prefix, length:", 0,
+ ( x1 = new XML(xml1), x1.addNamespace(n2), x1.namespaceDeclarations().length));
+
+Assert.expectEq( "One declaration w/ prefix, length:", 1,
+ ( x1 = new XML(xml1), x1.addNamespace(n1), x1.namespaceDeclarations().length));
+
+Assert.expectEq( "One declaration at toplevel, one at child, length at toplevel:", 1,
+ ( x1 = new XML(xml1), x1.addNamespace(n3), x1.b[0].c.addNamespace(n4), x1.namespaceDeclarations().length));
+
+Assert.expectEq( "One declaration at toplevel, two at child, length at child:", 2,
+ ( x1 = new XML(xml1), x1.addNamespace(n3), x1.b[1].c.addNamespace(n4), x1.b[1].c.addNamespace(n1), x1.b[1].c.namespaceDeclarations().length));
+
+Assert.expectEq( "namespaceDeclarations[1].typeof:", "object",
+ ( x1 = new XML(xml1), x1.addNamespace(n1), x1.addNamespace(n4), typeof x1.namespaceDeclarations()[1]));
+
+Assert.expectEq( "namespaceDeclarations[1].prefix:", "boo",
+ ( x1 = new XML(xml1), x1.addNamespace(n1), x1.addNamespace(n4), x1.namespaceDeclarations()[1].prefix));
+
+
+var xml1Doc = "hi";
+
+Assert.expectEq( "Reading one toplevel declaration:", "http://www.w3.org/TR/xsl",
+ ( x1 = new XML(xml1Doc), x1.namespaceDeclarations().toString()));
+
+Assert.expectEq( "Another declaration up parent chain:", "http://www.foo.org/",
+ ( x1 = new XML(xml1Doc), x1.b.c.namespaceDeclarations().toString()));
+
+// Adding because of Mozilla bug https://bugzilla.mozilla.org/show_bug.cgi?id=278112
+
+var xhtml1NS = new Namespace('http://www.w3.org/1999/xhtml');
+var xhtml =