Diff
Modified: trunk/LayoutTests/ChangeLog (272826 => 272827)
--- trunk/LayoutTests/ChangeLog 2021-02-13 01:40:41 UTC (rev 272826)
+++ trunk/LayoutTests/ChangeLog 2021-02-13 01:48:23 UTC (rev 272827)
@@ -1,3 +1,31 @@
+2021-02-12 Chris Gambrell <[email protected]>
+
+ [LayoutTests] Convert http/tests/mime convert PHP to Python
+ https://bugs.webkit.org/show_bug.cgi?id=221737
+ <rdar://problem/74219024>
+
+ Reviewed by Jonathan Bedard.
+
+ * http/tests/mime/quoted-charset.php: Removed.
+ * http/tests/mime/quoted-charset.py: Added.
+ * http/tests/mime/resources/style-with-charset.php: Removed.
+ * http/tests/mime/resources/style-with-charset.py: Added.
+ * http/tests/mime/resources/style-with-text-css-and-invalid-type.php: Removed.
+ * http/tests/mime/resources/style-with-text-css-and-invalid-type.py: Added.
+ * http/tests/mime/resources/style-with-text-plain.php: Removed.
+ * http/tests/mime/resources/style-with-text-plain.py: Added.
+ * http/tests/mime/resources/uppercase-mime-type.php: Removed.
+ * http/tests/mime/resources/uppercase-mime-type.py: Added.
+ * http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-and-css-extension-expected.txt:
+ * http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-and-css-extension.html:
+ * http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-expected.txt:
+ * http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain.html:
+ * http/tests/mime/standard-mode-loads-stylesheet-with-charset-and-css-extension.html:
+ * http/tests/mime/standard-mode-loads-stylesheet-with-charset.html:
+ * http/tests/mime/standard-mode-loads-stylesheet-with-text-css-and-invalid-type.html:
+ * http/tests/mime/uppercase-mime-type-expected.txt:
+ * http/tests/mime/uppercase-mime-type.html:
+
2021-02-12 Alex Christensen <[email protected]>
REGRESSION (r272784): [macOS Release] fast/animation/request-animation-frame-throttling-lowPowerMode.html is a flaky failure
Deleted: trunk/LayoutTests/http/tests/mime/quoted-charset.php (272826 => 272827)
--- trunk/LayoutTests/http/tests/mime/quoted-charset.php 2021-02-13 01:40:41 UTC (rev 272826)
+++ trunk/LayoutTests/http/tests/mime/quoted-charset.php 2021-02-13 01:48:23 UTC (rev 272827)
@@ -1,12 +0,0 @@
-<?php
- header('Content-type: text/html; charset="koi8-r"');
-?>
-
-<p>Should say SUCCESS: SU\xF3\xF3\xE5SS</p>
-<p>The latter has some Cyrillic characters that look like Latin ones. This test verifies that decoding
-is correctly performed.</p>
-
-<script>
-if (window.testRunner)
- testRunner.dumpAsText();
-</script>
Added: trunk/LayoutTests/http/tests/mime/quoted-charset.py (0 => 272827)
--- trunk/LayoutTests/http/tests/mime/quoted-charset.py (rev 0)
+++ trunk/LayoutTests/http/tests/mime/quoted-charset.py 2021-02-13 01:48:23 UTC (rev 272827)
@@ -0,0 +1,14 @@
+#!/usr/bin/env python3
+
+import sys
+
+sys.stdout.write('Content-Type: text/html; charset="utf-8"\r\n\r\n')
+
+print('''<p>Should say SUCCESS: {}</p>
+<p>The latter has some Cyrillic characters that look like Latin ones. This test verifies that decoding
+is correctly performed.</p>
+
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+</script>'''.format('SUóóåSS'.encode('ISO-8859-1').decode('KOI8-R')))
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/mime/quoted-charset.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Deleted: trunk/LayoutTests/http/tests/mime/resources/style-with-charset.php (272826 => 272827)
--- trunk/LayoutTests/http/tests/mime/resources/style-with-charset.php 2021-02-13 01:40:41 UTC (rev 272826)
+++ trunk/LayoutTests/http/tests/mime/resources/style-with-charset.php 2021-02-13 01:48:23 UTC (rev 272827)
@@ -1,4 +0,0 @@
-<?php
-header("Content-Type: text/css; charset=utf-8");
-?>
-html { background-color: green; }
Added: trunk/LayoutTests/http/tests/mime/resources/style-with-charset.py (0 => 272827)
--- trunk/LayoutTests/http/tests/mime/resources/style-with-charset.py (rev 0)
+++ trunk/LayoutTests/http/tests/mime/resources/style-with-charset.py 2021-02-13 01:48:23 UTC (rev 272827)
@@ -0,0 +1,8 @@
+#!/usr/bin/env python3
+
+import sys
+
+sys.stdout.write(
+ 'Content-Type: text/css; charset=utf-8\r\n\r\n'
+ 'html { background-color: green; }\n'
+)
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/mime/resources/style-with-charset.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Deleted: trunk/LayoutTests/http/tests/mime/resources/style-with-text-css-and-invalid-type.php (272826 => 272827)
--- trunk/LayoutTests/http/tests/mime/resources/style-with-text-css-and-invalid-type.php 2021-02-13 01:40:41 UTC (rev 272826)
+++ trunk/LayoutTests/http/tests/mime/resources/style-with-text-css-and-invalid-type.php 2021-02-13 01:48:23 UTC (rev 272827)
@@ -1,4 +0,0 @@
-<?php
-header("Content-Type: text/css, 200904131203");
-?>
-html { background-color: green; }
Added: trunk/LayoutTests/http/tests/mime/resources/style-with-text-css-and-invalid-type.py (0 => 272827)
--- trunk/LayoutTests/http/tests/mime/resources/style-with-text-css-and-invalid-type.py (rev 0)
+++ trunk/LayoutTests/http/tests/mime/resources/style-with-text-css-and-invalid-type.py 2021-02-13 01:48:23 UTC (rev 272827)
@@ -0,0 +1,8 @@
+#!/usr/bin/env python3
+
+import sys
+
+sys.stdout.write(
+ 'Content-Type: text/css, 200904131203\r\n\r\n'
+ 'html { background-color: green; }\n'
+)
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/mime/resources/style-with-text-css-and-invalid-type.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Deleted: trunk/LayoutTests/http/tests/mime/resources/style-with-text-plain.php (272826 => 272827)
--- trunk/LayoutTests/http/tests/mime/resources/style-with-text-plain.php 2021-02-13 01:40:41 UTC (rev 272826)
+++ trunk/LayoutTests/http/tests/mime/resources/style-with-text-plain.php 2021-02-13 01:48:23 UTC (rev 272827)
@@ -1,4 +0,0 @@
-<?php
-header("Content-Type: text/plain");
-?>
-html { background-color: red; }
Added: trunk/LayoutTests/http/tests/mime/resources/style-with-text-plain.py (0 => 272827)
--- trunk/LayoutTests/http/tests/mime/resources/style-with-text-plain.py (rev 0)
+++ trunk/LayoutTests/http/tests/mime/resources/style-with-text-plain.py 2021-02-13 01:48:23 UTC (rev 272827)
@@ -0,0 +1,8 @@
+#!/usr/bin/env python3
+
+import sys
+
+sys.stdout.write(
+ 'Content-Type: text/plain\r\n\r\n'
+ 'html { background-color: red; }\n'
+)
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/mime/resources/style-with-text-plain.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Deleted: trunk/LayoutTests/http/tests/mime/resources/uppercase-mime-type.php (272826 => 272827)
--- trunk/LayoutTests/http/tests/mime/resources/uppercase-mime-type.php 2021-02-13 01:40:41 UTC (rev 272826)
+++ trunk/LayoutTests/http/tests/mime/resources/uppercase-mime-type.php 2021-02-13 01:48:23 UTC (rev 272827)
@@ -1,13 +0,0 @@
-<?php
-header("Content-Type: TEXT/HTML");
-?>
-<html>
-<script>
-if (window.testRunner)
- testRunner.notifyDone();
-
-</script>
-<body>
-If this text is shown, that means the new document was successfully loaded.
-</body>
-</html>
Added: trunk/LayoutTests/http/tests/mime/resources/uppercase-mime-type.py (0 => 272827)
--- trunk/LayoutTests/http/tests/mime/resources/uppercase-mime-type.py (rev 0)
+++ trunk/LayoutTests/http/tests/mime/resources/uppercase-mime-type.py 2021-02-13 01:48:23 UTC (rev 272827)
@@ -0,0 +1,16 @@
+#!/usr/bin/env python3
+
+import sys
+
+sys.stdout.write('Content-Type: TEXT/HTML\r\n\r\n')
+
+print('<html>')
+print('<script>')
+print('if (window.testRunner)')
+print(' testRunner.notifyDone();')
+print('')
+print('</script>')
+print('<body>')
+print('If this text is shown, that means the new document was successfully loaded.')
+print('</body>')
+print('</html>')
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/mime/resources/uppercase-mime-type.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Modified: trunk/LayoutTests/http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-and-css-extension-expected.txt (272826 => 272827)
--- trunk/LayoutTests/http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-and-css-extension-expected.txt 2021-02-13 01:40:41 UTC (rev 272826)
+++ trunk/LayoutTests/http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-and-css-extension-expected.txt 2021-02-13 01:48:23 UTC (rev 272827)
@@ -1,2 +1,2 @@
-CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/mime/resources/style-with-text-plain.php/foo.css' because non CSS MIME types are not allowed in strict mode.
+CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/mime/resources/style-with-text-plain.py/foo.css' because non CSS MIME types are not allowed in strict mode.
This test passes if we do NOT apply the stylesheet (which turns the background color red.) The background color is: rgba(0, 0, 0, 0).
Modified: trunk/LayoutTests/http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-and-css-extension.html (272826 => 272827)
--- trunk/LayoutTests/http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-and-css-extension.html 2021-02-13 01:40:41 UTC (rev 272826)
+++ trunk/LayoutTests/http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-and-css-extension.html 2021-02-13 01:48:23 UTC (rev 272827)
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
-<link rel="stylesheet" href=""
+<link rel="stylesheet" href=""
<script>
if (window.testRunner)
testRunner.dumpAsText();
Modified: trunk/LayoutTests/http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-expected.txt (272826 => 272827)
--- trunk/LayoutTests/http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-expected.txt 2021-02-13 01:40:41 UTC (rev 272826)
+++ trunk/LayoutTests/http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-expected.txt 2021-02-13 01:48:23 UTC (rev 272827)
@@ -1,2 +1,2 @@
-CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/mime/resources/style-with-text-plain.php' because non CSS MIME types are not allowed in strict mode.
+CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/mime/resources/style-with-text-plain.py' because non CSS MIME types are not allowed in strict mode.
This test passes if we do NOT apply the stylesheet (which turns the background color red.) The background color is: rgba(0, 0, 0, 0).
Modified: trunk/LayoutTests/http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain.html (272826 => 272827)
--- trunk/LayoutTests/http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain.html 2021-02-13 01:40:41 UTC (rev 272826)
+++ trunk/LayoutTests/http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain.html 2021-02-13 01:48:23 UTC (rev 272827)
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
-<link rel="stylesheet" href=""
+<link rel="stylesheet" href=""
<script>
if (window.testRunner)
testRunner.dumpAsText();
Modified: trunk/LayoutTests/http/tests/mime/standard-mode-loads-stylesheet-with-charset-and-css-extension.html (272826 => 272827)
--- trunk/LayoutTests/http/tests/mime/standard-mode-loads-stylesheet-with-charset-and-css-extension.html 2021-02-13 01:40:41 UTC (rev 272826)
+++ trunk/LayoutTests/http/tests/mime/standard-mode-loads-stylesheet-with-charset-and-css-extension.html 2021-02-13 01:48:23 UTC (rev 272827)
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
-<link rel="stylesheet" href=""
+<link rel="stylesheet" href=""
<script>
if (window.testRunner)
testRunner.dumpAsText();
Modified: trunk/LayoutTests/http/tests/mime/standard-mode-loads-stylesheet-with-charset.html (272826 => 272827)
--- trunk/LayoutTests/http/tests/mime/standard-mode-loads-stylesheet-with-charset.html 2021-02-13 01:40:41 UTC (rev 272826)
+++ trunk/LayoutTests/http/tests/mime/standard-mode-loads-stylesheet-with-charset.html 2021-02-13 01:48:23 UTC (rev 272827)
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
-<link rel="stylesheet" href=""
+<link rel="stylesheet" href=""
<script>
if (window.testRunner)
testRunner.dumpAsText();
Modified: trunk/LayoutTests/http/tests/mime/standard-mode-loads-stylesheet-with-text-css-and-invalid-type.html (272826 => 272827)
--- trunk/LayoutTests/http/tests/mime/standard-mode-loads-stylesheet-with-text-css-and-invalid-type.html 2021-02-13 01:40:41 UTC (rev 272826)
+++ trunk/LayoutTests/http/tests/mime/standard-mode-loads-stylesheet-with-text-css-and-invalid-type.html 2021-02-13 01:48:23 UTC (rev 272827)
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
-<link rel="stylesheet" href=""
+<link rel="stylesheet" href=""
<script>
function runTest()
{
Modified: trunk/LayoutTests/http/tests/mime/uppercase-mime-type-expected.txt (272826 => 272827)
--- trunk/LayoutTests/http/tests/mime/uppercase-mime-type-expected.txt 2021-02-13 01:40:41 UTC (rev 272826)
+++ trunk/LayoutTests/http/tests/mime/uppercase-mime-type-expected.txt 2021-02-13 01:48:23 UTC (rev 272827)
@@ -1,2 +1,2 @@
-uppercase-mime-type.php has MIME type text/html
+uppercase-mime-type.py has MIME type text/html
If this text is shown, that means the new document was successfully loaded.
Modified: trunk/LayoutTests/http/tests/mime/uppercase-mime-type.html (272826 => 272827)
--- trunk/LayoutTests/http/tests/mime/uppercase-mime-type.html 2021-02-13 01:40:41 UTC (rev 272826)
+++ trunk/LayoutTests/http/tests/mime/uppercase-mime-type.html 2021-02-13 01:48:23 UTC (rev 272827)
@@ -7,7 +7,7 @@
}
function runTests() {
- window.location.assign('resources/uppercase-mime-type.php');
+ window.location.assign('resources/uppercase-mime-type.py');
}
</script>
<body _onload_="runTests();">