Title: [274743] trunk/LayoutTests
- Revision
- 274743
- Author
- [email protected]
- Date
- 2021-03-19 15:32:30 -0700 (Fri, 19 Mar 2021)
Log Message
[LayoutTests] Convert http/tests/gzip-content-encoding convert PHP to Python
https://bugs.webkit.org/show_bug.cgi?id=223524
<rdar://problem/75625615>
Reviewed by Alex Christensen.
* http/tests/gzip-content-encoding/gzip-encoded-script.html:
* http/tests/gzip-content-encoding/gzip-encoded-stylesheet.html:
* http/tests/gzip-content-encoding/resources/echo-data-encoding-with-gzip.php: Removed.
* http/tests/gzip-content-encoding/resources/echo-data-encoding-with-gzip.py: Added.
Modified Paths
Added Paths
Removed Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (274742 => 274743)
--- trunk/LayoutTests/ChangeLog 2021-03-19 22:19:14 UTC (rev 274742)
+++ trunk/LayoutTests/ChangeLog 2021-03-19 22:32:30 UTC (rev 274743)
@@ -1,3 +1,16 @@
+2021-03-19 Chris Gambrell <[email protected]>
+
+ [LayoutTests] Convert http/tests/gzip-content-encoding convert PHP to Python
+ https://bugs.webkit.org/show_bug.cgi?id=223524
+ <rdar://problem/75625615>
+
+ Reviewed by Alex Christensen.
+
+ * http/tests/gzip-content-encoding/gzip-encoded-script.html:
+ * http/tests/gzip-content-encoding/gzip-encoded-stylesheet.html:
+ * http/tests/gzip-content-encoding/resources/echo-data-encoding-with-gzip.php: Removed.
+ * http/tests/gzip-content-encoding/resources/echo-data-encoding-with-gzip.py: Added.
+
2021-03-19 Zalan Bujtas <[email protected]>
Unreviewed, reverting r274596.
Modified: trunk/LayoutTests/http/tests/gzip-content-encoding/gzip-encoded-script.html (274742 => 274743)
--- trunk/LayoutTests/http/tests/gzip-content-encoding/gzip-encoded-script.html 2021-03-19 22:19:14 UTC (rev 274742)
+++ trunk/LayoutTests/http/tests/gzip-content-encoding/gzip-encoded-script.html 2021-03-19 22:32:30 UTC (rev 274743)
@@ -5,7 +5,7 @@
if (window.testRunner)
testRunner.dumpAsText();
</script>
-<script src=""
+<script src=""
</head>
<body>
<p><span id="result">FAIL did not</span> execute gzip-encoded _javascript_ script.</p>
Modified: trunk/LayoutTests/http/tests/gzip-content-encoding/gzip-encoded-stylesheet.html (274742 => 274743)
--- trunk/LayoutTests/http/tests/gzip-content-encoding/gzip-encoded-stylesheet.html 2021-03-19 22:19:14 UTC (rev 274742)
+++ trunk/LayoutTests/http/tests/gzip-content-encoding/gzip-encoded-stylesheet.html 2021-03-19 22:32:30 UTC (rev 274743)
@@ -13,7 +13,7 @@
height: 100px;
}
</style>
-<link rel="stylesheet" href=""
+<link rel="stylesheet" href=""
</head>
<body>
<div id="square"></div>
Deleted: trunk/LayoutTests/http/tests/gzip-content-encoding/resources/echo-data-encoding-with-gzip.php (274742 => 274743)
--- trunk/LayoutTests/http/tests/gzip-content-encoding/resources/echo-data-encoding-with-gzip.php 2021-03-19 22:19:14 UTC (rev 274742)
+++ trunk/LayoutTests/http/tests/gzip-content-encoding/resources/echo-data-encoding-with-gzip.php 2021-03-19 22:32:30 UTC (rev 274743)
@@ -1,10 +0,0 @@
-<?php
-$query = $_GET["q"];
-$contentType = !empty($_GET["type"]) ? $_GET["type"] : "text/plain";
-$gzipEncodedData = gzencode($_GET['q']);
-
-header("Content-Type: " . $_GET["type"]);
-header("Content-Encoding: gzip");
-header("Content-Length: " . strlen($gzipEncodedData));
-echo $gzipEncodedData;
-?>
Added: trunk/LayoutTests/http/tests/gzip-content-encoding/resources/echo-data-encoding-with-gzip.py (0 => 274743)
--- trunk/LayoutTests/http/tests/gzip-content-encoding/resources/echo-data-encoding-with-gzip.py (rev 0)
+++ trunk/LayoutTests/http/tests/gzip-content-encoding/resources/echo-data-encoding-with-gzip.py 2021-03-19 22:32:30 UTC (rev 274743)
@@ -0,0 +1,32 @@
+#!/usr/bin/env python3
+
+import gzip
+import os
+import sys
+import tempfile
+from urllib.parse import parse_qs
+
+file = __file__.split(':/cygwin')[-1]
+http_root = os.path.dirname(os.path.dirname(os.path.abspath(os.path.dirname(file))))
+
+query = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True)
+q = query.get('q', [''])[0]
+content_type = query.get('type', ['text/plain'])[0]
+
+sys.stdout.write(
+ 'Content-Type: {}\r\n'
+ 'Content-Encoding: gzip\r\n'.format(content_type)
+)
+
+with gzip.open(os.path.join('/'.join(__file__.split('/')[0:-1]), 'content.gz'), 'wb') as file:
+ file.write(bytes(q, 'utf-8'))
+
+with open(os.path.join('/'.join(__file__.split('/')[0:-1]), 'content.gz'), 'rb') as file:
+ content = file.read()
+
+ sys.stdout.write('Content-Length: {}\r\n\r\n'.format(len(content)))
+ sys.stdout.flush()
+ sys.stdout.buffer.write(content)
+
+if os.path.isfile(os.path.join('/'.join(__file__.split('/')[0:-1]), 'content.gz')):
+ os.remove(os.path.join('/'.join(__file__.split('/')[0:-1]), 'content.gz'))
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/gzip-content-encoding/resources/echo-data-encoding-with-gzip.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes