Reviewed by Darin.
authorap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Jan 2008 21:40:40 +0000 (21:40 +0000)
committerap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Jan 2008 21:40:40 +0000 (21:40 +0000)
        http://bugs.webkit.org/show_bug.cgi?id=10909
        Hixie's XMLHttpRequest/018.html test fails

        This was fixed earlier, just adding a test case.

        * http/tests/xmlhttprequest/web-apps/018-expected.txt: Added.
        * http/tests/xmlhttprequest/web-apps/018.html: Added.
        * http/tests/xmlhttprequest/web-apps/resources: Added.
        * http/tests/xmlhttprequest/web-apps/resources/018-test.xml: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29133 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/http/tests/xmlhttprequest/web-apps/018-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/web-apps/018.html [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/web-apps/resources/018-test.xml [new file with mode: 0644]

index 2038b3e..fc79aec 100644 (file)
@@ -1,3 +1,17 @@
+2008-01-03  Alexey Proskuryakov  <ap@webkit.org>
+
+        Reviewed by Darin.
+
+        http://bugs.webkit.org/show_bug.cgi?id=10909
+        Hixie's XMLHttpRequest/018.html test fails
+
+        This was fixed earlier, just adding a test case.
+
+        * http/tests/xmlhttprequest/web-apps/018-expected.txt: Added.
+        * http/tests/xmlhttprequest/web-apps/018.html: Added.
+        * http/tests/xmlhttprequest/web-apps/resources: Added.
+        * http/tests/xmlhttprequest/web-apps/resources/018-test.xml: Added.
+
 2008-01-02  Darin Adler  <darin@apple.com>
 
         Reviewed by Geoff.
diff --git a/LayoutTests/http/tests/xmlhttprequest/web-apps/018-expected.txt b/LayoutTests/http/tests/xmlhttprequest/web-apps/018-expected.txt
new file mode 100644 (file)
index 0000000..1f87e0a
--- /dev/null
@@ -0,0 +1,3 @@
+The following line should say "PASS" twice, and you should not get any alerts or see the word "FAIL" anywhere on the next line.
+
+PASS PASS
diff --git a/LayoutTests/http/tests/xmlhttprequest/web-apps/018.html b/LayoutTests/http/tests/xmlhttprequest/web-apps/018.html
new file mode 100644 (file)
index 0000000..2026eb3
--- /dev/null
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html lang="en">
+ <head>
+  <title>XMLHttpRequest and responseXML -- script in the response</title>
+ </head>
+ <body>
+  <p>The following line should say "PASS" twice, and you should not
+  get any alerts or see the word "FAIL" anywhere on the next line.</p>
+  <p>FAIL: Script did not run.</p>
+  <script type="text/javascript">
+   if (window.layoutTestController)
+     layoutTestController.dumpAsText();
+
+   var p = document.getElementsByTagName('p')[1];
+   p.firstChild.data = 'FAIL: Test script did not finish.';
+   window.onerror = function (error, file, line) { p.firstChild.data += ' (ERROR: ' + error + ' (line ' + line + '))'; }
+   if (!window.XMLHttpRequest)
+     window.XMLHttpRequest = function () { return new ActiveXObject("Microsoft.XMLHTTP"); }
+   var r = new XMLHttpRequest();
+   r.open('GET', 'resources/018-test.xml', false);
+   r.send(null);
+   var form = r.responseXML.getElementsByTagNameNS('http://www.w3.org/1999/xhtml', 'form')[0];
+   form.submit();
+   p.firstChild.data = form.firstChild.data + " " + r.responseXML.title;
+  </script>
+ </body>
+</html>
diff --git a/LayoutTests/http/tests/xmlhttprequest/web-apps/resources/018-test.xml b/LayoutTests/http/tests/xmlhttprequest/web-apps/resources/018-test.xml
new file mode 100644 (file)
index 0000000..a866eaa
--- /dev/null
@@ -0,0 +1,9 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>PASS</title>
+ </head>
+ <body onload="this.ownerDocument.title='FAIL'">
+  <form action="javascript:alert('FAIL')" onsubmit="this.firstChild.data = 'FAIL'; return false;">PASS</form>
+  <script>alert('FAIL')</script>
+ </body>
+</html>
\ No newline at end of file