Tests that dump delegate calls are flaky because of cached redirects
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 Aug 2013 00:01:53 +0000 (00:01 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 Aug 2013 00:01:53 +0000 (00:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=119641

Reviewed by Brady Eidson.

Made redirect.php emit Cache-Control: no store as a workaround for bug 77538.
Removed several reimplementations of it, and changed the test to use the
central copy.

* http/tests/permissionclient/resources/redir.php: Removed.
* http/tests/resources/redirect.php:
* http/tests/security/beforeload-iframe-server-redirect-expected.txt:
* http/tests/security/beforeload-iframe-server-redirect.html:
* http/tests/security/cannot-read-cssrules-redirect.html:
* http/tests/security/canvas-remote-read-redirect-to-remote-image.html:
* http/tests/security/canvas-remote-read-remote-image-redirect.html:
* http/tests/security/contentSecurityPolicy/frame-src-redirect-blocked.html:
* http/tests/security/contentSecurityPolicy/resources/multiple-iframe-test.js:
* http/tests/security/contentSecurityPolicy/resources/redir.php: Removed.
* http/tests/security/contentSecurityPolicy/script-src-redirect-expected.txt:
* http/tests/security/contentSecurityPolicy/script-src-redirect.html:
* http/tests/security/cross-origin-css.html:
* http/tests/security/cross-origin-script-window-onerror-redirected.html:
* http/tests/security/mixedContent/redirect-http-to-https-iframe-in-main-frame-expected.txt:
* http/tests/security/mixedContent/redirect-http-to-https-script-in-iframe-expected.txt:
* http/tests/security/mixedContent/redirect-https-to-http-iframe-in-main-frame-expected.txt:
* http/tests/security/mixedContent/resources/frame-with-redirect-http-to-https-frame.html:
* http/tests/security/mixedContent/resources/frame-with-redirect-http-to-https-script.html:
* http/tests/security/mixedContent/resources/frame-with-redirect-https-to-http-frame.html:
* http/tests/security/mixedContent/resources/frame-with-redirect-https-to-http-script.html:
* http/tests/security/redirect-BLOCKED-to-localURL.html:
* http/tests/security/resources/cross-origin-xsl-redirect.xml:
* http/tests/security/resources/redir.php: Removed.
* http/tests/security/resources/xsl-using-document-redirect.xsl:
* http/tests/security/resources/xsl-using-external-entity-redirect.xsl:
* http/tests/security/stylesheet-href-redirect-expected.txt:
* http/tests/security/stylesheet-href-redirect.html:
* http/tests/security/xssAuditor/block-does-not-leak-referrer.html:
* http/tests/security/xssAuditor/resources/redir.php: Removed.
* http/tests/security/xssAuditor/script-tag-open-redirect.html:
* http/tests/security/xssAuditor/script-tag-redirect.html:
* http/tests/xmlhttprequest/redirect-cross-origin-2.html:
* http/tests/xmlhttprequest/redirect-cross-origin-post-sync.html:
* http/tests/xmlhttprequest/redirect-cross-origin-post.html:
* http/tests/xmlhttprequest/redirect-cross-origin-sync-double.html:
* http/tests/xmlhttprequest/redirect-cross-origin-sync.html:
* http/tests/xmlhttprequest/redirect-cross-origin.html:
* http/tests/xmlhttprequest/resources/redirect.php: Removed.
* http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect.html:

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

41 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/permissionclient/resources/redir.php [deleted file]
LayoutTests/http/tests/resources/redirect.php
LayoutTests/http/tests/security/beforeload-iframe-server-redirect-expected.txt
LayoutTests/http/tests/security/beforeload-iframe-server-redirect.html
LayoutTests/http/tests/security/cannot-read-cssrules-redirect.html
LayoutTests/http/tests/security/canvas-remote-read-redirect-to-remote-image.html
LayoutTests/http/tests/security/canvas-remote-read-remote-image-redirect.html
LayoutTests/http/tests/security/contentSecurityPolicy/frame-src-redirect-blocked.html
LayoutTests/http/tests/security/contentSecurityPolicy/resources/multiple-iframe-test.js
LayoutTests/http/tests/security/contentSecurityPolicy/resources/redir.php [deleted file]
LayoutTests/http/tests/security/contentSecurityPolicy/script-src-redirect-expected.txt
LayoutTests/http/tests/security/contentSecurityPolicy/script-src-redirect.html
LayoutTests/http/tests/security/cross-origin-css.html
LayoutTests/http/tests/security/cross-origin-script-window-onerror-redirected.html
LayoutTests/http/tests/security/mixedContent/redirect-http-to-https-iframe-in-main-frame-expected.txt
LayoutTests/http/tests/security/mixedContent/redirect-http-to-https-script-in-iframe-expected.txt
LayoutTests/http/tests/security/mixedContent/redirect-https-to-http-iframe-in-main-frame-expected.txt
LayoutTests/http/tests/security/mixedContent/resources/frame-with-redirect-http-to-https-frame.html
LayoutTests/http/tests/security/mixedContent/resources/frame-with-redirect-http-to-https-script.html
LayoutTests/http/tests/security/mixedContent/resources/frame-with-redirect-https-to-http-frame.html
LayoutTests/http/tests/security/mixedContent/resources/frame-with-redirect-https-to-http-script.html
LayoutTests/http/tests/security/redirect-BLOCKED-to-localURL.html
LayoutTests/http/tests/security/resources/cross-origin-xsl-redirect.xml
LayoutTests/http/tests/security/resources/redir.php [deleted file]
LayoutTests/http/tests/security/resources/xsl-using-document-redirect.xsl
LayoutTests/http/tests/security/resources/xsl-using-external-entity-redirect.xsl
LayoutTests/http/tests/security/stylesheet-href-redirect-expected.txt
LayoutTests/http/tests/security/stylesheet-href-redirect.html
LayoutTests/http/tests/security/xssAuditor/block-does-not-leak-referrer.html
LayoutTests/http/tests/security/xssAuditor/resources/redir.php [deleted file]
LayoutTests/http/tests/security/xssAuditor/script-tag-open-redirect.html
LayoutTests/http/tests/security/xssAuditor/script-tag-redirect.html
LayoutTests/http/tests/xmlhttprequest/redirect-cross-origin-2.html
LayoutTests/http/tests/xmlhttprequest/redirect-cross-origin-post-sync.html
LayoutTests/http/tests/xmlhttprequest/redirect-cross-origin-post.html
LayoutTests/http/tests/xmlhttprequest/redirect-cross-origin-sync-double.html
LayoutTests/http/tests/xmlhttprequest/redirect-cross-origin-sync.html
LayoutTests/http/tests/xmlhttprequest/redirect-cross-origin.html
LayoutTests/http/tests/xmlhttprequest/resources/redirect.php [deleted file]
LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect.html

index 8c00cf7..3a84951 100644 (file)
@@ -1,3 +1,55 @@
+2013-08-09  Alexey Proskuryakov  <ap@apple.com>
+
+        Tests that dump delegate calls are flaky because of cached redirects
+        https://bugs.webkit.org/show_bug.cgi?id=119641
+
+        Reviewed by Brady Eidson.
+
+        Made redirect.php emit Cache-Control: no store as a workaround for bug 77538.
+        Removed several reimplementations of it, and changed the test to use the
+        central copy.
+
+        * http/tests/permissionclient/resources/redir.php: Removed.
+        * http/tests/resources/redirect.php:
+        * http/tests/security/beforeload-iframe-server-redirect-expected.txt:
+        * http/tests/security/beforeload-iframe-server-redirect.html:
+        * http/tests/security/cannot-read-cssrules-redirect.html:
+        * http/tests/security/canvas-remote-read-redirect-to-remote-image.html:
+        * http/tests/security/canvas-remote-read-remote-image-redirect.html:
+        * http/tests/security/contentSecurityPolicy/frame-src-redirect-blocked.html:
+        * http/tests/security/contentSecurityPolicy/resources/multiple-iframe-test.js:
+        * http/tests/security/contentSecurityPolicy/resources/redir.php: Removed.
+        * http/tests/security/contentSecurityPolicy/script-src-redirect-expected.txt:
+        * http/tests/security/contentSecurityPolicy/script-src-redirect.html:
+        * http/tests/security/cross-origin-css.html:
+        * http/tests/security/cross-origin-script-window-onerror-redirected.html:
+        * http/tests/security/mixedContent/redirect-http-to-https-iframe-in-main-frame-expected.txt:
+        * http/tests/security/mixedContent/redirect-http-to-https-script-in-iframe-expected.txt:
+        * http/tests/security/mixedContent/redirect-https-to-http-iframe-in-main-frame-expected.txt:
+        * http/tests/security/mixedContent/resources/frame-with-redirect-http-to-https-frame.html:
+        * http/tests/security/mixedContent/resources/frame-with-redirect-http-to-https-script.html:
+        * http/tests/security/mixedContent/resources/frame-with-redirect-https-to-http-frame.html:
+        * http/tests/security/mixedContent/resources/frame-with-redirect-https-to-http-script.html:
+        * http/tests/security/redirect-BLOCKED-to-localURL.html:
+        * http/tests/security/resources/cross-origin-xsl-redirect.xml:
+        * http/tests/security/resources/redir.php: Removed.
+        * http/tests/security/resources/xsl-using-document-redirect.xsl:
+        * http/tests/security/resources/xsl-using-external-entity-redirect.xsl:
+        * http/tests/security/stylesheet-href-redirect-expected.txt:
+        * http/tests/security/stylesheet-href-redirect.html:
+        * http/tests/security/xssAuditor/block-does-not-leak-referrer.html:
+        * http/tests/security/xssAuditor/resources/redir.php: Removed.
+        * http/tests/security/xssAuditor/script-tag-open-redirect.html:
+        * http/tests/security/xssAuditor/script-tag-redirect.html:
+        * http/tests/xmlhttprequest/redirect-cross-origin-2.html:
+        * http/tests/xmlhttprequest/redirect-cross-origin-post-sync.html:
+        * http/tests/xmlhttprequest/redirect-cross-origin-post.html:
+        * http/tests/xmlhttprequest/redirect-cross-origin-sync-double.html:
+        * http/tests/xmlhttprequest/redirect-cross-origin-sync.html:
+        * http/tests/xmlhttprequest/redirect-cross-origin.html:
+        * http/tests/xmlhttprequest/resources/redirect.php: Removed.
+        * http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect.html:
+
 2013-08-09  Rob Buis  <rwlbuis@webkit.org>
 
         ASSERTION FAILED: stroke->opacity != other->stroke->opacity in WebCore::SVGRenderStyle::diff
diff --git a/LayoutTests/http/tests/permissionclient/resources/redir.php b/LayoutTests/http/tests/permissionclient/resources/redir.php
deleted file mode 100644 (file)
index 16a01ed..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-header("location: ".$_GET["url"]);
-?>
index cfeb37d..f536072 100644 (file)
@@ -13,4 +13,8 @@
         $code = 302;
     header("HTTP/1.1 $code");
     header("Location: $url");
+
+    # Workaround for https://bugs.webkit.org/show_bug.cgi?id=77538
+    # Caching redirects results in flakiness in tests that dump loader delegates.
+    header("Cache-Control: no-store");
 ?>
index 472844f..44cda53 100644 (file)
@@ -1,2 +1,2 @@
-CONSOLE MESSAGE: line 15: http://127.0.0.1:8000/security/resources/redir.php?url=http://localhost:8000/security/resources/post-done.html
+CONSOLE MESSAGE: line 15: http://127.0.0.1:8000/resources/redirect.php?url=http://localhost:8000/security/resources/post-done.html
 This test produces output in the console. Only the initial URL should be logged. 
index 91f1490..fb00f99 100644 (file)
@@ -11,6 +11,6 @@ window.addEventListener('message', function(evt) {
 </script>
 This test produces output in the console.  Only the initial URL should be logged.
 <iframe
-  src="http://127.0.0.1:8000/security/resources/redir.php?url=http://localhost:8000/security/resources/post-done.html"
+  src="http://127.0.0.1:8000/resources/redirect.php?url=http://localhost:8000/security/resources/post-done.html"
   onbeforeload="console.log(event.url)">
 </iframe>
index 1cdc3d0..a45a385 100644 (file)
@@ -2,9 +2,9 @@
 <html>
 <head>
 <link rel="stylesheet"
-      href="resources/redir.php?url=http://localhost:8000/security/resources/cssStyle.css">
+      href="/resources/redirect.php?url=http://localhost:8000/security/resources/cssStyle.css">
 <link rel="stylesheet"
-      href="http://localhost:8000/security/resources/redir.php?url=http://127.0.0.1:8000/security/resources/cssStyle.css">
+      href="http://localhost:8000/resources/redirect.php?url=http://127.0.0.1:8000/security/resources/cssStyle.css">
 <script>
 if (window.testRunner)
     testRunner.dumpAsText();
index 9daa7ac..1f7660c 100644 (file)
@@ -28,6 +28,6 @@ function draw()
 <p>This tests that drawing an image that redirects to a remote image to a canvas taints the canvas</p>
 <pre id="console"></pre>
 <canvas id="canvas" width="330" height="115"></canvas>
-<img id="img" onload="draw()" src="resources/redir.php?url=http://localhost:8000/security/resources/abe.png">
+<img id="img" onload="draw()" src="/resources/redirect.php?url=http://localhost:8000/security/resources/abe.png">
 </body>
 </html>
index c025f4d..839b661 100644 (file)
@@ -103,5 +103,5 @@ image.onload = function() {
     if (window.testRunner)
         testRunner.notifyDone();
 }
-image.src = "resources/redir.php?url=http://localhost:8000/security/resources/abe.png";
+image.src = "/resources/redirect.php?url=http://localhost:8000/security/resources/abe.png";
 </script>
index 710aa4b..70f5321 100644 (file)
@@ -1,3 +1,3 @@
 <meta http-equiv="Content-Security-Policy" content="frame-src 127.0.0.1:8000">
 <script src="resources/dump-as-text.js"></script>
-<iframe src="resources/redir.php?url=http://localhost:8000/security/contentSecurityPolicy/resources/alert-fail.html"></iframe>
+<iframe src="/resources/redirect.php?url=http://localhost:8000/security/contentSecurityPolicy/resources/alert-fail.html"></iframe>
index 0ff1788..ad426c1 100644 (file)
@@ -28,7 +28,8 @@ function testImpl(experimental, preescapedPolicy) {
     if (!preescapedPolicy)
         policy = encodeURIComponent(policy);
 
-    var scriptToLoad = baseURL + encodeURIComponent(current[2]);
+    var scriptURLIsAbsolute = current[2][0] == '/';
+    var scriptToLoad = scriptURLIsAbsolute ? encodeURIComponent(current[2]) : (baseURL + encodeURIComponent(current[2]));
     if (current[2].match(/^data:/) || current[2].match(/^https?:/))
         scriptToLoad = encodeURIComponent(current[2]);
 
diff --git a/LayoutTests/http/tests/security/contentSecurityPolicy/resources/redir.php b/LayoutTests/http/tests/security/contentSecurityPolicy/resources/redir.php
deleted file mode 100644 (file)
index 16a01ed..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-header("location: ".$_GET["url"]);
-?>
index 2f52f48..f390f2f 100644 (file)
@@ -1,6 +1,6 @@
-CONSOLE MESSAGE: Refused to load the script 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/redir.php?url=http://localhost:8000/security/contentSecurityPolicy/resources/script.js' because it violates the following Content Security Policy directive: "script-src localhost".
+CONSOLE MESSAGE: Refused to load the script 'http://127.0.0.1:8000/resources/redirect.php?url=http://localhost:8000/security/contentSecurityPolicy/resources/script.js' because it violates the following Content Security Policy directive: "script-src localhost".
 
-CONSOLE MESSAGE: Refused to load the script 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/redir.php?url=http://localhost:8000/security/contentSecurityPolicy/resources/script.js' because it violates the following Content Security Policy directive: "script-src 127.0.0.1".
+CONSOLE MESSAGE: Refused to load the script 'http://127.0.0.1:8000/resources/redirect.php?url=http://localhost:8000/security/contentSecurityPolicy/resources/script.js' because it violates the following Content Security Policy directive: "script-src 127.0.0.1".
 
 Loads an iframe which in turns tries to load an external script. The request for the script is redirected to 'localhost'. The iframe has a content security policy disabling external scripts from hosts other than 'localhost'. So the script should be allowed to run.
 
index 3a61e82..254d2bf 100644 (file)
@@ -4,8 +4,8 @@
 <script src="resources/multiple-iframe-test.js"></script>
 <script>
 var tests = [
-  ['no', 'script-src localhost', 'resources/redir.php?url=http://localhost:8000/security/contentSecurityPolicy/resources/script.js'],
-  ['no', 'script-src 127.0.0.1', 'resources/redir.php?url=http://localhost:8000/security/contentSecurityPolicy/resources/script.js']
+  ['no', 'script-src localhost', '/resources/redirect.php?url=http://localhost:8000/security/contentSecurityPolicy/resources/script.js'],
+  ['no', 'script-src 127.0.0.1', '/resources/redirect.php?url=http://localhost:8000/security/contentSecurityPolicy/resources/script.js']
 ];
 </script>
 </head>
index 223b390..7d6edb6 100644 (file)
@@ -1,12 +1,12 @@
 <html>
 <head>
 <link rel="stylesheet"
-      href="resources/redir.php?url=http://localhost:8000/security/resources/xorigincss1.html"></link>
+      href="/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss1.html"></link>
 <link rel="stylesheet"
       type="text/css"
-      href="resources/redir.php?url=http://localhost:8000/security/resources/xorigincss2.html"></link>
+      href="/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss2.html"></link>
 <link rel="stylesheet"
-      href="resources/redir.php?url=http://localhost:8000/security/resources/xorigincss1.css"></link>
+      href="/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss1.css"></link>
 <link rel="stylesheet"
       href="resources/xorigincss3.html"></link>
 <script>
@@ -37,9 +37,9 @@ window.onload = function() {
 </script>
 <style>
 /* Deliberately reuse the same file / class / id on this first one */
-@import "resources/redir.php?url=http://localhost:8000/security/resources/xorigincss2.html";
-@import "resources/redir.php?url=http://localhost:8000/security/resources/xorigincss4.html";
-@import "resources/redir.php?url=http://localhost:8000/security/resources/xorigincss2.css";
+@import "/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss2.html";
+@import "/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss4.html";
+@import "/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss2.css";
 @import "resources/xorigincss5.html";
 </style>
 </head>
index 36cd7fc..038ad8b 100644 (file)
@@ -17,7 +17,7 @@ window.onerror = function(message, url, line) {
   return true;
 }
 </script>
-<script src="resources/redir.php?url=http://localhost:8000/security/resources/cross-origin-script.txt">
+<script src="/resources/redirect.php?url=http://localhost:8000/security/resources/cross-origin-script.txt">
 </script>
 </body>
 </html>
index 11202d4..6e5ec87 100644 (file)
@@ -4,7 +4,7 @@ main frame - didHandleOnloadEventsForFrame
 main frame - didFinishLoadForFrame
 main frame - didCommitLoadForFrame
 frame "<!--framePath //<!--frame0-->-->" - didStartProvisionalLoadForFrame
-CONSOLE MESSAGE: The page at about:blank displayed insecure content from http://127.0.0.1:8080/security/resources/redir.php?url=https://127.0.0.1:8443/security/mixedContent/resources/boring.html.
+CONSOLE MESSAGE: The page at about:blank displayed insecure content from http://127.0.0.1:8080/resources/redirect.php?url=https://127.0.0.1:8443/security/mixedContent/resources/boring.html.
 
 didDisplayInsecureContent
 main frame - didFinishDocumentLoadForFrame
index 6a9fe99..f3c4776 100644 (file)
@@ -1,7 +1,7 @@
 frame "<!--framePath //<!--frame0-->-->" - didStartProvisionalLoadForFrame
 main frame - didFinishDocumentLoadForFrame
 frame "<!--framePath //<!--frame0-->-->" - didCommitLoadForFrame
-CONSOLE MESSAGE: The page at https://127.0.0.1:8443/security/mixedContent/resources/frame-with-redirect-http-to-https-script.html ran insecure content from http://127.0.0.1:8080/security/resources/redir.php?url=https://127.0.0.1:8443/security/mixedContent/resources/script.js.
+CONSOLE MESSAGE: The page at https://127.0.0.1:8443/security/mixedContent/resources/frame-with-redirect-http-to-https-script.html ran insecure content from http://127.0.0.1:8080/resources/redirect.php?url=https://127.0.0.1:8443/security/mixedContent/resources/script.js.
 
 didRunInsecureContent
 frame "<!--framePath //<!--frame0-->-->" - didFinishDocumentLoadForFrame
index 11202d4..6e5ec87 100644 (file)
@@ -4,7 +4,7 @@ main frame - didHandleOnloadEventsForFrame
 main frame - didFinishLoadForFrame
 main frame - didCommitLoadForFrame
 frame "<!--framePath //<!--frame0-->-->" - didStartProvisionalLoadForFrame
-CONSOLE MESSAGE: The page at about:blank displayed insecure content from http://127.0.0.1:8080/security/resources/redir.php?url=https://127.0.0.1:8443/security/mixedContent/resources/boring.html.
+CONSOLE MESSAGE: The page at about:blank displayed insecure content from http://127.0.0.1:8080/resources/redirect.php?url=https://127.0.0.1:8443/security/mixedContent/resources/boring.html.
 
 didDisplayInsecureContent
 main frame - didFinishDocumentLoadForFrame
index 4322c87..a5f3292 100644 (file)
@@ -5,4 +5,4 @@ function frameLoaded() {
 }
 </script>
 <iframe onload="frameLoaded()"
-        src="http://127.0.0.1:8080/security/resources/redir.php?url=https://127.0.0.1:8443/security/mixedContent/resources/boring.html"></iframe>
+        src="http://127.0.0.1:8080/resources/redirect.php?url=https://127.0.0.1:8443/security/mixedContent/resources/boring.html"></iframe>
index 3fe8594..4552d99 100644 (file)
@@ -1 +1 @@
-<script src="http://127.0.0.1:8080/security/resources/redir.php?url=https://127.0.0.1:8443/security/mixedContent/resources/script.js"></script>
+<script src="http://127.0.0.1:8080/resources/redirect.php?url=https://127.0.0.1:8443/security/mixedContent/resources/script.js"></script>
index 78b2ec0..0139bb5 100644 (file)
@@ -5,4 +5,4 @@ function frameLoaded() {
 }
 </script>
 <iframe onload="frameLoaded()"
-        src="https://127.0.0.1:8443/security/resources/redir.php?url=http://127.0.0.1:8080/security/mixedContent/resources/boring.html"></iframe>
+        src="https://127.0.0.1:8443/resources/redirect.php?url=http://127.0.0.1:8080/security/mixedContent/resources/boring.html"></iframe>
index 7d5537c..d3f62bc 100644 (file)
@@ -1 +1 @@
-<script src="https://127.0.0.1:8443/security/resources/redir.php?url=http://127.0.0.1:8080/security/mixedContent/resources/script.js"></script>
+<script src="https://127.0.0.1:8443/resources/redirect.php?url=http://127.0.0.1:8080/security/mixedContent/resources/script.js"></script>
index f64fcf0..8840aa1 100755 (executable)
@@ -1,6 +1,6 @@
 <html>
 <body>
-<iframe src="http://127.0.0.1:8000/security/resources/redir.php?url=file:///tmp/LayoutTests/http/tests/security/resources/file-redirect-target.html"></iframe></br>
+<iframe src="http://127.0.0.1:8000/resources/redirect.php?url=file:///tmp/LayoutTests/http/tests/security/resources/file-redirect-target.html"></iframe></br>
 <script>
     if (window.testRunner) {
         testRunner.dumpAsText();
index d1ba5ea..f2b359e 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<?xml-stylesheet type="text/xsl" href="http://127.0.0.1:8000/security/resources/redir.php?url=http://localhost:8000/security/resources/forbidden-stylesheet.xsl"?>
+<?xml-stylesheet type="text/xsl" href="http://127.0.0.1:8000/resources/redirect.php?url=http://localhost:8000/security/resources/forbidden-stylesheet.xsl"?>
 <html xmlns="http://www.w3.org/1999/xhtml">
 <body>
 <script>
diff --git a/LayoutTests/http/tests/security/resources/redir.php b/LayoutTests/http/tests/security/resources/redir.php
deleted file mode 100644 (file)
index 16a01ed..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-header("location: ".$_GET["url"]);
-?>
index 7f70d8c..89c540e 100644 (file)
@@ -9,7 +9,7 @@ if (window.testRunner)
 </script>
 <div>This test includes content via a cross-origin document() command.  It
 passes if the load fails and thus there is no text below this line.</div>
-<xsl:value-of select="document('redir.php?url=http://localhost:8000/security/resources/target.xml')"/>
+<xsl:value-of select="document('/resources/redirect.php?url=http://localhost:8000/security/resources/target.xml')"/>
 </body>
 </html>
 </xsl:template>
index c6b5881..6be35dc 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE doc [ <!ENTITY ent SYSTEM "redir.php?url=http://localhost:8000/security/resources/target.xml"> ]>
+<!DOCTYPE doc [ <!ENTITY ent SYSTEM "/resources/redirect.php?url=http://localhost:8000/security/resources/target.xml"> ]>
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:template match="*">
 <html>
index c6c1660..01b8b7e 100644 (file)
@@ -1,2 +1,2 @@
 A style sheet's href should be the original URL, not the final URL, of the redirect chain:
-http://localhost:8000/security/resources/redir.php?url=http://localhost:8000/security/resources/cssStyle.css
+http://localhost:8000/resources/redirect.php?url=http://localhost:8000/security/resources/cssStyle.css
index 0a0a1bc..2d8f594 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <head>
 <link rel="stylesheet" type="text/css"
-  href="http://localhost:8000/security/resources/redir.php?url=http://localhost:8000/security/resources/cssStyle.css">
+  href="http://localhost:8000/resources/redirect.php?url=http://localhost:8000/security/resources/cssStyle.css">
 <script>
 if (window.testRunner)
     testRunner.dumpAsText();
index fe53be8..7a43500 100644 (file)
@@ -16,7 +16,7 @@
         window.onload = function () {
             var i = document.querySelector('iframe');
             i.onload = checkReferer;
-            i.src = 'http://localhost:8000/security/xssAuditor/resources/redir.php?url=http://localhost:8000/security/xssAuditor/resources/echo-intertag.pl?enable-full-block=1%26q=<script>alert(String.fromCharCode(0x58,0x53,0x53))<' + '/script>';
+            i.src = 'http://localhost:8000/resources/redirect.php?url=http://localhost:8000/security/xssAuditor/resources/echo-intertag.pl?enable-full-block=1%26q=<script>alert(String.fromCharCode(0x58,0x53,0x53))<' + '/script>';
         };
     </script>
     <script src="/resources/js-test-post.js"></script>
diff --git a/LayoutTests/http/tests/security/xssAuditor/resources/redir.php b/LayoutTests/http/tests/security/xssAuditor/resources/redir.php
deleted file mode 100644 (file)
index e0e72fe..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-header("Location: ".$_GET["url"]);
-?>
index 3cae550..f1792af 100644 (file)
@@ -9,7 +9,7 @@ if (window.testRunner) {
 </script>
 </head>
 <body>
-<iframe src="http://localhost:8000/security/xssAuditor/resources/redir.php?url=http://localhost:8000/security/xssAuditor/resources/echo-intertag.pl?q=<script>alert(String.fromCharCode(0x58,0x53,0x53))</script>">
+<iframe src="http://localhost:8000/resources/redirect.php?url=http://localhost:8000/security/xssAuditor/resources/echo-intertag.pl?q=<script>alert(String.fromCharCode(0x58,0x53,0x53))</script>">
 </iframe>
 </body>
 </html>
index 3f097bb..b774fd5 100644 (file)
@@ -9,7 +9,7 @@ if (window.testRunner) {
 </script>
 </head>
 <body>
-<iframe src="resources/redir.php?url=http://localhost:8000/security/xssAuditor/resources/echo-intertag.pl?q=<script>alert(String.fromCharCode(0x58,0x53,0x53))</script>">
+<iframe src="/resources/redirect.php?url=http://localhost:8000/security/xssAuditor/resources/echo-intertag.pl?q=<script>alert(String.fromCharCode(0x58,0x53,0x53))</script>">
 </iframe>
 </body>
 </html>
index 6b01cda..c20ec19 100644 (file)
@@ -31,7 +31,7 @@
         xhr.onloadstart = function() { log("onloadstart") }
         xhr.onprogress = function() { log("onprogress") }
         xhr.onerror = function() { log("onerror"); setTimeout(doneMissing, 100); }
-        xhr.open("GET", "resources/redirect.php?url=http://localhost:22/", true); // A non-HTTP port that is likely to be listening.
+        xhr.open("GET", "/resources/redirect.php?url=http://localhost:22/", true); // A non-HTTP port that is likely to be listening.
         xhr.send();
     }
 
@@ -61,7 +61,7 @@
     xhr.onloadstart = function() { log("onloadstart") }
     xhr.onprogress = function() { log("onprogress") }
     xhr.onerror = function() { log("onerror"); setTimeout(doneExisting, 100); }
-    xhr.open("GET", "resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/reply.xml", true);
+    xhr.open("GET", "/resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/reply.xml", true);
     xhr.send();
 
 </script>
index 7740d4f..bc59f77 100644 (file)
@@ -27,7 +27,7 @@
     xhr.upload.onloadstart = function() { log("upload.onloadstart") }
     xhr.upload.onprogress = function() { log("upload.onprogress") }
     try {
-        xhr.open("POST", "resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/reply.xml", false);
+        xhr.open("POST", "/resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/reply.xml", false);
         xhr.send("Text");
     } catch (ex) {
         log(ex);
@@ -51,7 +51,7 @@
     xhr.upload.onloadstart = function() { log("upload.onloadstart") }
     xhr.upload.onprogress = function() { log("upload.onprogress") }
     try {
-        xhr.open("POST", "resources/redirect.php?url=http://localhost:7/", false); // A port that will likely refuse the connection.
+        xhr.open("POST", "/resources/redirect.php?url=http://localhost:7/", false); // A port that will likely refuse the connection.
         xhr.send("Text");
     } catch (ex) {
         log(ex);
index 17098d0..1b29ece 100644 (file)
@@ -36,7 +36,7 @@
         xhr.upload.onload = function() { log("upload.onload") }
         xhr.upload.onloadstart = function() { log("upload.onloadstart") }
         xhr.upload.onprogress = function() { log("upload.onprogress") }
-        xhr.open("POST", "resources/redirect.php?url=http://localhost:7/", true); // A port that will likely refuse the connection.
+        xhr.open("POST", "/resources/redirect.php?url=http://localhost:7/", true); // A port that will likely refuse the connection.
         xhr.send("Text");
     }
 
@@ -71,7 +71,7 @@
     xhr.upload.onload = function() { log("upload.onload") }
     xhr.upload.onloadstart = function() { log("upload.onloadstart") }
     xhr.upload.onprogress = function() { log("upload.onprogress") }
-    xhr.open("POST", "resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/reply.xml", true);
+    xhr.open("POST", "/resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/reply.xml", true);
     xhr.send("Text");
 
 </script>
index f957f9a..ff7653c 100644 (file)
@@ -22,7 +22,7 @@
     xhr.onprogress = function() { log("onprogress") }
     xhr.onerror = function() { log("onerror") }
     try {
-        xhr.open("GET", "resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/redirect.php?url=/xmlhttprequest/resources/reply.xml", false);
+        xhr.open("GET", "/resources/redirect.php?url=http://localhost:8000/resources/redirect.php?url=/xmlhttprequest/resources/reply.xml", false);
         xhr.send();
     } catch (ex) {
         log(ex);
@@ -41,7 +41,7 @@
     xhr.onprogress = function() { log("onprogress") }
     xhr.onerror = function() { log("onerror"); }
     try {
-        xhr.open("GET", "resources/redirect.php?url=http://localhost:7/", false); // A port that will likely refuse the connection.
+        xhr.open("GET", "/resources/redirect.php?url=http://localhost:7/", false); // A port that will likely refuse the connection.
         xhr.send();
     } catch (ex) {
         log(ex);
index 676af75..3f60071 100644 (file)
@@ -22,7 +22,7 @@
     xhr.onprogress = function() { log("onprogress") }
     xhr.onerror = function() { log("onerror") }
     try {
-        xhr.open("GET", "resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/reply.xml", false);
+        xhr.open("GET", "/resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/reply.xml", false);
         xhr.send();
     } catch (ex) {
         log(ex);
@@ -41,7 +41,7 @@
     xhr.onprogress = function() { log("onprogress") }
     xhr.onerror = function() { log("onerror"); }
     try {
-        xhr.open("GET", "resources/redirect.php?url=http://localhost:7/", false); // A port that will likely refuse the connection.
+        xhr.open("GET", "/resources/redirect.php?url=http://localhost:7/", false); // A port that will likely refuse the connection.
         xhr.send();
     } catch (ex) {
         log(ex);
index 8f25333..ff35f0b 100644 (file)
@@ -31,7 +31,7 @@
         xhr.onloadstart = function() { log("onloadstart") }
         xhr.onprogress = function() { log("onprogress") }
         xhr.onerror = function() { log("onerror"); setTimeout(doneMissing, 100); }
-        xhr.open("GET", "resources/redirect.php?url=http://localhost:7/", true); // A port that will likely refuse the connection.
+        xhr.open("GET", "/resources/redirect.php?url=http://localhost:7/", true); // A port that will likely refuse the connection.
         xhr.send();
     }
 
@@ -61,7 +61,7 @@
     xhr.onloadstart = function() { log("onloadstart") }
     xhr.onprogress = function() { log("onprogress") }
     xhr.onerror = function() { log("onerror"); setTimeout(doneExisting, 100); }
-    xhr.open("GET", "resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/reply.xml", true);
+    xhr.open("GET", "/resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/reply.xml", true);
     xhr.send();
 
 </script>
diff --git a/LayoutTests/http/tests/xmlhttprequest/resources/redirect.php b/LayoutTests/http/tests/xmlhttprequest/resources/redirect.php
deleted file mode 100644 (file)
index 5ecd2d6..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<?php
-    $url = $_GET['url'];
-    header("Location: $url");
-?>
index cf03c33..855ef5c 100644 (file)
@@ -49,7 +49,7 @@ function runTest() {
     req.onreadystatechange = onReqreadystatechange;
     req.onerror = onSyncReqError;
     req.onabort = onReqAbort;
-    req.open('GET', '/xmlhttprequest/resources/redirect.php?url=http://localhost:8080/xmlhttprequest/resources/forbidden.txt', false);
+    req.open('GET', '/resources/redirect.php?url=http://localhost:8080/xmlhttprequest/resources/forbidden.txt', false);
     try {
         req.send(null);
     } catch (e) {
@@ -67,7 +67,7 @@ function runTest() {
     req.onload = didReadFile;
     req.onerror = onReqError;
     req.onabort = onReqAbort;
-    req.open('GET', '/xmlhttprequest/resources/redirect.php?url=http://localhost:8080/xmlhttprequest/resources/forbidden.txt');
+    req.open('GET', '/resources/redirect.php?url=http://localhost:8080/xmlhttprequest/resources/forbidden.txt');
     req.send(null);
 }
 </script>