Title: [275677] trunk/LayoutTests
Revision
275677
Author
cgambr...@apple.com
Date
2021-04-08 14:27:43 -0700 (Thu, 08 Apr 2021)

Log Message

[LayoutTests] Convert http/tests/navigation convert PHP to Python
https://bugs.webkit.org/show_bug.cgi?id=222418
<rdar://problem/74744523>

Reviewed by Jonathan Bedard.

* http/tests/blink/sendbeacon/beacon-cross-origin-redirect-blob-expected.txt:
* http/tests/blink/sendbeacon/beacon-cross-origin-redirect-blob.html:
* http/tests/blink/sendbeacon/beacon-cross-origin-redirect-expected.txt:
* http/tests/blink/sendbeacon/beacon-cross-origin-redirect.html:
* http/tests/navigation/image-load-in-pagehide-handler-expected.txt:
* http/tests/navigation/image-load-in-pagehide-handler.html:
* http/tests/navigation/image-load-in-unload-handler-expected.txt:
* http/tests/navigation/image-load-in-unload-handler.html:
* http/tests/navigation/no-referrer-reset-expected.txt:
* http/tests/navigation/no-referrer-reset.html:
* http/tests/navigation/no-referrer-same-window.html:
* http/tests/navigation/no-referrer-subframe.html:
* http/tests/navigation/no-referrer-target-blank.html:
* http/tests/navigation/ping-attribute/anchor-cookie-expected.txt:
* http/tests/navigation/ping-attribute/anchor-cookie.html:
* http/tests/navigation/ping-attribute/anchor-cross-origin-expected.txt:
* http/tests/navigation/ping-attribute/anchor-cross-origin-from-https-expected.txt:
* http/tests/navigation/ping-attribute/anchor-cross-origin-from-https.html:
* http/tests/navigation/ping-attribute/anchor-cross-origin.html:
* http/tests/navigation/ping-attribute/anchor-ping-and-follow-redirect-when-sending-ping-expected.txt:
* http/tests/navigation/ping-attribute/anchor-ping-and-follow-redirect-when-sending-ping.html:
* http/tests/navigation/ping-attribute/anchor-same-origin-expected.txt:
* http/tests/navigation/ping-attribute/anchor-same-origin.html:
* http/tests/navigation/ping-attribute/area-cookie-expected.txt:
* http/tests/navigation/ping-attribute/area-cookie.html:
* http/tests/navigation/ping-attribute/area-cross-origin-expected.txt:
* http/tests/navigation/ping-attribute/area-cross-origin-from-https-expected.txt:
* http/tests/navigation/ping-attribute/area-cross-origin-from-https.html:
* http/tests/navigation/ping-attribute/area-cross-origin.html:
* http/tests/navigation/ping-attribute/area-same-origin-expected.txt:
* http/tests/navigation/ping-attribute/area-same-origin.html:
* http/tests/navigation/ping-attribute/resources/utilities.js:
(clearLastPingResultAndRunTest):
* http/tests/navigation/post-301-response.html:
* http/tests/navigation/post-302-response.html:
* http/tests/navigation/post-303-response.html:
* http/tests/navigation/post-307-response.html:
* http/tests/navigation/post-308-response.html:
* http/tests/navigation/resources/check-ping.php: Removed.
* http/tests/navigation/resources/check-ping.py: Added.
* http/tests/navigation/resources/delete-ping.php: Removed.
* http/tests/navigation/resources/delete-ping.py: Added.
* http/tests/navigation/resources/image-load-in-pagehide-handler-2.html:
* http/tests/navigation/resources/image-load-in-unload-handler-2.html:
* http/tests/navigation/resources/no-referrer-helper.php: Removed.
* http/tests/navigation/resources/no-referrer-helper.py: Added.
* http/tests/navigation/resources/no-referrer-reset-helper.php: Removed.
* http/tests/navigation/resources/no-referrer-reset-helper.py: Added.
* http/tests/navigation/resources/no-referrer-same-window-helper.php: Removed.
* http/tests/navigation/resources/no-referrer-same-window-helper.py: Added.
* http/tests/navigation/resources/ping-file-path.php: Removed.
* http/tests/navigation/resources/ping_file_path.py: Added.
* http/tests/navigation/resources/redirected-post-request-contents.php: Removed.
* http/tests/navigation/resources/redirected-post-request-contents.py: Added.
(check_header):
* http/tests/navigation/resources/redirection-response.php: Removed.
* http/tests/navigation/resources/redirection-response.py: Added.
* http/tests/navigation/resources/save-Ping.php: Removed.
* http/tests/navigation/resources/save-ping-and-redirect-to-save-ping.php: Removed.
* http/tests/navigation/resources/save-ping-and-redirect-to-save-ping.py: Added.
* http/tests/navigation/resources/save-ping.py: Added.
* http/tests/navigation/resources/save_ping.py: Added.
(not_being_called):
(save_ping):
* http/tests/security/contentSecurityPolicy/1.1/form-action-src-redirect-blocked.html:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (275676 => 275677)


--- trunk/LayoutTests/ChangeLog	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/ChangeLog	2021-04-08 21:27:43 UTC (rev 275677)
@@ -1,5 +1,79 @@
 2021-04-08  Chris Gambrell  <cgambr...@apple.com>
 
+        [LayoutTests] Convert http/tests/navigation convert PHP to Python
+        https://bugs.webkit.org/show_bug.cgi?id=222418
+        <rdar://problem/74744523>
+
+        Reviewed by Jonathan Bedard.
+
+        * http/tests/blink/sendbeacon/beacon-cross-origin-redirect-blob-expected.txt:
+        * http/tests/blink/sendbeacon/beacon-cross-origin-redirect-blob.html:
+        * http/tests/blink/sendbeacon/beacon-cross-origin-redirect-expected.txt:
+        * http/tests/blink/sendbeacon/beacon-cross-origin-redirect.html:
+        * http/tests/navigation/image-load-in-pagehide-handler-expected.txt:
+        * http/tests/navigation/image-load-in-pagehide-handler.html:
+        * http/tests/navigation/image-load-in-unload-handler-expected.txt:
+        * http/tests/navigation/image-load-in-unload-handler.html:
+        * http/tests/navigation/no-referrer-reset-expected.txt:
+        * http/tests/navigation/no-referrer-reset.html:
+        * http/tests/navigation/no-referrer-same-window.html:
+        * http/tests/navigation/no-referrer-subframe.html:
+        * http/tests/navigation/no-referrer-target-blank.html:
+        * http/tests/navigation/ping-attribute/anchor-cookie-expected.txt:
+        * http/tests/navigation/ping-attribute/anchor-cookie.html:
+        * http/tests/navigation/ping-attribute/anchor-cross-origin-expected.txt:
+        * http/tests/navigation/ping-attribute/anchor-cross-origin-from-https-expected.txt:
+        * http/tests/navigation/ping-attribute/anchor-cross-origin-from-https.html:
+        * http/tests/navigation/ping-attribute/anchor-cross-origin.html:
+        * http/tests/navigation/ping-attribute/anchor-ping-and-follow-redirect-when-sending-ping-expected.txt:
+        * http/tests/navigation/ping-attribute/anchor-ping-and-follow-redirect-when-sending-ping.html:
+        * http/tests/navigation/ping-attribute/anchor-same-origin-expected.txt:
+        * http/tests/navigation/ping-attribute/anchor-same-origin.html:
+        * http/tests/navigation/ping-attribute/area-cookie-expected.txt:
+        * http/tests/navigation/ping-attribute/area-cookie.html:
+        * http/tests/navigation/ping-attribute/area-cross-origin-expected.txt:
+        * http/tests/navigation/ping-attribute/area-cross-origin-from-https-expected.txt:
+        * http/tests/navigation/ping-attribute/area-cross-origin-from-https.html:
+        * http/tests/navigation/ping-attribute/area-cross-origin.html:
+        * http/tests/navigation/ping-attribute/area-same-origin-expected.txt:
+        * http/tests/navigation/ping-attribute/area-same-origin.html:
+        * http/tests/navigation/ping-attribute/resources/utilities.js:
+        (clearLastPingResultAndRunTest):
+        * http/tests/navigation/post-301-response.html:
+        * http/tests/navigation/post-302-response.html:
+        * http/tests/navigation/post-303-response.html:
+        * http/tests/navigation/post-307-response.html:
+        * http/tests/navigation/post-308-response.html:
+        * http/tests/navigation/resources/check-ping.php: Removed.
+        * http/tests/navigation/resources/check-ping.py: Added.
+        * http/tests/navigation/resources/delete-ping.php: Removed.
+        * http/tests/navigation/resources/delete-ping.py: Added.
+        * http/tests/navigation/resources/image-load-in-pagehide-handler-2.html:
+        * http/tests/navigation/resources/image-load-in-unload-handler-2.html:
+        * http/tests/navigation/resources/no-referrer-helper.php: Removed.
+        * http/tests/navigation/resources/no-referrer-helper.py: Added.
+        * http/tests/navigation/resources/no-referrer-reset-helper.php: Removed.
+        * http/tests/navigation/resources/no-referrer-reset-helper.py: Added.
+        * http/tests/navigation/resources/no-referrer-same-window-helper.php: Removed.
+        * http/tests/navigation/resources/no-referrer-same-window-helper.py: Added.
+        * http/tests/navigation/resources/ping-file-path.php: Removed.
+        * http/tests/navigation/resources/ping_file_path.py: Added.
+        * http/tests/navigation/resources/redirected-post-request-contents.php: Removed.
+        * http/tests/navigation/resources/redirected-post-request-contents.py: Added.
+        (check_header):
+        * http/tests/navigation/resources/redirection-response.php: Removed.
+        * http/tests/navigation/resources/redirection-response.py: Added.
+        * http/tests/navigation/resources/save-Ping.php: Removed.
+        * http/tests/navigation/resources/save-ping-and-redirect-to-save-ping.php: Removed.
+        * http/tests/navigation/resources/save-ping-and-redirect-to-save-ping.py: Added.
+        * http/tests/navigation/resources/save-ping.py: Added.
+        * http/tests/navigation/resources/save_ping.py: Added.
+        (not_being_called):
+        (save_ping):
+        * http/tests/security/contentSecurityPolicy/1.1/form-action-src-redirect-blocked.html:
+
+2021-04-08  Chris Gambrell  <cgambr...@apple.com>
+
         [LayoutTests] Convert http/tests/workers convert PHP to Python
         https://bugs.webkit.org/show_bug.cgi?id=223522
         <rdar://problem/75624689>

Modified: trunk/LayoutTests/http/tests/blink/sendbeacon/beacon-cross-origin-redirect-blob-expected.txt (275676 => 275677)


--- trunk/LayoutTests/http/tests/blink/sendbeacon/beacon-cross-origin-redirect-blob-expected.txt	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/blink/sendbeacon/beacon-cross-origin-redirect-blob-expected.txt	2021-04-08 21:27:43 UTC (rev 275677)
@@ -3,7 +3,7 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS navigator.sendBeacon("http://127.0.0.1:8080/navigation/resources/redirection-response.php?status=302&simple=true&target=/non-existent.php", blob); is true
+PASS navigator.sendBeacon("http://127.0.0.1:8080/navigation/resources/redirection-response.py?status=302&simple=true&target=/non-existent.php", blob); is true
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/http/tests/blink/sendbeacon/beacon-cross-origin-redirect-blob.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/blink/sendbeacon/beacon-cross-origin-redirect-blob.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/blink/sendbeacon/beacon-cross-origin-redirect-blob.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -9,5 +9,5 @@
 
 const blob = new Blob(["Cross", "Origin"], {type: "text/plain;from-beacon=true"});
 // The "simple" parameter is just for differentiating the URLs.
-shouldBeTrue('navigator.sendBeacon("http://127.0.0.1:8080/navigation/resources/redirection-response.php?status=302&simple=true&target=/non-existent.php", blob);');
+shouldBeTrue('navigator.sendBeacon("http://127.0.0.1:8080/navigation/resources/redirection-response.py?status=302&simple=true&target=/non-existent.php", blob);');
 </script>

Modified: trunk/LayoutTests/http/tests/blink/sendbeacon/beacon-cross-origin-redirect-expected.txt (275676 => 275677)


--- trunk/LayoutTests/http/tests/blink/sendbeacon/beacon-cross-origin-redirect-expected.txt	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/blink/sendbeacon/beacon-cross-origin-redirect-expected.txt	2021-04-08 21:27:43 UTC (rev 275677)
@@ -3,7 +3,7 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS navigator.sendBeacon("http://127.0.0.1:8080/navigation/resources/redirection-response.php?status=302&target=/non-existent.php", "CrossOrigin"); is true
+PASS navigator.sendBeacon("http://127.0.0.1:8080/navigation/resources/redirection-response.py?status=302&target=/non-existent.php", "CrossOrigin"); is true
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/http/tests/blink/sendbeacon/beacon-cross-origin-redirect.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/blink/sendbeacon/beacon-cross-origin-redirect.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/blink/sendbeacon/beacon-cross-origin-redirect.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -13,7 +13,7 @@
         //testRunner.dumpPingLoaderCallbacks();
     }
 
-    shouldBeTrue('navigator.sendBeacon("http://127.0.0.1:8080/navigation/resources/redirection-response.php?status=302&target=/non-existent.php", "CrossOrigin");');
+    shouldBeTrue('navigator.sendBeacon("http://127.0.0.1:8080/navigation/resources/redirection-response.py?status=302&target=/non-existent.php", "CrossOrigin");');
     // Wait a while for the redirect response handling to happen before finishing up.
     setTimeout(finishJSTest, 200);
 }

Modified: trunk/LayoutTests/http/tests/navigation/image-load-in-pagehide-handler-expected.txt (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/image-load-in-pagehide-handler-expected.txt	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/image-load-in-pagehide-handler-expected.txt	2021-04-08 21:27:43 UTC (rev 275677)
@@ -2,4 +2,4 @@
 HTTP_HOST: 127.0.0.1:8000
 HTTP_REFERER: http://127.0.0.1:8000/navigation/image-load-in-pagehide-handler.html
 REQUEST_METHOD: GET
-REQUEST_URI: /navigation/resources/save-Ping.php
+REQUEST_URI: /navigation/resources/save-ping.py

Modified: trunk/LayoutTests/http/tests/navigation/image-load-in-pagehide-handler.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/image-load-in-pagehide-handler.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/image-load-in-pagehide-handler.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -19,12 +19,12 @@
 
 function ping() {
     var img = new Image(1, 1);
-    img.src = ""
+    img.src = ""
 }
 
 </script>
 </head>
 <body _onload_="test();" _onpagehide_="ping();">
-<img src="" _onload_="test();" _onerror_="test();"></img>
+<img src="" _onload_="test();" _onerror_="test();"></img>
 <p>Tests that ping loads in 'pagehide' handlers go through.</p>
 </body></html>

Modified: trunk/LayoutTests/http/tests/navigation/image-load-in-unload-handler-expected.txt (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/image-load-in-unload-handler-expected.txt	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/image-load-in-unload-handler-expected.txt	2021-04-08 21:27:43 UTC (rev 275677)
@@ -3,4 +3,4 @@
 HTTP_HOST: 127.0.0.1:8000
 HTTP_REFERER: http://127.0.0.1:8000/navigation/image-load-in-unload-handler.html
 REQUEST_METHOD: GET
-REQUEST_URI: /navigation/resources/save-Ping.php
+REQUEST_URI: /navigation/resources/save-ping.py

Modified: trunk/LayoutTests/http/tests/navigation/image-load-in-unload-handler.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/image-load-in-unload-handler.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/image-load-in-unload-handler.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -13,24 +13,24 @@
         testCalled = true;
         return;
     }
-    // We can't go to check-ping.php directly, since that doesn't start sending
+    // We can't go to check-ping.py directly, since that doesn't start sending
     // a response until the ping data is detected, but unload handlers (where
     // we send the ping) are only run once we've begun receiving data from the
     // page being navigated to. Instead, we go through a dummy redirect page,
     // to make sure that the onunload handler has run before we get to 
-    // check-ping.php.
+    // check-ping.py.
     location.assign("resources/image-load-in-unload-handler-2.html");
 }
 
 function ping() {
     var img = new Image(1, 1);
-    img.src = ""
+    img.src = ""
 }
 
 </script>
 </head>
 <body _onload_="test();" _onunload_="ping();">
-<img src="" _onload_="test();" _onerror_="test();"></img>
+<img src="" _onload_="test();" _onerror_="test();"></img>
 Test case for https://bugs.webkit.org/show_bug.cgi?id=30457. Previously, if an image<br>
 load was trigger from an unload handler, we would kill it almost immediately due to the<br>
 navigation stopping all loaders. These loads now happen entirely in the background and detached<br>

Modified: trunk/LayoutTests/http/tests/navigation/no-referrer-reset-expected.txt (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/no-referrer-reset-expected.txt	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/no-referrer-reset-expected.txt	2021-04-08 21:27:43 UTC (rev 275677)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: Referrer: http://127.0.0.1:8000/navigation/resources/no-referrer-reset-helper.php
+CONSOLE MESSAGE: Referrer: http://127.0.0.1:8000/navigation/resources/no-referrer-reset-helper.py
 CONSOLE MESSAGE: window.opener: http://127.0.0.1:8000/navigation/no-referrer-reset.html
 This tests whether referrer information gets properly set and reset when "noreferrer" links are present. We do the following:
 1. Open a link in a new window: referrer is sent and window.opener is sent.

Modified: trunk/LayoutTests/http/tests/navigation/no-referrer-reset.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/no-referrer-reset.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/no-referrer-reset.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -4,7 +4,7 @@
 2. Click a rel="noreferrer" link: referrer is null, but window.opener remains set since the link was not opened with target="_blank".<br/>
 3. Click a link without rel="noreferrer": referrer is sent, but window.opener is still set.
 <br/>
-<a id="link" href="" target="_blank" rel="opener">Start reset test</a>
+<a id="link" href="" target="_blank" rel="opener">Start reset test</a>
 <script>
     window.name = "consoleWindow";
     window.noreferrerStepDone = false;
@@ -14,16 +14,16 @@
         testRunner.waitUntilDone();
     }
 
-    var target = document.getElementById("link");
+    var target = document.getElementById("link");
     eventSender.mouseMoveTo(target.offsetLeft + 2, target.offsetTop + 2);
     eventSender.mouseDown();
     eventSender.mouseUp();
     
-function log(msg)
-{
-    var line = document.createElement('div');
-    line.appendChild(document.createTextNode(msg));
-    document.getElementById('console').appendChild(line);
+function log(msg)
+{
+    var line = document.createElement('div');
+    line.appendChild(document.createTextNode(msg));
+    document.getElementById('console').appendChild(line);
 }
 </script>
 <div id="console"></div>

Modified: trunk/LayoutTests/http/tests/navigation/no-referrer-same-window.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/no-referrer-same-window.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/no-referrer-same-window.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -3,7 +3,7 @@
 send an http referrer, and the resulting window should have its opener attribute set to null.  The values
 of the referrer and window.opener should be empty below.
 <br/>
-<a id="link" href="" rel="noreferrer">Start no referrer test</a>
+<a id="link" href="" rel="noreferrer">Start no referrer test</a>
 <script>
     window.name = "consoleWindow";
     if (window.testRunner) {
@@ -11,16 +11,16 @@
         testRunner.waitUntilDone();
     }
 
-    var target = document.getElementById("link");
+    var target = document.getElementById("link");
     eventSender.mouseMoveTo(target.offsetLeft + 2, target.offsetTop + 2);
     eventSender.mouseDown();
     eventSender.mouseUp();
     
-function log(msg)
-{
-    var line = document.createElement('div');
-    line.appendChild(document.createTextNode(msg));
-    document.getElementById('console').appendChild(line);
+function log(msg)
+{
+    var line = document.createElement('div');
+    line.appendChild(document.createTextNode(msg));
+    document.getElementById('console').appendChild(line);
 }
 </script>
 <div id="console"></div>

Modified: trunk/LayoutTests/http/tests/navigation/no-referrer-subframe.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/no-referrer-subframe.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/no-referrer-subframe.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -1,6 +1,6 @@
 <html><body>
 This tests behavior of "noreferrer" links in subframes. A referrer should not be sent and window.opener should remain null.<br/>
-<a id="link" href="" rel="noreferrer" target="subframe">Load subframe</a>
+<a id="link" href="" rel="noreferrer" target="subframe">Load subframe</a>
 <iframe id="subframe" name="subframe" src=""
 <script>
     window.name = "consoleWindow";
@@ -9,16 +9,16 @@
         testRunner.waitUntilDone();
     }
 
-    var target = document.getElementById("link");
+    var target = document.getElementById("link");
     eventSender.mouseMoveTo(target.offsetLeft + 2, target.offsetTop + 2);
     eventSender.mouseDown();
     eventSender.mouseUp();
     
-function log(msg)
-{
-    var line = document.createElement('div');
-    line.appendChild(document.createTextNode(msg));
-    document.getElementById('console').appendChild(line);
+function log(msg)
+{
+    var line = document.createElement('div');
+    line.appendChild(document.createTextNode(msg));
+    document.getElementById('console').appendChild(line);
 }
 </script>
 <div id="console"></div>

Modified: trunk/LayoutTests/http/tests/navigation/no-referrer-target-blank.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/no-referrer-target-blank.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/no-referrer-target-blank.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -2,7 +2,7 @@
 This tests the functionality of the "noreferrer" link relation on anchor tags. The link below should not
 send an http referrer, and the resulting window should have its opener attribute set to null.  The values
 of the referrer and window.opener should be empty below.<br/>
-<a id="link" href="" rel="noreferrer" target="_blank">Start no referrer test</a>
+<a id="link" href="" rel="noreferrer" target="_blank">Start no referrer test</a>
 <script>
     window.name = "consoleWindow";
     if (window.testRunner) {
@@ -11,16 +11,16 @@
         testRunner.waitUntilDone();
     }
 
-    var target = document.getElementById("link");
+    var target = document.getElementById("link");
     eventSender.mouseMoveTo(target.offsetLeft + 2, target.offsetTop + 2);
     eventSender.mouseDown();
     eventSender.mouseUp();
 
-function log(msg)
-{
-    var line = document.createElement('div');
-    line.appendChild(document.createTextNode(msg));
-    document.getElementById('console').appendChild(line);
+function log(msg)
+{
+    var line = document.createElement('div');
+    line.appendChild(document.createTextNode(msg));
+    document.getElementById('console').appendChild(line);
 }
 </script>
 <div id="console"></div>

Modified: trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-cookie-expected.txt (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-cookie-expected.txt	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-cookie-expected.txt	2021-04-08 21:27:43 UTC (rev 275677)
@@ -3,6 +3,6 @@
 HTTP_COOKIE: hello=world
 HTTP_HOST: 127.0.0.1:8000
 HTTP_PING_FROM: http://127.0.0.1:8000/navigation/ping-attribute/anchor-cookie.html
-HTTP_PING_TO: http://127.0.0.1:8000/navigation/resources/check-ping.php
+HTTP_PING_TO: http://127.0.0.1:8000/navigation/resources/check-ping.py
 REQUEST_METHOD: POST
-REQUEST_URI: /navigation/resources/save-Ping.php
+REQUEST_URI: /navigation/resources/save-ping.py

Modified: trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-cookie.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-cookie.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-cookie.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -23,5 +23,5 @@
 </head>
 <body>
 <img src=""
-<a id="a" href="" ping="../resources/save-Ping.php">Navigate and send ping</a>
+<a id="a" href="" ping="../resources/save-ping.py">Navigate and send ping</a>
 </body></html>

Modified: trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-cross-origin-expected.txt (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-cross-origin-expected.txt	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-cross-origin-expected.txt	2021-04-08 21:27:43 UTC (rev 275677)
@@ -2,6 +2,6 @@
 CONTENT_TYPE: text/ping
 HTTP_HOST: localhost:8000
 HTTP_PING_FROM: http://127.0.0.1:8000/navigation/ping-attribute/anchor-cross-origin.html
-HTTP_PING_TO: http://127.0.0.1:8000/navigation/resources/check-ping.php
+HTTP_PING_TO: http://127.0.0.1:8000/navigation/resources/check-ping.py
 REQUEST_METHOD: POST
-REQUEST_URI: /navigation/resources/save-Ping.php
+REQUEST_URI: /navigation/resources/save-ping.py

Modified: trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-cross-origin-from-https-expected.txt (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-cross-origin-from-https-expected.txt	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-cross-origin-from-https-expected.txt	2021-04-08 21:27:43 UTC (rev 275677)
@@ -1,6 +1,6 @@
 Ping sent successfully
 CONTENT_TYPE: text/ping
 HTTP_HOST: localhost:8000
-HTTP_PING_TO: https://127.0.0.1:8443/navigation/resources/check-ping.php
+HTTP_PING_TO: https://127.0.0.1:8443/navigation/resources/check-ping.py
 REQUEST_METHOD: POST
-REQUEST_URI: /navigation/resources/save-Ping.php?test=/navigation/ping-attribute/anchor-cross-origin-from-https.html
+REQUEST_URI: /navigation/resources/save-ping.py?test=/navigation/ping-attribute/anchor-cross-origin-from-https.html

Modified: trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-cross-origin-from-https.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-cross-origin-from-https.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-cross-origin-from-https.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -34,6 +34,6 @@
 </script>
 </head>
 <body _onload_="test();">
-<img src="" _onload_="test();" _onerror_="test();"></img>
-<a id="a" href="" ping="http://localhost:8000/navigation/resources/save-Ping.php?test=/navigation/ping-attribute/anchor-cross-origin-from-https.html">Navigate and send ping</a>
+<img src="" _onload_="test();" _onerror_="test();"></img>
+<a id="a" href="" ping="http://localhost:8000/navigation/resources/save-ping.py?test=/navigation/ping-attribute/anchor-cross-origin-from-https.html">Navigate and send ping</a>
 </body></html>

Modified: trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-cross-origin.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-cross-origin.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-cross-origin.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -25,6 +25,6 @@
 </script>
 </head>
 <body _onload_="test();">
-<img src="" _onload_="test();" _onerror_="test();"></img>
-<a id="a" href="" ping="http://localhost:8000/navigation/resources/save-Ping.php">Navigate and send ping</a>
+<img src="" _onload_="test();" _onerror_="test();"></img>
+<a id="a" href="" ping="http://localhost:8000/navigation/resources/save-ping.py">Navigate and send ping</a>
 </body></html>

Modified: trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-ping-and-follow-redirect-when-sending-ping-expected.txt (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-ping-and-follow-redirect-when-sending-ping-expected.txt	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-ping-and-follow-redirect-when-sending-ping-expected.txt	2021-04-08 21:27:43 UTC (rev 275677)
@@ -4,4 +4,4 @@
 HTTP_PING_FROM: http://127.0.0.1:8000/navigation/ping-attribute/anchor-ping-and-follow-redirect-when-sending-ping.html
 HTTP_PING_TO: _javascript_:checkPing()
 REQUEST_METHOD: POST
-REQUEST_URI: /navigation/resources/save-Ping.php
+REQUEST_URI: /navigation/resources/save-ping.py

Modified: trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-ping-and-follow-redirect-when-sending-ping.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-ping-and-follow-redirect-when-sending-ping.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-ping-and-follow-redirect-when-sending-ping.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -18,7 +18,7 @@
 {
     function actualCheckPing()
     {
-        window.location = "../resources/check-ping.php";
+        window.location = "../resources/check-ping.py";
     }
     // We assume that if redirects were followed when saving a ping that they will complete within one second.
     // FIXME: Is there are better way to test that a redirect occurred?
@@ -32,7 +32,7 @@
 </script>
 </head>
 <body>
-<p>This test PASSED if the filename of the REQUEST_URI in the dumped report is save-Ping.php. Otherwise, it FAIL.</p>
-<a id="a" href="" ping="../resources/save-ping-and-redirect-to-save-ping.php">Navigate and send ping</a>
+<p>This test PASSED if the filename of the REQUEST_URI in the dumped report is save-ping.py. Otherwise, it FAIL.</p>
+<a id="a" href="" ping="../resources/save-ping-and-redirect-to-save-ping.py">Navigate and send ping</a>
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-same-origin-expected.txt (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-same-origin-expected.txt	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-same-origin-expected.txt	2021-04-08 21:27:43 UTC (rev 275677)
@@ -2,6 +2,6 @@
 CONTENT_TYPE: text/ping
 HTTP_HOST: 127.0.0.1:8000
 HTTP_PING_FROM: http://127.0.0.1:8000/navigation/ping-attribute/anchor-same-origin.html
-HTTP_PING_TO: http://127.0.0.1:8000/navigation/resources/check-ping.php
+HTTP_PING_TO: http://127.0.0.1:8000/navigation/resources/check-ping.py
 REQUEST_METHOD: POST
-REQUEST_URI: /navigation/resources/save-Ping.php
+REQUEST_URI: /navigation/resources/save-ping.py

Modified: trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-same-origin.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-same-origin.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/ping-attribute/anchor-same-origin.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -24,6 +24,6 @@
 </script>
 </head>
 <body _onload_="test();">
-<img src="" _onload_="test();" _onerror_="test();"></img>
-<a id="a" href="" ping="../resources/save-Ping.php">Navigate and send ping</a>
+<img src="" _onload_="test();" _onerror_="test();"></img>
+<a id="a" href="" ping="../resources/save-ping.py">Navigate and send ping</a>
 </body></html>

Modified: trunk/LayoutTests/http/tests/navigation/ping-attribute/area-cookie-expected.txt (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/ping-attribute/area-cookie-expected.txt	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/ping-attribute/area-cookie-expected.txt	2021-04-08 21:27:43 UTC (rev 275677)
@@ -3,6 +3,6 @@
 HTTP_COOKIE: hello=world
 HTTP_HOST: 127.0.0.1:8000
 HTTP_PING_FROM: http://127.0.0.1:8000/navigation/ping-attribute/area-cookie.html
-HTTP_PING_TO: http://127.0.0.1:8000/navigation/resources/check-ping.php
+HTTP_PING_TO: http://127.0.0.1:8000/navigation/resources/check-ping.py
 REQUEST_METHOD: POST
-REQUEST_URI: /navigation/resources/save-Ping.php
+REQUEST_URI: /navigation/resources/save-ping.py

Modified: trunk/LayoutTests/http/tests/navigation/ping-attribute/area-cookie.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/ping-attribute/area-cookie.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/ping-attribute/area-cookie.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -24,7 +24,7 @@
 <body>
     <img src="" width="128" height="128" usemap=""
     <map name="imagemap">
-        <area shape="rect" coords="0,0,128,128" href="" ping="../resources/save-Ping.php">
+        <area shape="rect" coords="0,0,128,128" href="" ping="../resources/save-ping.py">
     </map>
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/navigation/ping-attribute/area-cross-origin-expected.txt (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/ping-attribute/area-cross-origin-expected.txt	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/ping-attribute/area-cross-origin-expected.txt	2021-04-08 21:27:43 UTC (rev 275677)
@@ -2,6 +2,6 @@
 CONTENT_TYPE: text/ping
 HTTP_HOST: localhost:8000
 HTTP_PING_FROM: http://127.0.0.1:8000/navigation/ping-attribute/area-cross-origin.html
-HTTP_PING_TO: http://127.0.0.1:8000/navigation/resources/check-ping.php
+HTTP_PING_TO: http://127.0.0.1:8000/navigation/resources/check-ping.py
 REQUEST_METHOD: POST
-REQUEST_URI: /navigation/resources/save-Ping.php
+REQUEST_URI: /navigation/resources/save-ping.py

Modified: trunk/LayoutTests/http/tests/navigation/ping-attribute/area-cross-origin-from-https-expected.txt (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/ping-attribute/area-cross-origin-from-https-expected.txt	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/ping-attribute/area-cross-origin-from-https-expected.txt	2021-04-08 21:27:43 UTC (rev 275677)
@@ -1,6 +1,6 @@
 Ping sent successfully
 CONTENT_TYPE: text/ping
 HTTP_HOST: localhost:8000
-HTTP_PING_TO: https://127.0.0.1:8443/navigation/resources/check-ping.php
+HTTP_PING_TO: https://127.0.0.1:8443/navigation/resources/check-ping.py
 REQUEST_METHOD: POST
-REQUEST_URI: /navigation/resources/save-Ping.php?test=/navigation/ping-attribute/area-cross-origin-from-https.html
+REQUEST_URI: /navigation/resources/save-ping.py?test=/navigation/ping-attribute/area-cross-origin-from-https.html

Modified: trunk/LayoutTests/http/tests/navigation/ping-attribute/area-cross-origin-from-https.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/ping-attribute/area-cross-origin-from-https.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/ping-attribute/area-cross-origin-from-https.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -26,7 +26,7 @@
 <body>
     <img src="" width="128" height="128" usemap=""
     <map name="imagemap">
-        <area shape="rect" coords="0,0,128,128" href="" ping="http://localhost:8000/navigation/resources/save-Ping.php?test=/navigation/ping-attribute/area-cross-origin-from-https.html">
+        <area shape="rect" coords="0,0,128,128" href="" ping="http://localhost:8000/navigation/resources/save-ping.py?test=/navigation/ping-attribute/area-cross-origin-from-https.html">
     </map>
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/navigation/ping-attribute/area-cross-origin.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/ping-attribute/area-cross-origin.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/ping-attribute/area-cross-origin.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -24,7 +24,7 @@
 <body>
     <img src="" width="128" height="128" usemap=""
     <map name="imagemap">
-        <area shape="rect" coords="0,0,128,128" href="" ping="http://localhost:8000/navigation/resources/save-Ping.php">
+        <area shape="rect" coords="0,0,128,128" href="" ping="http://localhost:8000/navigation/resources/save-ping.py">
     </map>
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/navigation/ping-attribute/area-same-origin-expected.txt (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/ping-attribute/area-same-origin-expected.txt	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/ping-attribute/area-same-origin-expected.txt	2021-04-08 21:27:43 UTC (rev 275677)
@@ -2,6 +2,6 @@
 CONTENT_TYPE: text/ping
 HTTP_HOST: 127.0.0.1:8000
 HTTP_PING_FROM: http://127.0.0.1:8000/navigation/ping-attribute/area-same-origin.html
-HTTP_PING_TO: http://127.0.0.1:8000/navigation/resources/check-ping.php
+HTTP_PING_TO: http://127.0.0.1:8000/navigation/resources/check-ping.py
 REQUEST_METHOD: POST
-REQUEST_URI: /navigation/resources/save-Ping.php
+REQUEST_URI: /navigation/resources/save-ping.py

Modified: trunk/LayoutTests/http/tests/navigation/ping-attribute/area-same-origin.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/ping-attribute/area-same-origin.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/ping-attribute/area-same-origin.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -23,7 +23,7 @@
 <body>
     <img src="" width="128" height="128" usemap=""
     <map name="imagemap">
-        <area shape="rect" coords="0,0,128,128" href="" ping="../resources/save-Ping.php">
+        <area shape="rect" coords="0,0,128,128" href="" ping="../resources/save-ping.py">
     </map>
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/navigation/ping-attribute/resources/utilities.js (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/ping-attribute/resources/utilities.js	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/ping-attribute/resources/utilities.js	2021-04-08 21:27:43 UTC (rev 275677)
@@ -26,7 +26,7 @@
     }
 
     var xhr = new XMLHttpRequest;
-    xhr.open("GET", "./resources/delete-ping.php", true /* async */);
+    xhr.open("GET", "../resources/delete-ping.py", true /* async */);
     xhr.send(null);
     xhr._onload_ = callback;
     xhr._onerror_ = done;

Modified: trunk/LayoutTests/http/tests/navigation/post-301-response.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/post-301-response.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/post-301-response.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -11,7 +11,7 @@
 </script>
 </head>
 <body _onload_="doTest()">
-<form id="form1" action="" method="post">
+<form id="form1" action="" method="post">
 <input type="text" name="text1" value="some text"><br>
 </form>
 </body>

Modified: trunk/LayoutTests/http/tests/navigation/post-302-response.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/post-302-response.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/post-302-response.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -11,7 +11,7 @@
 </script>
 </head>
 <body _onload_="doTest()">
-<form id="form1" action="" method="post">
+<form id="form1" action="" method="post">
 <input type="text" name="text1" value="some text"><br>
 </form>
 </body>

Modified: trunk/LayoutTests/http/tests/navigation/post-303-response.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/post-303-response.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/post-303-response.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -11,7 +11,7 @@
 </script>
 </head>
 <body _onload_="doTest()">
-<form id="form1" action="" method="post">
+<form id="form1" action="" method="post">
 <input type="text" name="text1" value="some text"><br>
 </form>
 </body>

Modified: trunk/LayoutTests/http/tests/navigation/post-307-response.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/post-307-response.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/post-307-response.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -11,7 +11,7 @@
 </script>
 </head>
 <body _onload_="doTest()">
-<form id="form1" action="" method="post">
+<form id="form1" action="" method="post">
 <input type="text" name="text1" value="some text"><br>
 </form>
 </body>

Modified: trunk/LayoutTests/http/tests/navigation/post-308-response.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/post-308-response.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/post-308-response.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -11,7 +11,7 @@
 </script>
 </head>
 <body _onload_="doTest()">
-<form id="form1" action="" method="post">
+<form id="form1" action="" method="post">
 <input type="text" name="text1" value="some text"><br>
 </form>
 </body>

Deleted: trunk/LayoutTests/http/tests/navigation/resources/check-ping.php (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/check-ping.php	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/resources/check-ping.php	2021-04-08 21:27:43 UTC (rev 275677)
@@ -1,24 +0,0 @@
-<?php
-require_once 'ping-file-path.php';
-
-while (!file_exists($pingFilePath)) {
-    usleep(10000);
-    // file_exists() caches results, we want to invalidate the cache.
-    clearstatcache();
-}
-
-echo "<html><body>\n";
-echo "Ping sent successfully";
-$pingFile = fopen($pingFilePath, 'r');
-while ($line = fgets($pingFile)) {
-    echo "<br>";
-    echo trim($line);
-}
-fclose($pingFile);
-unlink($pingFilePath);
-echo "<script>";
-echo "if (window.testRunner)";
-echo "    testRunner.notifyDone();";
-echo "</script>";
-echo "</body></html>";
-?>

Added: trunk/LayoutTests/http/tests/navigation/resources/check-ping.py (0 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/check-ping.py	                        (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/resources/check-ping.py	2021-04-08 21:27:43 UTC (rev 275677)
@@ -0,0 +1,32 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+import time
+from ping_file_path import ping_filepath
+
+sys.stdout.write('Content-Type: text/html\r\n\r\n')
+
+while not os.path.isfile(ping_filepath):
+    time.sleep(0.01)
+
+sys.stdout.write(
+    '<html><body>\n'
+    'Ping sent successfully'
+)
+
+ping_file = open(ping_filepath, 'r')
+for line in ping_file.readlines():
+    sys.stdout.write('<br>{}'.format(line.strip()))
+
+ping_file.close()
+if os.path.isfile(ping_filepath):
+    os.remove(ping_filepath)
+
+sys.stdout.write(
+    '<script>'
+    'if (window.testRunner)'
+    '    testRunner.notifyDone();'
+    '</script>'
+    '</body></html>'
+)
Property changes on: trunk/LayoutTests/http/tests/navigation/resources/check-ping.py
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Deleted: trunk/LayoutTests/http/tests/navigation/resources/delete-ping.php (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/delete-ping.php	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/resources/delete-ping.php	2021-04-08 21:27:43 UTC (rev 275677)
@@ -1,5 +0,0 @@
-<?php
-require_once 'ping-file-path.php';
-
-unlink($pingFilePath);
-?>

Added: trunk/LayoutTests/http/tests/navigation/resources/delete-ping.py (0 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/delete-ping.py	                        (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/resources/delete-ping.py	2021-04-08 21:27:43 UTC (rev 275677)
@@ -0,0 +1,10 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+from ping_file_path import ping_filepath
+
+sys.stdout.write('Content-Type: text/html\r\n\r\n')
+
+if os.path.isfile(ping_filepath):
+    os.remove(ping_filepath)
Property changes on: trunk/LayoutTests/http/tests/navigation/resources/delete-ping.py
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Modified: trunk/LayoutTests/http/tests/navigation/resources/image-load-in-pagehide-handler-2.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/image-load-in-pagehide-handler-2.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/resources/image-load-in-pagehide-handler-2.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -1,3 +1,3 @@
 <script>
-location.href = '';
+location.href = '';
 </script>

Modified: trunk/LayoutTests/http/tests/navigation/resources/image-load-in-unload-handler-2.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/image-load-in-unload-handler-2.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/resources/image-load-in-unload-handler-2.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -1,3 +1,3 @@
 <script>
-location.href = '';
+location.href = '';
 </script>

Deleted: trunk/LayoutTests/http/tests/navigation/resources/no-referrer-helper.php (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/no-referrer-helper.php	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/resources/no-referrer-helper.php	2021-04-08 21:27:43 UTC (rev 275677)
@@ -1,28 +0,0 @@
-<?php
-    // Prevent from being cached.
-    header("Cache-Control: no-store, private, max-age=0");
-    header("Content-Type: text/html");
-?>
-
-<html><body>
-<div id="console"></div>
-<div id="referrer">
-Referrer: <?php echo $_SERVER['HTTP_REFERER']; ?>
-</div>
-<br/>
-<script>
-function log(msg)
-{
-    var line = document.createElement('div');
-    line.appendChild(document.createTextNode(msg));
-    document.getElementById('console').appendChild(line);
-}
-
-    console.log(document.getElementById("referrer").innerText);
-    console.log("window.opener: " + (window.opener ? window.opener.location : ""));
-    
-    if (window.testRunner)
-        testRunner.notifyDone();
-</script>
-
-</body></html>

Added: trunk/LayoutTests/http/tests/navigation/resources/no-referrer-helper.py (0 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/no-referrer-helper.py	                        (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/resources/no-referrer-helper.py	2021-04-08 21:27:43 UTC (rev 275677)
@@ -0,0 +1,32 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+
+sys.stdout.write(
+    'Cache-Control: no-store, private, max-age=0\r\n'
+    'Content-Type: text/html\r\n\r\n'
+)
+
+print('''<html><body>
+<div id="console"></div>
+<div id="referrer">
+Referrer: {}
+</div>
+<br/>
+<script>
+function log(msg)
+{{
+    var line = document.createElement('div');
+    line.appendChild(document.createTextNode(msg));
+    document.getElementById('console').appendChild(line);
+}}
+
+    console.log(document.getElementById("referrer").innerText);
+    console.log("window.opener: " + (window.opener ? window.opener.location : ""));
+
+    if (window.testRunner)
+        testRunner.notifyDone();
+</script>
+
+</body></html>'''.format(os.environ.get('HTTP_REFERER', '')))
Property changes on: trunk/LayoutTests/http/tests/navigation/resources/no-referrer-helper.py
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Deleted: trunk/LayoutTests/http/tests/navigation/resources/no-referrer-reset-helper.php (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/no-referrer-reset-helper.php	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/resources/no-referrer-reset-helper.php	2021-04-08 21:27:43 UTC (rev 275677)
@@ -1,31 +0,0 @@
-<?php
-    // Prevent from being cached.
-    header("Cache-Control: no-store, private, max-age=0");
-    header("Content-Type: text/html");
-?>
-
-<html><body>
-<div id="referrer">
-Referrer: <?php echo $_SERVER['HTTP_REFERER']; ?>
-</div>
-<br/>
-<a id="noreferrer-link" href="" rel="noreferrer">Doesn't send referrer</a>
-<a id="referrer-link" href="" referrer</a>
-<script>
-    var consoleWindow = window.open("", "consoleWindow");
-    if (consoleWindow) {
-        consoleWindow.log(document.getElementById("referrer").innerText);
-        consoleWindow.log("window.opener: " + (window.opener ? window.opener.location : ""));
-    }
-
-    var target;
-    if (!consoleWindow.noreferrerStepDone) {
-        consoleWindow.noreferrerStepDone = true;
-        target = document.getElementById("noreferrer-link");
-    } else 
-        target = document.getElementById("referrer-link");
-    var newEvent = document.createEvent("MouseEvent");
-    newEvent.initMouseEvent("click", false, false, window, 0, 10, 10, 10, 10, false, false, false, false, 0, target);
-    target.dispatchEvent(newEvent);
-</script>
-</body></html>

Added: trunk/LayoutTests/http/tests/navigation/resources/no-referrer-reset-helper.py (0 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/no-referrer-reset-helper.py	                        (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/resources/no-referrer-reset-helper.py	2021-04-08 21:27:43 UTC (rev 275677)
@@ -0,0 +1,35 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+
+sys.stdout.write(
+    'Cache-Control: no-store, private, max-age=0\r\n'
+    'Content-Type: text/html\r\n\r\n'
+)
+
+print('''<html><body>
+<div id="referrer">
+Referrer: {}
+</div>
+<br/>
+<a id="noreferrer-link" href="" rel="noreferrer">Doesn't send referrer</a>
+<a id="referrer-link" href="" referrer</a>
+<script>
+    var consoleWindow = window.open("", "consoleWindow");
+    if (consoleWindow) {{
+        consoleWindow.log(document.getElementById("referrer").innerText);
+        consoleWindow.log("window.opener: " + (window.opener ? window.opener.location : ""));
+    }}
+
+    var target;
+    if (!consoleWindow.noreferrerStepDone) {{
+        consoleWindow.noreferrerStepDone = true;
+        target = document.getElementById("noreferrer-link");
+    }} else
+        target = document.getElementById("referrer-link");
+    var newEvent = document.createEvent("MouseEvent");
+    newEvent.initMouseEvent("click", false, false, window, 0, 10, 10, 10, 10, false, false, false, false, 0, target);
+    target.dispatchEvent(newEvent);
+</script>
+</body></html>'''.format(os.environ.get('HTTP_REFERER', '')))
Property changes on: trunk/LayoutTests/http/tests/navigation/resources/no-referrer-reset-helper.py
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Deleted: trunk/LayoutTests/http/tests/navigation/resources/no-referrer-same-window-helper.php (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/no-referrer-same-window-helper.php	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/resources/no-referrer-same-window-helper.php	2021-04-08 21:27:43 UTC (rev 275677)
@@ -1,19 +0,0 @@
-<?php
-    // Prevent from being cached.
-    header("Cache-Control: no-store, private, max-age=0");
-    header("Content-Type: text/html");
-?>
-
-<html><body>
-The Referrer displayed below should be empty.<br/>
-<div id="referrer">Referrer: <?php echo $_SERVER['HTTP_REFERER']; ?></div>
-<div id="console"></div>
-<script>
-    var line = document.createElement('div');
-    line.appendChild(document.createTextNode(document.getElementById("referrer").innerText == "Referrer:" ? "PASS" : "FAIL"));
-    document.getElementById('console').appendChild(line);
-    
-    if (window.testRunner)
-        testRunner.notifyDone();
-</script>
-</body></html>

Added: trunk/LayoutTests/http/tests/navigation/resources/no-referrer-same-window-helper.py (0 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/no-referrer-same-window-helper.py	                        (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/resources/no-referrer-same-window-helper.py	2021-04-08 21:27:43 UTC (rev 275677)
@@ -0,0 +1,23 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+
+sys.stdout.write(
+    'Cache-Control: no-store, private, max-age=0\r\n'
+    'Content-Type: text/html\r\n\r\n'
+)
+
+print('''<html><body>
+The Referrer displayed below should be empty.<br/>
+<div id="referrer">Referrer: {}</div>
+<div id="console"></div>
+<script>
+    var line = document.createElement('div');
+    line.appendChild(document.createTextNode(document.getElementById("referrer").innerText == "Referrer:" ? "PASS" : "FAIL"));
+    document.getElementById('console').appendChild(line);
+
+    if (window.testRunner)
+        testRunner.notifyDone();
+</script>
+</body></html>'''.format(os.environ.get('HTTP_REFERER', '')))
Property changes on: trunk/LayoutTests/http/tests/navigation/resources/no-referrer-same-window-helper.py
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Deleted: trunk/LayoutTests/http/tests/navigation/resources/ping-file-path.php (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/ping-file-path.php	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/resources/ping-file-path.php	2021-04-08 21:27:43 UTC (rev 275677)
@@ -1,16 +0,0 @@
-<?php
-require_once '../../resources/portabilityLayer.php';
-
-if (isset($_GET['test'])) {
-    $pingFilePath = sys_get_temp_dir() . "/" . str_replace("/", "-", $_GET['test']) . ".ping.txt"; 
-} elseif (isset($_SERVER["HTTP_REFERER"]) and strpos($_SERVER["HTTP_REFERER"], '/resources/') === false) {
-    $pingFilePath = sys_get_temp_dir() . "/" . str_replace("/", "-", parse_url($_SERVER["HTTP_REFERER"], PHP_URL_PATH)) . ".ping.txt"; 
-} elseif (isset($_SERVER["HTTP_PING_FROM"]) and strpos($_SERVER["HTTP_PING_FROM"], '/resources/') === false) {
-    $pingFilePath = sys_get_temp_dir() . "/" . str_replace("/", "-", parse_url($_SERVER["HTTP_PING_FROM"], PHP_URL_PATH)) . ".ping.txt"; 
-} else {
-    header("HTTP/1.1 500 Internal Server Error");
-    echo "This script needs to know the name of the test to form a unique temporary file path. It can get one either from HTTP referrer, or from a 'test' parameter.\n";
-    exit();
-}
-
-?>

Added: trunk/LayoutTests/http/tests/navigation/resources/ping_file_path.py (0 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/ping_file_path.py	                        (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/resources/ping_file_path.py	2021-04-08 21:27:43 UTC (rev 275677)
@@ -0,0 +1,24 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+import tempfile
+from urllib.parse import parse_qs, urlparse
+
+ping_from = os.environ.get('HTTP_PING_FROM', None)
+referer = os.environ.get('HTTP_REFERER', None)
+test = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True).get('test', [None])[0]
+
+if test is not None:
+    ping_filepath = os.path.join(tempfile.gettempdir(), '{}.ping.txt'.format(test.replace('/', '-')))
+elif referer is not None and '/resources/' not in referer:
+    ping_filepath = os.path.join(tempfile.gettempdir(), '{}.ping.txt'.format(urlparse(referer).path.replace('/', '-')))
+elif ping_from is not None and '/resources/' not in ping_from:
+    ping_filepath = os.path.join(tempfile.gettempdir(), '{}.ping.txt'.format(urlparse(ping_from).path.replace('/', '-')))
+else:
+    sys.stdout.write(
+        'status: 500\r\n'
+        'Content-Type: text/html\r\n\r\n'
+        'This script needs to know the name of the test to form a unique temporary file path. It can get one either from HTTP referrer, or from a \'test\' parameter.\n'
+    )
+    sys.exit(0)
Property changes on: trunk/LayoutTests/http/tests/navigation/resources/ping_file_path.py
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Deleted: trunk/LayoutTests/http/tests/navigation/resources/redirected-post-request-contents.php (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/redirected-post-request-contents.php	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/resources/redirected-post-request-contents.php	2021-04-08 21:27:43 UTC (rev 275677)
@@ -1,38 +0,0 @@
-<?php
-function checkHeader($header) {
-    if (array_key_exists($header, $_SERVER)) {
-        echo $header . " is present. Its value is: " . $_SERVER[$header] . "<br>";
-        return true;
-    }
-    return false;
-}
-
-if ($_GET["content"] == "true") {
-    echo "headers CONTENT_TYPE and CONTENT_LENGTH should be present.<br>";
-} else {
-    echo "headers CONTENT_TYPE and CONTENT_LENGTH should not be present.<br>";
-}
-
-$content_type = checkHeader("CONTENT_TYPE");
-$content_length = checkHeader("CONTENT_LENGTH");
-
-if (!$content_type && !$content_length) {
-    echo "headers CONTENT_TYPE and CONTENT_LENGTH are not present.<br>";
-}
-
-echo "<br>";
-
-if ($_GET["content"] == "true") {
-    echo "POST data should be present.<br>";
-} else {
-    echo "no POST data should be present.<br>";
-}
-
-if (sizeof($_POST) > 0 || sizeof($_FILES) > 0) {
-    echo "POST data is present.<br>";
-} else {
-    echo "no POST data is present.<br>";
-}
-
-echo "<script>if (window.testRunner) testRunner.notifyDone();</script>"
-?>

Added: trunk/LayoutTests/http/tests/navigation/resources/redirected-post-request-contents.py (0 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/redirected-post-request-contents.py	                        (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/resources/redirected-post-request-contents.py	2021-04-08 21:27:43 UTC (rev 275677)
@@ -0,0 +1,50 @@
+#!/usr/bin/env python3
+
+import cgi
+import os
+import sys
+from urllib.parse import parse_qs
+
+
+def check_header(header):
+    if header in os.environ.keys():
+        sys.stdout.write('{} is present. Its value is: {}<br>'.format(header, os.environ.get(header)))
+        return True
+    return False
+
+
+request_method = os.environ.get('REQUEST_METHOD', '')
+request = {}
+if request_method == 'POST':
+    form = cgi.FieldStorage()
+    for key in form.keys():
+        request[key] = form.getvalue(key)
+
+content = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True).get('content', [None])[0]
+
+sys.stdout.write('Content-Type: text/html\r\n\r\n')
+
+if content == 'true':
+    sys.stdout.write('headers CONTENT_TYPE and CONTENT_LENGTH should be present.<br>')
+else:
+    sys.stdout.write('headers CONTENT_TYPE and CONTENT_LENGTH should not be present.<br>')
+
+content_type = check_header('CONTENT_TYPE')
+content_length = check_header('CONTENT_LENGTH')
+
+if not content_type and not content_length:
+    sys.stdout.write('headers CONTENT_TYPE and CONTENT_LENGTH are not present.<br>')
+
+sys.stdout.write('<br>')
+
+if content == 'true':
+    sys.stdout.write('POST data should be present.<br>')
+else:
+    sys.stdout.write('no POST data should be present.<br>')
+
+if len(request) > 0:
+    sys.stdout.write('POST data is present.<br>')
+else:
+    sys.stdout.write('no POST data is present.<br>')
+
+sys.stdout.write('<script>if (window.testRunner) testRunner.notifyDone();</script>')
Property changes on: trunk/LayoutTests/http/tests/navigation/resources/redirected-post-request-contents.py
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Deleted: trunk/LayoutTests/http/tests/navigation/resources/redirection-response.php (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/redirection-response.php	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/resources/redirection-response.php	2021-04-08 21:27:43 UTC (rev 275677)
@@ -1,35 +0,0 @@
-<?php
-$status_code = $_GET['status'];
-
-$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . "/" . $_GET['target'];
-
-$host = $_SERVER['HTTP_HOST'];
-if (isset($_GET['host']))
-    $host = $_GET['host'];
-
-switch ($status_code) {
-    case 301:
-        header("HTTP/1.1 301 Moved Permanently");
-        header("Location: http://" . $host . $uri);
-        break;
-    case 302:
-        header("HTTP/1.1 302 Found");
-        header("Location: http://" . $host . $uri);
-        break;
-    case 303:
-        header("HTTP/1.1 303 See Other");
-        header("Location: http://" . $host . $uri);
-        break;
-    case 307:
-        header("HTTP/1.1 307 Temporary Redirect");
-        header("Location: http://" . $host . $uri);
-        break;
-    case 308:
-        header("HTTP/1.1 308 Permanent Redirect");
-        header("Location: http://" . $host . $uri);
-        break;
-    default:
-        header("HTTP/1.1 500 Internal Server Error");
-        echo "Unexpected status code ($status_code) received.";
-}
-?>

Added: trunk/LayoutTests/http/tests/navigation/resources/redirection-response.py (0 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/redirection-response.py	                        (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/resources/redirection-response.py	2021-04-08 21:27:43 UTC (rev 275677)
@@ -0,0 +1,28 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+from urllib.parse import parse_qs
+
+query = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True)
+status = int(query.get('status', [500])[0])
+target = query.get('target', [''])[0]
+
+uri = '{}/{}'.format('/'.join(os.environ.get('SCRIPT_URL', '').split('/')[:-1]), target)
+
+sys.stdout.write('Content-Type: text/html\r\n')
+
+host = os.environ.get('HTTP_HOST', '')
+if query.get('host', [None])[0] is not None:
+    host = query.get('host')[0]
+
+if status in [301, 302, 303, 307, 308]:
+    sys.stdout.write(
+        'status: {}\r\n'
+        'Location: http://{}{}\r\n\r\n'.format(status, host, uri)
+    )
+else:
+    sys.stdout.write(
+        'status: 500\r\n\r\n'
+        'Unexpected status code ({}) received.'.format(status)
+    )
Property changes on: trunk/LayoutTests/http/tests/navigation/resources/redirection-response.py
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Deleted: trunk/LayoutTests/http/tests/navigation/resources/save-Ping.php (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/save-Ping.php	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/resources/save-Ping.php	2021-04-08 21:27:43 UTC (rev 275677)
@@ -1,19 +0,0 @@
-<?php
-require_once 'ping-file-path.php';
-
-$pingFile = fopen($pingFilePath . ".tmp", 'w');
-$httpHeaders = $_SERVER;
-ksort($httpHeaders, SORT_STRING);
-foreach ($httpHeaders as $name => $value) {
-    if ($name === "CONTENT_TYPE" || $name === "HTTP_REFERER" || $name === "HTTP_PING_TO" || $name === "HTTP_PING_FROM"
-        || $name === "REQUEST_METHOD" || $name === "REQUEST_URI" || $name === "HTTP_HOST" || $name === "HTTP_COOKIE")
-        fwrite($pingFile, "$name: $value\n");
-}
-fclose($pingFile);
-rename($pingFilePath . ".tmp", $pingFilePath);
-
-if (!isset($DO_NOT_CLEAR_COOKIES) || !$DO_NOT_CLEAR_COOKIES) {
-    foreach ($_COOKIE as $name => $value)
-        setcookie($name, "deleted", time() - 60, "/");
-}
-?>

Deleted: trunk/LayoutTests/http/tests/navigation/resources/save-ping-and-redirect-to-save-ping.php (275676 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/save-ping-and-redirect-to-save-ping.php	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/navigation/resources/save-ping-and-redirect-to-save-ping.php	2021-04-08 21:27:43 UTC (rev 275677)
@@ -1,9 +0,0 @@
-<?php
-require_once 'ping-file-path.php';
-
-$DO_NOT_CLEAR_COOKIES = true; // Used by save-Ping.php
-require_once 'save-Ping.php';
-
-header('HTTP/1.1 307');
-header('Location: save-Ping.php' . (!empty($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : ''));
-?>

Added: trunk/LayoutTests/http/tests/navigation/resources/save-ping-and-redirect-to-save-ping.py (0 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/save-ping-and-redirect-to-save-ping.py	                        (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/resources/save-ping-and-redirect-to-save-ping.py	2021-04-08 21:27:43 UTC (rev 275677)
@@ -0,0 +1,16 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+from save_ping import save_ping
+
+query_string = os.environ.get('QUERY_STRING', '')
+if query_string != '':
+    query_string = '?{}'.format(query_string)
+
+sys.stdout.write(
+    'status: 307\r\n'
+    'Location: save-ping.py{}\r\n'.format(query_string)
+)
+
+save_ping(True)
Property changes on: trunk/LayoutTests/http/tests/navigation/resources/save-ping-and-redirect-to-save-ping.py
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Added: trunk/LayoutTests/http/tests/navigation/resources/save-ping.py (0 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/save-ping.py	                        (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/resources/save-ping.py	2021-04-08 21:27:43 UTC (rev 275677)
@@ -0,0 +1,4 @@
+#!/usr/bin/env python3
+
+from save_ping import save_ping
+save_ping(False)
Property changes on: trunk/LayoutTests/http/tests/navigation/resources/save-ping.py
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Added: trunk/LayoutTests/http/tests/navigation/resources/save_ping.py (0 => 275677)


--- trunk/LayoutTests/http/tests/navigation/resources/save_ping.py	                        (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/resources/save_ping.py	2021-04-08 21:27:43 UTC (rev 275677)
@@ -0,0 +1,39 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+from datetime import datetime, timedelta
+from ping_file_path import ping_filepath
+
+
+def not_being_called():
+    cookies = {}
+    expires = datetime.utcnow() - timedelta(seconds=60)
+    if 'HTTP_COOKIE' in os.environ:
+        header_cookies = os.environ['HTTP_COOKIE']
+        header_cookies = header_cookies.split('; ')
+
+        for cookie in header_cookies:
+            cookie = cookie.split('=')
+            sys.stdout.write('Set-Cookie: {}=deleted; expires={} GMT; Max-Age=0; path=/\r\n'.format(cookie[0], expires.strftime('%a, %d-%b-%Y %H:%M:%S')))
+
+
+def save_ping(is_being_called):
+    ping_file = open('{}.tmp'.format(ping_filepath), 'w')
+    for name in sorted(os.environ.keys()):
+        if name in ['CONTENT_TYPE', 'HTTP_REFERER', 'HTTP_PING_TO', 'HTTP_PING_FROM', 'REQUEST_METHOD', 'HTTP_HOST', 'HTTP_COOKIE']:
+            ping_file.write('{}: {}\n'.format(name, os.environ.get(name)))
+        elif name == 'REQUEST_URI':
+            uri = os.environ.get(name)
+            if is_being_called:
+                uri = '/navigation/resources/save-ping.py?{}'.format(uri.split('?')[-1])
+            ping_file.write('{}: {}\n'.format(name, uri))
+
+    ping_file.close()
+    if os.path.isfile('{}.tmp'.format(ping_filepath)):
+        os.rename('{}.tmp'.format(ping_filepath), ping_filepath)
+
+    if not is_being_called:
+        not_being_called()
+
+    sys.stdout.write('Content-Type: text/html\r\n\r\n')
Property changes on: trunk/LayoutTests/http/tests/navigation/resources/save_ping.py
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-redirect-blocked.html (275676 => 275677)


--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-redirect-blocked.html	2021-04-08 20:57:45 UTC (rev 275676)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-redirect-blocked.html	2021-04-08 21:27:43 UTC (rev 275677)
@@ -18,7 +18,7 @@
 </script>
 </head>
 <body>
-    <form id="form1" action="" method="post">
+    <form id="form1" action="" method="post">
         <input type='text' name='fieldname' value='fieldvalue'>
         <input type='submit' id='submit' value='submit'>
     </form>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to