Diff
Modified: trunk/LayoutTests/ChangeLog (274963 => 274964)
--- trunk/LayoutTests/ChangeLog 2021-03-24 19:48:30 UTC (rev 274963)
+++ trunk/LayoutTests/ChangeLog 2021-03-24 19:50:29 UTC (rev 274964)
@@ -1,5 +1,20 @@
2021-03-24 Chris Gambrell <cgambr...@apple.com>
+ [LayoutTests] Convert http/tests/performance convert PHP to Python
+ https://bugs.webkit.org/show_bug.cgi?id=223599
+ <rdar://problem/75707991>
+
+ Reviewed by Jonathan Bedard.
+
+ * http/tests/performance/paint-timing/performance-paint-timing-fcp-after-visually-non-empty-for-num-chars.html:
+ * http/tests/performance/paint-timing/performance-paint-timing-fcp-after-visually-non-empty-for-style.html:
+ * http/tests/performance/paint-timing/resources/slowscript.php: Removed.
+ * http/tests/performance/paint-timing/resources/slowscript.py: Added.
+ * http/tests/performance/paint-timing/resources/slowstyle.php: Removed.
+ * http/tests/performance/paint-timing/resources/slowstyle.py: Added.
+
+2021-03-24 Chris Gambrell <cgambr...@apple.com>
+
[LayoutTests] Convert http/tests/preload convert PHP to Python
https://bugs.webkit.org/show_bug.cgi?id=223602
<rdar://problem/75709989>
Modified: trunk/LayoutTests/http/tests/performance/paint-timing/performance-paint-timing-fcp-after-visually-non-empty-for-num-chars.html (274963 => 274964)
--- trunk/LayoutTests/http/tests/performance/paint-timing/performance-paint-timing-fcp-after-visually-non-empty-for-num-chars.html 2021-03-24 19:48:30 UTC (rev 274963)
+++ trunk/LayoutTests/http/tests/performance/paint-timing/performance-paint-timing-fcp-after-visually-non-empty-for-num-chars.html 2021-03-24 19:50:29 UTC (rev 274964)
@@ -20,7 +20,7 @@
function slowString(str, delay) {
const script = document.createElement('script')
const source = `document.write('${str}'); timestamps.push(${performance.now()}); check();`
- script.src = ""
+ script.src = ""
document.write(script.outerHTML)
}
Modified: trunk/LayoutTests/http/tests/performance/paint-timing/performance-paint-timing-fcp-after-visually-non-empty-for-style.html (274963 => 274964)
--- trunk/LayoutTests/http/tests/performance/paint-timing/performance-paint-timing-fcp-after-visually-non-empty-for-style.html 2021-03-24 19:48:30 UTC (rev 274963)
+++ trunk/LayoutTests/http/tests/performance/paint-timing/performance-paint-timing-fcp-after-visually-non-empty-for-style.html 2021-03-24 19:50:29 UTC (rev 274964)
@@ -17,7 +17,7 @@
if (paintEntries.length)
paintEntry = paintEntries[0];
- const resourceEntries = performance.getEntriesByType('resource').filter(r => r.name.includes('slowstyle.php'));
+ const resourceEntries = performance.getEntriesByType('resource').filter(r => r.name.includes('slowstyle.py'));
if (resourceEntries.length)
styleEntry = resourceEntries[0];
@@ -31,7 +31,7 @@
});
observer.observe({entryTypes: ["paint", "resource"]});
</script>
-<link rel="stylesheet" href="" />
+<link rel="stylesheet" href="" />
</head>
<body>
TEXT
Deleted: trunk/LayoutTests/http/tests/performance/paint-timing/resources/slowscript.php (274963 => 274964)
--- trunk/LayoutTests/http/tests/performance/paint-timing/resources/slowscript.php 2021-03-24 19:48:30 UTC (rev 274963)
+++ trunk/LayoutTests/http/tests/performance/paint-timing/resources/slowscript.php 2021-03-24 19:50:29 UTC (rev 274964)
@@ -1,9 +0,0 @@
-<?php
-if (isset($_GET["delay"]))
- sleep($_GET["delay"]);
-header('Cache-Control: no-cache, must-revalidate');
-header('Content-Type: text/_javascript_');
-
-echo($_GET["script"])
-?>
-
Added: trunk/LayoutTests/http/tests/performance/paint-timing/resources/slowscript.py (0 => 274964)
--- trunk/LayoutTests/http/tests/performance/paint-timing/resources/slowscript.py (rev 0)
+++ trunk/LayoutTests/http/tests/performance/paint-timing/resources/slowscript.py 2021-03-24 19:50:29 UTC (rev 274964)
@@ -0,0 +1,26 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+import time
+from urllib.parse import unquote
+
+query_string = os.environ.get('QUERY_STRING', '')
+query_arr = query_string.split('&')
+query = {}
+for part in query_arr:
+ part = part.split('=')
+ if len(part) > 1:
+ query[part[0]] = []
+ for sub_part in part[1:]:
+ query[part[0]].append(unquote(sub_part))
+
+delay = query.get('delay', [None])[0]
+script = query.get('script', [''])[0]
+
+if delay is not None:
+ time.sleep(float(delay))
+sys.stdout.write(
+ 'Cache-Control: no-cache, must-revalidate\r\n'
+ 'Content-Type: text/_javascript_\r\n\r\n{}'.format(script)
+)
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/performance/paint-timing/resources/slowscript.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Deleted: trunk/LayoutTests/http/tests/performance/paint-timing/resources/slowstyle.php (274963 => 274964)
--- trunk/LayoutTests/http/tests/performance/paint-timing/resources/slowstyle.php 2021-03-24 19:48:30 UTC (rev 274963)
+++ trunk/LayoutTests/http/tests/performance/paint-timing/resources/slowstyle.php 2021-03-24 19:50:29 UTC (rev 274964)
@@ -1,6 +0,0 @@
-<?php
-if (isset($_GET["delay"]))
- sleep($_GET["delay"]);
-header('Cache-Control: no-cache, must-revalidate');
-header('Location: style.css');
-?>
Added: trunk/LayoutTests/http/tests/performance/paint-timing/resources/slowstyle.py (0 => 274964)
--- trunk/LayoutTests/http/tests/performance/paint-timing/resources/slowstyle.py (rev 0)
+++ trunk/LayoutTests/http/tests/performance/paint-timing/resources/slowstyle.py 2021-03-24 19:50:29 UTC (rev 274964)
@@ -0,0 +1,17 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+import time
+from urllib.parse import parse_qs
+
+delay = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True).get('delay', [None])[0]
+
+if delay is not None:
+ time.sleep(float(delay))
+sys.stdout.write(
+ 'status: 302\r\n'
+ 'Cache-Control: no-cache, must-revalidate\r\n'
+ 'Location: style.css\r\n'
+ 'Content-Type: text/html\r\n\r\n'
+)
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/performance/paint-timing/resources/slowstyle.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property