Diff
Modified: trunk/LayoutTests/ChangeLog (274802 => 274803)
--- trunk/LayoutTests/ChangeLog 2021-03-22 21:47:51 UTC (rev 274802)
+++ trunk/LayoutTests/ChangeLog 2021-03-22 21:54:29 UTC (rev 274803)
@@ -1,5 +1,32 @@
2021-03-22 Chris Gambrell <[email protected]>
+ [LayoutTests] Convert http/tests/multipart convert PHP to Python
+ https://bugs.webkit.org/show_bug.cgi?id=223475
+ <rdar://problem/75587716>
+
+ Reviewed by Jonathan Bedard.
+
+ * TestExpectations:
+ * http/tests/multipart/load-last-non-html-frame.php: Removed.
+ * http/tests/multipart/load-last-non-html-frame.py: Added.
+ * http/tests/multipart/multipart-html.php: Removed.
+ * http/tests/multipart/multipart-html.py: Added.
+ * http/tests/multipart/multipart-replace-non-html-content.php: Removed.
+ * http/tests/multipart/multipart-replace-non-html-content.py: Added.
+ * http/tests/multipart/multipart-wait-before-boundary.html:
+ * http/tests/multipart/policy-ignore-crash.php: Removed.
+ * http/tests/multipart/policy-ignore-crash.py: Added.
+ * http/tests/multipart/resources/multipart-nodashes.php: Removed.
+ * http/tests/multipart/resources/multipart-nodashes.py: Added.
+ * http/tests/multipart/resources/multipart-wait-before-boundary.php: Removed.
+ * http/tests/multipart/resources/multipart-wait-before-boundary.py: Added.
+ (sendHeader):
+ * http/tests/multipart/win-boundary-crash.html:
+ * platform/ios/TestExpectations:
+ * platform/win/TestExpectations:
+
+2021-03-22 Chris Gambrell <[email protected]>
+
[LayoutTests] Convert http/tests/privateClickMeasurement convert PHP to Python
https://bugs.webkit.org/show_bug.cgi?id=223575
<rdar://problem/75691545>
Modified: trunk/LayoutTests/TestExpectations (274802 => 274803)
--- trunk/LayoutTests/TestExpectations 2021-03-22 21:47:51 UTC (rev 274802)
+++ trunk/LayoutTests/TestExpectations 2021-03-22 21:54:29 UTC (rev 274803)
@@ -2756,7 +2756,7 @@
webkit.org/b/172378 fast/loader/recursive-before-unload-crash.html [ Skip ]
webkit.org/b/172378 fast/repaint/table-hover-on-link.html [ Skip ]
webkit.org/b/172378 http/tests/misc/slow-loading-mask.html [ Skip ]
-webkit.org/b/172378 http/tests/multipart/policy-ignore-crash.php [ Skip ]
+webkit.org/b/172378 http/tests/multipart/policy-ignore-crash.py [ Skip ]
webkit.org/b/172378 http/tests/navigation/back-twice-without-commit.html [ Skip ]
webkit.org/b/172378 imported/blink/fast/block/float/float-mark-descendants-for-layout-crash.html [ Skip ]
webkit.org/b/172378 imported/blink/fast/frames/freed-frame.html [ Skip ]
Deleted: trunk/LayoutTests/http/tests/multipart/load-last-non-html-frame.php (274802 => 274803)
--- trunk/LayoutTests/http/tests/multipart/load-last-non-html-frame.php 2021-03-22 21:47:51 UTC (rev 274802)
+++ trunk/LayoutTests/http/tests/multipart/load-last-non-html-frame.php 2021-03-22 21:54:29 UTC (rev 274803)
@@ -1,22 +0,0 @@
-<?php
-header('Content-type: multipart/x-mixed-replace;boundary=asdf');
-?>--asdf
-Content-type: text/plain
-
-This test passes if the last multipart frame is displayed.
-FAIL
-
-<?php
-# Add some padding because CFNetwork merges small multipart segments together.
-echo str_pad('', 5000);
-echo "\r\n";
-?>--asdf
-Content-type: text/plain
-
-This test passes if the last multipart frame is displayed.
-PASS
-<?php
-# Add some padding because CFNetwork merges small multipart segments together.
-echo str_pad('', 5000);
-echo "\r\n";
-?>--asdf--
Added: trunk/LayoutTests/http/tests/multipart/load-last-non-html-frame.py (0 => 274803)
--- trunk/LayoutTests/http/tests/multipart/load-last-non-html-frame.py (rev 0)
+++ trunk/LayoutTests/http/tests/multipart/load-last-non-html-frame.py 2021-03-22 21:54:29 UTC (rev 274803)
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+
+import sys
+
+sys.stdout.write(
+ 'Content-type: multipart/x-mixed-replace;boundary=asdf\r\n\r\n'
+ '--asdf\n'
+ 'Content-type: text/plain\n'
+ '\n'
+ 'This test passes if the last multipart frame is displayed.\n'
+ 'FAIL\n'
+ '\n'
+ '{padding}\r\n'
+ '--asdf\n'
+ 'Content-type: text/plain\n'
+ '\n'
+ 'This test passes if the last multipart frame is displayed.\n'
+ 'PASS\n'
+ '{padding}\r\n'
+ '--asdf--\n'.format(padding=' ' * 5000)
+)
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/multipart/load-last-non-html-frame.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Deleted: trunk/LayoutTests/http/tests/multipart/multipart-html.php (274802 => 274803)
--- trunk/LayoutTests/http/tests/multipart/multipart-html.php 2021-03-22 21:47:51 UTC (rev 274802)
+++ trunk/LayoutTests/http/tests/multipart/multipart-html.php 2021-03-22 21:54:29 UTC (rev 274803)
@@ -1,32 +0,0 @@
-<?php
-header('Content-type: multipart/x-mixed-replace; boundary=boundary');
-header('Connection: keep-alive');
-echo "--boundary\r\n";
-echo "Content-Type: text/html\r\n\r\n";
-echo str_pad('', 5000);
-?>
-
-<script>
-if (window.testRunner) {
- testRunner.dumpAsText();
- if (testRunner.setShouldDecideResponsePolicyAfterDelay)
- testRunner.setShouldDecideResponsePolicyAfterDelay(true);
-}
-</script>
-
-<?php
-for ($i = 0; $i <= 10; $i++) {
- echo "--boundary\r\n";
- echo "Content-Type: text/html\r\n\r\n";
- if ($i < 10) {
- echo "This is message {$i}.<br>";
- echo "FAIL: The message number should be 10.";
- } else {
- echo "PASS: This is message {$i}.";
- }
- echo str_pad('', 5000);
- echo "\r\n\r\n";
- flush();
- usleep(100000);
-}
-?>
\ No newline at end of file
Added: trunk/LayoutTests/http/tests/multipart/multipart-html.py (0 => 274803)
--- trunk/LayoutTests/http/tests/multipart/multipart-html.py (rev 0)
+++ trunk/LayoutTests/http/tests/multipart/multipart-html.py 2021-03-22 21:54:29 UTC (rev 274803)
@@ -0,0 +1,40 @@
+#!/usr/bin/env python3
+
+import sys
+import time
+
+padding = ' ' * 5000
+
+sys.stdout.write(
+ 'Connection: keep-alive\r\n'
+ 'Content-type: multipart/x-mixed-replace; boundary=boundary\r\n\r\n'
+ '--boundary\r\n'
+ 'Content-Type: text/html\r\n\r\n'
+ f'{padding}\n'
+ '\n'
+ '<script>\n'
+ 'if (window.testRunner) {\n'
+ ' testRunner.dumpAsText();\n'
+ ' if (testRunner.setShouldDecideResponsePolicyAfterDelay)\n'
+ ' testRunner.setShouldDecideResponsePolicyAfterDelay(true);\n'
+ '}\n'
+ '</script>\n\n'
+)
+
+for i in range(0, 11):
+ sys.stdout.write(
+ '--boundary\r\n'
+ 'Content-Type: text/html\r\n\r\n'
+ )
+
+ if i < 10:
+ sys.stdout.write(
+ 'This is message {}.<br>'
+ 'FAIL: The message number should be 10.'.format(i)
+ )
+ else:
+ sys.stdout.write('PASS: This is message {}.'.format(i))
+
+ sys.stdout.write('{}\r\n\r\n'.format(padding))
+ sys.stdout.flush()
+ time.sleep(0.1)
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/multipart/multipart-html.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Deleted: trunk/LayoutTests/http/tests/multipart/multipart-replace-non-html-content.php (274802 => 274803)
--- trunk/LayoutTests/http/tests/multipart/multipart-replace-non-html-content.php 2021-03-22 21:47:51 UTC (rev 274802)
+++ trunk/LayoutTests/http/tests/multipart/multipart-replace-non-html-content.php 2021-03-22 21:54:29 UTC (rev 274803)
@@ -1,25 +0,0 @@
-<?php
-header('Content-type: multipart/x-mixed-replace; boundary=boundary');
-header('Connection: keep-alive');
-echo "--boundary\r\n";
-echo "Content-Type: text/html\r\n\r\n";
-echo str_pad('', 5000);
-?>
-
-<script>
-if (window.testRunner)
- testRunner.dumpAsText();
-</script>
-
-<?php
-for ($i = 0; $i <= 10; $i++) {
- echo "\r\n--boundary\r\n";
- echo "Content-Type: text/plain\r\n\r\n";
- echo "This text should only appear once ";
- echo $i;
- echo str_pad('', 5000);
- flush();
- usleep(100000);
-}
-echo "\r\n\r\n\r\n--boundary--\r\n";
-?>
Added: trunk/LayoutTests/http/tests/multipart/multipart-replace-non-html-content.py (0 => 274803)
--- trunk/LayoutTests/http/tests/multipart/multipart-replace-non-html-content.py (rev 0)
+++ trunk/LayoutTests/http/tests/multipart/multipart-replace-non-html-content.py 2021-03-22 21:54:29 UTC (rev 274803)
@@ -0,0 +1,31 @@
+#!/usr/bin/env python3
+
+import sys
+import time
+
+padding = ' ' * 5000
+
+sys.stdout.write(
+ 'Connection: keep-alive\r\n'
+ 'Content-type: multipart/x-mixed-replace; boundary=boundary\r\n\r\n'
+ '--boundary\r\n'
+ 'Content-Type: text/html\r\n\r\n'
+ f'{padding}\n'
+ '\n'
+ '<script>\n'
+ 'if (window.testRunner)\n'
+ ' testRunner.dumpAsText();\n'
+ '</script>\n\n'
+)
+
+for i in range(0, 11):
+ sys.stdout.write(
+ '\r\n--boundary\r\n'
+ 'Content-Type: text/plain\r\n\r\n'
+ 'This text should only appear once {}'
+ '{}'.format(i, padding)
+ )
+ sys.stdout.flush()
+ time.sleep(0.1)
+
+sys.stdout.write('\r\n\r\n\r\n--boundary--\r\n')
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/multipart/multipart-replace-non-html-content.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Modified: trunk/LayoutTests/http/tests/multipart/multipart-wait-before-boundary.html (274802 => 274803)
--- trunk/LayoutTests/http/tests/multipart/multipart-wait-before-boundary.html 2021-03-22 21:47:51 UTC (rev 274802)
+++ trunk/LayoutTests/http/tests/multipart/multipart-wait-before-boundary.html 2021-03-22 21:54:29 UTC (rev 274803)
@@ -6,7 +6,7 @@
testRunner.waitUntilDone();
}
function childLoaded() {
- setTimeout("window.frames['iframe'].location = 'resources/multipart-wait-before-boundary.php?done=1'", 0);
+ setTimeout("window.frames['iframe'].location = 'resources/multipart-wait-before-boundary.py?done=1'", 0);
}
function success() {
if (window.testRunner) {
@@ -18,6 +18,6 @@
</head>
<body>
<p id="status">RUNNING...</p>
- <iframe id="iframe" name="iframe" src=""
+ <iframe id="iframe" name="iframe" src=""
</body>
</html>
Deleted: trunk/LayoutTests/http/tests/multipart/policy-ignore-crash.php (274802 => 274803)
--- trunk/LayoutTests/http/tests/multipart/policy-ignore-crash.php 2021-03-22 21:47:51 UTC (rev 274802)
+++ trunk/LayoutTests/http/tests/multipart/policy-ignore-crash.php 2021-03-22 21:54:29 UTC (rev 274803)
@@ -1,29 +0,0 @@
-<?php
-header('Content-type: multipart/x-mixed-replace;boundary=asdf');
-?>--asdf
-Content-type: text/html
-
-<p>This test passes if it does not crash.</p>
-<script>
-if (window.testRunner)
- testRunner.dumpAsText();
-</script>
-
-<?php
-# Add some padding because CFNetwork merges small multipart segments together.
-echo str_pad('', 5000);
-echo "\r\n";
-
-ob_flush();
-flush();
-?>--asdf
-Content-type: text/rtf
-
-This chunk has an unsupported text mime type, which can cause the policy
-for this load to be ignored. This causes the request to be canceled.
-
-<?php
-# Add some padding because CFNetwork merges small multipart segments together.
-echo str_pad('', 5000);
-echo "\r\n";
-?>--asdf--
Added: trunk/LayoutTests/http/tests/multipart/policy-ignore-crash.py (0 => 274803)
--- trunk/LayoutTests/http/tests/multipart/policy-ignore-crash.py (rev 0)
+++ trunk/LayoutTests/http/tests/multipart/policy-ignore-crash.py 2021-03-22 21:54:29 UTC (rev 274803)
@@ -0,0 +1,29 @@
+#!/usr/bin/env python3
+
+import sys
+
+sys.stdout.write(
+ 'Content-Type: multipart/x-mixed-replace;boundary=asdf\r\n\r\n'
+ '--asdf\n'
+ 'Content-type: text/html\n'
+ '\n'
+ '<p>This test passes if it does not crash.</p>\n'
+ '<script>\n'
+ 'if (window.testRunner)\n'
+ ' testRunner.dumpAsText();\n'
+ '</script>\n'
+ '{}\r\n'.format(' ' * 5000)
+)
+
+sys.stdout.flush()
+
+sys.stdout.write(
+ '--asdf\n'
+ 'Content-type: text/rtf\n'
+ '\n'
+ 'This chunk has an unsupported text mime type, which can cause the policy\n'
+ 'for this load to be ignored. This causes the request to be canceled.\n'
+ '\n'
+ '{}\r\n'
+ '--asdf--\n'.format(' ' * 5000)
+)
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/multipart/policy-ignore-crash.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Deleted: trunk/LayoutTests/http/tests/multipart/resources/multipart-nodashes.php (274802 => 274803)
--- trunk/LayoutTests/http/tests/multipart/resources/multipart-nodashes.php 2021-03-22 21:47:51 UTC (rev 274802)
+++ trunk/LayoutTests/http/tests/multipart/resources/multipart-nodashes.php 2021-03-22 21:54:29 UTC (rev 274803)
@@ -1,10 +0,0 @@
-<?php
- # Generates a multipart/x-mixed-replace response but doesn't
- # include the -- before the boundary.
-
- $boundary = "cutHere";
- header("Content-Type: multipart/x-mixed-replace; boundary=$boundary");
- echo("$boundary\r\n");
- echo("Content-Type: image/png\r\n\r\n");
- echo(file_get_contents("green-100x100.png"));
-?>
Added: trunk/LayoutTests/http/tests/multipart/resources/multipart-nodashes.py (0 => 274803)
--- trunk/LayoutTests/http/tests/multipart/resources/multipart-nodashes.py (rev 0)
+++ trunk/LayoutTests/http/tests/multipart/resources/multipart-nodashes.py 2021-03-22 21:54:29 UTC (rev 274803)
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+
+# Generates a multipart/x-mixed-replace response but doesn't
+# include the -- before the boundary.
+
+import os
+import sys
+
+boundary = 'cutHere'
+sys.stdout.write(
+ 'Content-Type: multipart/x-mixed-replace; boundary={boundary}\r\n\r\n'
+ '{boundary}\r\n'
+ 'Content-Type: image/png\r\n\r\n'.format(boundary=boundary)
+)
+
+sys.stdout.flush()
+with open(os.path.join('/'.join(__file__.split('/')[0:-1]), 'green-100x100.png'), 'rb') as file:
+ sys.stdout.buffer.write(file.read())
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/multipart/resources/multipart-nodashes.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Deleted: trunk/LayoutTests/http/tests/multipart/resources/multipart-wait-before-boundary.php (274802 => 274803)
--- trunk/LayoutTests/http/tests/multipart/resources/multipart-wait-before-boundary.php 2021-03-22 21:47:51 UTC (rev 274802)
+++ trunk/LayoutTests/http/tests/multipart/resources/multipart-wait-before-boundary.php 2021-03-22 21:54:29 UTC (rev 274803)
@@ -1,42 +0,0 @@
-<?php
- if (isset($_GET['done'])) {
- header("Content-Type: text/html");
- echo("<script>parent.success()</script>");
- exit(0);
- }
-
- $boundary = "cutHere";
-
- function sendHeader()
- {
- global $boundary;
-
- echo("--$boundary\r\n");
- echo("Content-Type: text/html\r\n\r\n");
- flush();
- }
-
- header("Content-Type: multipart/x-mixed-replace; boundary=$boundary");
-
- // generate some padding to work around CFNetwork handling of multipart data
- $padding = "aa";
- for ($i = 0; $i < 10; $i++) {
- $padding .= $padding;
- }
-
- sendHeader();
- ob_end_flush();
- echo("test html\n");
- echo("<!-- $padding -->");
- flush();
- sendHeader();
- echo("second html");
- echo("<script>parent.childLoaded()</script>");
- echo("<!-- $padding -->");
- flush();
- sendHeader();
- echo("third html");
- echo("<!-- $padding -->");
- flush();
- usleep(20 * 1000000);
-?>
Added: trunk/LayoutTests/http/tests/multipart/resources/multipart-wait-before-boundary.py (0 => 274803)
--- trunk/LayoutTests/http/tests/multipart/resources/multipart-wait-before-boundary.py (rev 0)
+++ trunk/LayoutTests/http/tests/multipart/resources/multipart-wait-before-boundary.py 2021-03-22 21:54:29 UTC (rev 274803)
@@ -0,0 +1,50 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+import time
+from urllib.parse import parse_qs
+
+done = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True).get('done', [None])[0]
+
+if done is not None:
+ sys.stdout.write(
+ 'Content-Type: text/html\r\n\r\n'
+ '<script>parent.success()</script>'
+ )
+ sys.exit(0)
+
+boundary = 'cutHere'
+padding = 'a' * 2048
+def sendHeader():
+ sys.stdout.write(
+ '--{}\r\n'
+ 'Content-Type: text/html\r\n\r\n'.format(boundary)
+ )
+ sys.stdout.flush()
+
+sys.stdout.write('Content-Type: multipart/x-mixed-replace; boundary={}\r\n\r\n'.format(boundary))
+
+sendHeader()
+sys.stdout.write(
+ 'test html\n'
+ '<!-- {} -->'.format(padding)
+)
+sys.stdout.flush()
+
+sendHeader()
+sys.stdout.write(
+ 'second html\n'
+ '<script>parent.childLoaded()</script>'
+ '<!-- {} -->'.format(padding)
+)
+sys.stdout.flush()
+
+sendHeader()
+sys.stdout.write(
+ 'third html\n'
+ '<!-- {} -->'.format(padding)
+)
+sys.stdout.flush()
+
+time.sleep(20)
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/multipart/resources/multipart-wait-before-boundary.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Modified: trunk/LayoutTests/http/tests/multipart/win-boundary-crash.html (274802 => 274803)
--- trunk/LayoutTests/http/tests/multipart/win-boundary-crash.html 2021-03-22 21:47:51 UTC (rev 274802)
+++ trunk/LayoutTests/http/tests/multipart/win-boundary-crash.html 2021-03-22 21:54:29 UTC (rev 274803)
@@ -9,6 +9,6 @@
<p>Test for <i><a href=""
crash loading multipart/x-mixed-replace data on windows safari</i></p>
<p>If WebKit does not crash when loading this img, then it passed.</p>
-<img src="" />
+<img src="" />
</body>
</html>
Modified: trunk/LayoutTests/platform/ios/TestExpectations (274802 => 274803)
--- trunk/LayoutTests/platform/ios/TestExpectations 2021-03-22 21:47:51 UTC (rev 274802)
+++ trunk/LayoutTests/platform/ios/TestExpectations 2021-03-22 21:54:29 UTC (rev 274803)
@@ -2834,7 +2834,7 @@
fast/text/text-indent-inside-float.html [ ImageOnlyFailure ]
# <rdar://problem/28835343> REGRESSION: LayoutTest http/tests/multipart/load-last-non-html-frame.php failing
-http/tests/multipart/load-last-non-html-frame.php [ Failure ]
+http/tests/multipart/load-last-non-html-frame.py [ Failure ]
webkit.org/b/177366 http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture-1.html [ Pass Timeout ]
Modified: trunk/LayoutTests/platform/win/TestExpectations (274802 => 274803)
--- trunk/LayoutTests/platform/win/TestExpectations 2021-03-22 21:47:51 UTC (rev 274802)
+++ trunk/LayoutTests/platform/win/TestExpectations 2021-03-22 21:54:29 UTC (rev 274803)
@@ -2384,7 +2384,7 @@
http/tests/misc/async-script-removed.html [ Failure ]
http/tests/misc/bad-charset-alias.html
http/tests/misc/refresh-headers.php [ Failure ] # Easy
-http/tests/multipart/load-last-non-html-frame.php [ Failure ] # Extra whitespace
+http/tests/multipart/load-last-non-html-frame.py [ Failure ] # Extra whitespace
http/tests/navigation/no-referrer-reset.html [ Failure ] # Easy
http/tests/navigation/no-referrer-same-window.html [ Failure ] # Easy
http/tests/navigation/no-referrer-subframe.html [ Failure ] # Easy