Title: [273782] trunk/LayoutTests
Revision
273782
Author
cgambr...@apple.com
Date
2021-03-02 18:23:46 -0800 (Tue, 02 Mar 2021)

Log Message

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

Reviewed by Jonathan Bedard.

* http/tests/history/popstate-fires-with-pending-requests.html:
* http/tests/history/replacestate-post-to-get-2.html:
* http/tests/history/replacestate-post-to-get.html:
* http/tests/history/resources/replacestate-current.php: Removed.
* http/tests/history/resources/replacestate-current.py: Added.
* http/tests/history/resources/replacestate-forward-back.php: Removed.
* http/tests/history/resources/replacestate-forward-back.py: Added.
* http/tests/history/resources/slow-image.php: Removed.
* http/tests/history/resources/slow-image.py: Added.
* http/tests/inspector/page/resources/slow-test-page.html:
* http/tests/navigation/page-cache-pending-image-load-cache-partition.html:
* http/tests/navigation/page-cache-pending-image-load.html:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (273781 => 273782)


--- trunk/LayoutTests/ChangeLog	2021-03-03 02:20:51 UTC (rev 273781)
+++ trunk/LayoutTests/ChangeLog	2021-03-03 02:23:46 UTC (rev 273782)
@@ -1,5 +1,26 @@
 2021-03-02  Chris Gambrell  <cgambr...@apple.com>
 
+        [LayoutTests] Convert http/tests/history convert PHP to Python
+        https://bugs.webkit.org/show_bug.cgi?id=222614
+        <rdar://problem/74946423>
+
+        Reviewed by Jonathan Bedard.
+
+        * http/tests/history/popstate-fires-with-pending-requests.html:
+        * http/tests/history/replacestate-post-to-get-2.html:
+        * http/tests/history/replacestate-post-to-get.html:
+        * http/tests/history/resources/replacestate-current.php: Removed.
+        * http/tests/history/resources/replacestate-current.py: Added.
+        * http/tests/history/resources/replacestate-forward-back.php: Removed.
+        * http/tests/history/resources/replacestate-forward-back.py: Added.
+        * http/tests/history/resources/slow-image.php: Removed.
+        * http/tests/history/resources/slow-image.py: Added.
+        * http/tests/inspector/page/resources/slow-test-page.html:
+        * http/tests/navigation/page-cache-pending-image-load-cache-partition.html:
+        * http/tests/navigation/page-cache-pending-image-load.html:
+
+2021-03-02  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>

Modified: trunk/LayoutTests/http/tests/history/popstate-fires-with-pending-requests.html (273781 => 273782)


--- trunk/LayoutTests/http/tests/history/popstate-fires-with-pending-requests.html	2021-03-03 02:20:51 UTC (rev 273781)
+++ trunk/LayoutTests/http/tests/history/popstate-fires-with-pending-requests.html	2021-03-03 02:23:46 UTC (rev 273782)
@@ -15,7 +15,7 @@
     debug('Starting slow image request');
       
     var slowImage = document.createElement('img');
-    slowImage.src = '';
+    slowImage.src = '';
     document.body.appendChild(slowImage);
     
     debug('Pushing newState1');

Modified: trunk/LayoutTests/http/tests/history/replacestate-post-to-get-2.html (273781 => 273782)


--- trunk/LayoutTests/http/tests/history/replacestate-post-to-get-2.html	2021-03-03 02:20:51 UTC (rev 273781)
+++ trunk/LayoutTests/http/tests/history/replacestate-post-to-get-2.html	2021-03-03 02:23:46 UTC (rev 273782)
@@ -20,7 +20,7 @@
 </script>
 </head>
 <body _onload_="test()">
-<form id="testForm" action="" method="POST">
+<form id="testForm" action="" method="POST">
 </form>
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/history/replacestate-post-to-get.html (273781 => 273782)


--- trunk/LayoutTests/http/tests/history/replacestate-post-to-get.html	2021-03-03 02:20:51 UTC (rev 273781)
+++ trunk/LayoutTests/http/tests/history/replacestate-post-to-get.html	2021-03-03 02:23:46 UTC (rev 273782)
@@ -14,7 +14,7 @@
 </script>
 </head>
 <body _onload_="test()">
-<form id="testForm" action="" method="POST">
+<form id="testForm" action="" method="POST">
 </form>
 </body>
 </html>

Deleted: trunk/LayoutTests/http/tests/history/resources/replacestate-current.php (273781 => 273782)


--- trunk/LayoutTests/http/tests/history/resources/replacestate-current.php	2021-03-03 02:20:51 UTC (rev 273781)
+++ trunk/LayoutTests/http/tests/history/resources/replacestate-current.php	2021-03-03 02:23:46 UTC (rev 273782)
@@ -1,33 +0,0 @@
-<html>
-<head>
-<script>
-function test()
-{
-    if (sessionStorage["state"] != 1) {
-        sessionStorage["state"] = 1;
-        history.replaceState("new state", "new title");
-        history.go(0);
-    } else {
-        sessionStorage.removeItem("state");
-        if (window.testRunner)
-            testRunner.notifyDone();
-    }
-}
-</script>
-</head>
-<body _onload_="test()">
-<p>
-If the current entry in the session history represents a non-GET request
-(e.g. it was the result of a POST submission) then update it to instead
-represent a GET request (or equivalent).
-</p>
-<p>
-This test checks that this works when reloading the page using history.go(0).
-</p>
-<p>
-This test passes if this page is eventually loaded with a GET request.
-</p>
-<p>
-This page was loaded with a <?php echo $_SERVER['REQUEST_METHOD'] ?> request.
-</p>
-</body>

Added: trunk/LayoutTests/http/tests/history/resources/replacestate-current.py (0 => 273782)


--- trunk/LayoutTests/http/tests/history/resources/replacestate-current.py	                        (rev 0)
+++ trunk/LayoutTests/http/tests/history/resources/replacestate-current.py	2021-03-03 02:23:46 UTC (rev 273782)
@@ -0,0 +1,43 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+
+method = os.environ.get('REQUEST_METHOD', '')
+
+sys.stdout.write(
+    'Content-Type: text/html\r\n\r\n'
+    '<html>\n'
+    '<head>\n'
+    '<script>\n'
+    'function test()\n'
+    '{{\n'
+    '    if (sessionStorage["state"] != 1) {{\n'
+    '        sessionStorage["state"] = 1;\n'
+    '        history.replaceState("new state", "new title");\n'
+    '        history.go(0);\n'
+    '    }} else {{\n'
+    '        sessionStorage.removeItem("state");\n'
+    '        if (window.testRunner)\n'
+    '            testRunner.notifyDone();\n'
+    '    }}\n'
+    '}}\n'
+    '</script>\n'
+    '</head>\n'
+    '<body _onload_="test()">\n'
+    '<p>\n'
+    'If the current entry in the session history represents a non-GET request\n'
+    '(e.g. it was the result of a POST submission) then update it to instead\n'
+    'represent a GET request (or equivalent).\n'
+    '</p>\n'
+    '<p>\n'
+    'This test checks that this works when reloading the page using history.go(0).\n'
+    '</p>\n'
+    '<p>\n'
+    'This test passes if this page is eventually loaded with a GET request.\n'
+    '</p>\n'
+    '<p>\n'
+    'This page was loaded with a {} request.\n'
+    '</p>\n'
+    '</body>\n'.format(method)
+)
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/history/resources/replacestate-current.py
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Deleted: trunk/LayoutTests/http/tests/history/resources/replacestate-forward-back.php (273781 => 273782)


--- trunk/LayoutTests/http/tests/history/resources/replacestate-forward-back.php	2021-03-03 02:20:51 UTC (rev 273781)
+++ trunk/LayoutTests/http/tests/history/resources/replacestate-forward-back.php	2021-03-03 02:23:46 UTC (rev 273782)
@@ -1,33 +0,0 @@
-<html>
-<head>
-<script>
-function test()
-{
-    if (sessionStorage["state"] != 1) {
-        sessionStorage["state"] = 1;
-        history.replaceState("new state", "new title");
-        history.go(-1);
-    } else {
-        sessionStorage.removeItem("state");
-        if (window.testRunner)
-            testRunner.notifyDone();
-    }
-}
-</script>
-</head>
-<body _onload_="test()">
-<p>
-If the current entry in the session history represents a non-GET request
-(e.g. it was the result of a POST submission) then update it to instead
-represent a GET request (or equivalent).
-</p>
-<p>
-This test checks that this works when navigation back and forward again.
-</p>
-<p>
-This test passes if this page is eventually loaded with a GET request.
-</p>
-<p>
-This page was loaded with a <?php echo $_SERVER['REQUEST_METHOD'] ?> request.
-</p>
-</body>

Added: trunk/LayoutTests/http/tests/history/resources/replacestate-forward-back.py (0 => 273782)


--- trunk/LayoutTests/http/tests/history/resources/replacestate-forward-back.py	                        (rev 0)
+++ trunk/LayoutTests/http/tests/history/resources/replacestate-forward-back.py	2021-03-03 02:23:46 UTC (rev 273782)
@@ -0,0 +1,43 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+
+method = os.environ.get('REQUEST_METHOD', '')
+
+sys.stdout.write(
+    'Content-Type: text/html\r\n\r\n'
+    '<html>\n'
+    '<head>\n'
+    '<script>\n'
+    'function test()\n'
+    '{{\n'
+    '    if (sessionStorage["state"] != 1) {{\n'
+    '        sessionStorage["state"] = 1;\n'
+    '        history.replaceState("new state", "new title");\n'
+    '        history.go(-1);\n'
+    '    }} else {{\n'
+    '        sessionStorage.removeItem("state");\n'
+    '        if (window.testRunner)\n'
+    '            testRunner.notifyDone();\n'
+    '    }}\n'
+    '}}\n'
+    '</script>\n'
+    '</head>\n'
+    '<body _onload_="test()">\n'
+    '<p>\n'
+    'If the current entry in the session history represents a non-GET request\n'
+    '(e.g. it was the result of a POST submission) then update it to instead\n'
+    'represent a GET request (or equivalent).\n'
+    '</p>\n'
+    '<p>\n'
+    'This test checks that this works when navigation back and forward again.\n'
+    '</p>\n'
+    '<p>\n'
+    'This test passes if this page is eventually loaded with a GET request.\n'
+    '</p>\n'
+    '<p>\n'
+    'This page was loaded with a {} request.\n'
+    '</p>\n'
+    '</body>\n'.format(method)
+)
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/history/resources/replacestate-forward-back.py
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Deleted: trunk/LayoutTests/http/tests/history/resources/slow-image.php (273781 => 273782)


--- trunk/LayoutTests/http/tests/history/resources/slow-image.php	2021-03-03 02:20:51 UTC (rev 273781)
+++ trunk/LayoutTests/http/tests/history/resources/slow-image.php	2021-03-03 02:23:46 UTC (rev 273782)
@@ -1,4 +0,0 @@
-<?php
-sleep(30);
-header('Location: data:image/gif;base64,R0lGODlhAQABAJAAAMjIyAAAACwAAAAAAQABAAACAgQBADs%3D')
-?>

Added: trunk/LayoutTests/http/tests/history/resources/slow-image.py (0 => 273782)


--- trunk/LayoutTests/http/tests/history/resources/slow-image.py	                        (rev 0)
+++ trunk/LayoutTests/http/tests/history/resources/slow-image.py	2021-03-03 02:23:46 UTC (rev 273782)
@@ -0,0 +1,12 @@
+#!/usr/bin/env python3
+
+import sys
+import time
+
+time.sleep(30)
+
+sys.stdout.write(
+    'Location: data:image/gif;base64,R0lGODlhAQABAJAAAMjIyAAAACwAAAAAAQABAAACAgQBADs%3D\r\n'
+    'status: 200\r\n'
+    'Content-Type: text/html\r\n\r\n'
+)
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/history/resources/slow-image.py
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Modified: trunk/LayoutTests/http/tests/inspector/page/resources/slow-test-page.html (273781 => 273782)


--- trunk/LayoutTests/http/tests/inspector/page/resources/slow-test-page.html	2021-03-03 02:20:51 UTC (rev 273781)
+++ trunk/LayoutTests/http/tests/inspector/page/resources/slow-test-page.html	2021-03-03 02:23:46 UTC (rev 273782)
@@ -8,6 +8,6 @@
 </head>
 <body>
 	<!-- Delay the onload event using a slow image -->
-	<img src="" />
+	<img src="" />
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/navigation/page-cache-pending-image-load-cache-partition.html (273781 => 273782)


--- trunk/LayoutTests/http/tests/navigation/page-cache-pending-image-load-cache-partition.html	2021-03-03 02:20:51 UTC (rev 273781)
+++ trunk/LayoutTests/http/tests/navigation/page-cache-pending-image-load-cache-partition.html	2021-03-03 02:23:46 UTC (rev 273782)
@@ -31,7 +31,7 @@
     setTimeout(function() {
         // Slow loading image.
         var slowImage = new Image();
-        slowImage.src = ""
+        slowImage.src = ""
         document.body.appendChild(slowImage);
     }, 0);
 

Modified: trunk/LayoutTests/http/tests/navigation/page-cache-pending-image-load.html (273781 => 273782)


--- trunk/LayoutTests/http/tests/navigation/page-cache-pending-image-load.html	2021-03-03 02:20:51 UTC (rev 273781)
+++ trunk/LayoutTests/http/tests/navigation/page-cache-pending-image-load.html	2021-03-03 02:23:46 UTC (rev 273782)
@@ -30,7 +30,7 @@
     setTimeout(function() {
         // Slow loading image.
         var slowImage = new Image();
-        slowImage.src = ""
+        slowImage.src = ""
         document.body.appendChild(slowImage);
     }, 0);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to