Reviewed by Adam Roben.
authorap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Mar 2009 16:45:54 +0000 (16:45 +0000)
committerap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Mar 2009 16:45:54 +0000 (16:45 +0000)
        https://bugs.webkit.org/show_bug.cgi?id=4343
        XMLHttpRequest doesn't work in a JavaScript-created window

        The problem was fixed a while ago (r34506), just adding a test.

        * http/tests/xmlhttprequest/request-from-popup-expected.txt: Added.
        * http/tests/xmlhttprequest/request-from-popup.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/http/tests/xmlhttprequest/request-from-popup-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/request-from-popup.html [new file with mode: 0644]

index 14360d6386727f538a1edabc11eb6089980c5476..8c95983701e7db3cb1db27b33e91dd1e4e557534 100644 (file)
@@ -1,3 +1,15 @@
+2009-03-03  Alexey Proskuryakov  <ap@webkit.org>
+
+        Reviewed by Adam Roben.
+
+        https://bugs.webkit.org/show_bug.cgi?id=4343
+        XMLHttpRequest doesn't work in a JavaScript-created window
+
+        The problem was fixed a while ago (r34506), just adding a test.
+
+        * http/tests/xmlhttprequest/request-from-popup-expected.txt: Added.
+        * http/tests/xmlhttprequest/request-from-popup.html: Added.
+
 2009-03-02  Simon Fraser  <simon.fraser@apple.com>
 
         Reviewed by Adele Peterson
diff --git a/LayoutTests/http/tests/xmlhttprequest/request-from-popup-expected.txt b/LayoutTests/http/tests/xmlhttprequest/request-from-popup-expected.txt
new file mode 100644 (file)
index 0000000..e55f8fb
--- /dev/null
@@ -0,0 +1,3 @@
+Test for bug 4343: XMLHttpRequest doesn't work in a JavaScript-created window.
+
+SUCCESS
diff --git a/LayoutTests/http/tests/xmlhttprequest/request-from-popup.html b/LayoutTests/http/tests/xmlhttprequest/request-from-popup.html
new file mode 100644 (file)
index 0000000..83822ed
--- /dev/null
@@ -0,0 +1,24 @@
+<html><body>
+<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=4343">bug 4343</a>:
+XMLHttpRequest doesn't work in a JavaScript-created window.</p>
+<p id=result>FAIL</p>
+<script type="text/javascript">
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.setCanOpenWindows();
+    layoutTestController.waitUntilDone();
+}
+
+winRef=window.open();
+if (!winRef)
+    alert("Popup window could not be opened, please disable pop-up blocker");
+
+winRef.document.writeln("<html><body><script type='text/javascript'>");
+winRef.document.writeln("var req = new XMLHttpRequest();");
+winRef.document.writeln("req.onreadystatechange = result;");
+winRef.document.writeln("req.open('GET', 'request-from-popup.html', true);");
+winRef.document.writeln("req.send(null);");
+winRef.document.writeln("function result() { if (req.readyState == 4) { opener.document.getElementById('result').innerHTML='SUCCESS'; if (opener.layoutTestController) opener.layoutTestController.notifyDone(); window.close(); } }");
+winRef.document.writeln("<\/script><\/body><\/html>");
+winRef.document.close();
+</script></body></html>