Diff
Modified: trunk/LayoutTests/ChangeLog (275203 => 275204)
--- trunk/LayoutTests/ChangeLog 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/ChangeLog 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,3 +1,82 @@
+2021-03-30 Chris Gambrell <cgambr...@apple.com>
+
+ [LayoutTests] Convert http/tests/contentextensions convert PHP to Python
+ https://bugs.webkit.org/show_bug.cgi?id=223835
+ <rdar://problem/75912102>
+
+ Reviewed by Jonathan Bedard.
+
+ * http/tests/contentextensions/block-cookies-in-csp-report-expected.txt:
+ * http/tests/contentextensions/block-cookies-in-csp-report.php: Removed.
+ * http/tests/contentextensions/block-cookies-in-csp-report.php.json: Removed.
+ * http/tests/contentextensions/block-cookies-in-csp-report.py: Added.
+ * http/tests/contentextensions/block-cookies-in-csp-report.py.json: Added.
+ * http/tests/contentextensions/block-cookies-in-image-load-in-onunload-expected.txt:
+ * http/tests/contentextensions/block-cookies-in-image-load-in-onunload.html:
+ * http/tests/contentextensions/block-cookies-in-image-load-in-onunload.html.json:
+ * http/tests/contentextensions/block-cookies-in-ping-expected.txt:
+ * http/tests/contentextensions/block-cookies-in-ping.html:
+ * http/tests/contentextensions/block-cookies-in-ping.html.json:
+ * http/tests/contentextensions/block-csp-report-expected.txt:
+ * http/tests/contentextensions/block-csp-report.php: Removed.
+ * http/tests/contentextensions/block-csp-report.php.json: Removed.
+ * http/tests/contentextensions/block-csp-report.py: Added.
+ * http/tests/contentextensions/block-csp-report.py.json: Added.
+ * http/tests/contentextensions/block-everything-unless-domain-redirect.php: Removed.
+ * http/tests/contentextensions/block-everything-unless-domain-redirect.php.json: Removed.
+ * http/tests/contentextensions/block-everything-unless-domain-redirect.py: Added.
+ * http/tests/contentextensions/block-everything-unless-domain-redirect.py.json: Added.
+ * http/tests/contentextensions/block-image-load-in-onunload-expected.txt:
+ * http/tests/contentextensions/block-image-load-in-onunload.html:
+ * http/tests/contentextensions/block-image-load-in-onunload.html.json:
+ * http/tests/contentextensions/block-ping-expected.txt:
+ * http/tests/contentextensions/block-ping-resource-type-ping-expected.txt:
+ * http/tests/contentextensions/block-ping-resource-type-ping.html:
+ * http/tests/contentextensions/block-ping-resource-type-ping.html.json:
+ * http/tests/contentextensions/block-ping-resource-type-raw-expected.txt:
+ * http/tests/contentextensions/block-ping-resource-type-raw.html:
+ * http/tests/contentextensions/block-ping-resource-type-raw.html.json:
+ * http/tests/contentextensions/block-ping.html:
+ * http/tests/contentextensions/block-ping.html.json:
+ * http/tests/contentextensions/fetch-redirect-blocked.html:
+ * http/tests/contentextensions/hide-on-csp-report-expected.txt:
+ * http/tests/contentextensions/hide-on-csp-report.php: Removed.
+ * http/tests/contentextensions/hide-on-csp-report.php.json: Removed.
+ * http/tests/contentextensions/hide-on-csp-report.py: Added.
+ * http/tests/contentextensions/hide-on-csp-report.py.json: Added.
+ * http/tests/contentextensions/hide-on-ping-expected.txt:
+ * http/tests/contentextensions/hide-on-ping-with-ping-that-redirects-expected.txt:
+ * http/tests/contentextensions/hide-on-ping-with-ping-that-redirects.html:
+ * http/tests/contentextensions/hide-on-ping-with-ping-that-redirects.html.json:
+ * http/tests/contentextensions/hide-on-ping.html:
+ * http/tests/contentextensions/hide-on-ping.html.json:
+ * http/tests/contentextensions/main-resource-redirect-blocked.php: Removed.
+ * http/tests/contentextensions/main-resource-redirect-blocked.php.json: Removed.
+ * http/tests/contentextensions/main-resource-redirect-blocked.py: Added.
+ * http/tests/contentextensions/main-resource-redirect-blocked.py.json: Added.
+ * http/tests/contentextensions/reload-without-contentextensions.html:
+ * http/tests/contentextensions/resources/delete-ping.php: Removed.
+ * http/tests/contentextensions/resources/delete-ping.py: Added.
+ * http/tests/contentextensions/resources/get-ping-data.php: Removed.
+ * http/tests/contentextensions/resources/get-ping-data.py: Added.
+ * http/tests/contentextensions/resources/ping-file-path.php: Removed.
+ * http/tests/contentextensions/resources/ping_file_path.py: Added.
+ * http/tests/contentextensions/resources/redirect.php: Removed.
+ * http/tests/contentextensions/resources/redirect.py: Added.
+ * http/tests/contentextensions/resources/save-ping-and-redirect-to-save-ping.php: Removed.
+ * http/tests/contentextensions/resources/save-ping-and-redirect-to-save-ping.py: Added.
+ * http/tests/contentextensions/resources/save-ping.php: Removed.
+ * http/tests/contentextensions/resources/save-ping.py: Added.
+ * http/tests/contentextensions/resources/save_ping.py: Added.
+ (not_being_called):
+ (save_ping):
+ * http/tests/contentextensions/resources/subresource-redirect.php: Removed.
+ * http/tests/contentextensions/resources/subresource-redirect.py: Added.
+ * http/tests/contentextensions/subresource-redirect-blocked.html:
+ * http/tests/privateClickMeasurement/resources/redirectToConversionOnIPAddress.py:
+ * http/tests/resourceLoadStatistics/ping-to-prevalent-resource-expected.txt:
+ * http/tests/resourceLoadStatistics/ping-to-prevalent-resource.html:
+
2021-03-30 Kimmo Kinnunen <kkinnu...@apple.com>
Add webgl/pending/conformance/context/context-attributes-alpha-depth-stencil-antialias.html for test update
Modified: trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report-expected.txt (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report-expected.txt 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report-expected.txt 2021-03-30 15:20:22 UTC (rev 275204)
@@ -8,5 +8,5 @@
--------
Ping received.
HTTP_HOST: 127.0.0.1:8000
-REQUEST_URI: /contentextensions/resources/save-ping.php?test=contentextensions-block-cookies-in-csp-report
+REQUEST_URI: /contentextensions/resources/save-ping.py?test=contentextensions-block-cookies-in-csp-report
No cookies in ping.
Deleted: trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.php (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.php 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.php 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,42 +0,0 @@
-<?php
- header("Content-Security-Policy: img-src 'self'; report-uri /contentextensions/resources/save-ping.php?test=contentextensions-block-cookies-in-csp-report");
-?>
-<head>
-<script>
-if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.dumpChildFramesAsText();
- testRunner.waitUntilDone();
-}
-
-function deletePing() {
- var deletePingContainer = document.getElementById("delete_ping_container");
- deletePingContainer.innerHTML = '<img src="" _onerror_="loadCrossDomainImage();">';
-}
-
-function loadCrossDomainImage() {
- // Trying to load an image from a different port
- // will result in a CSP violation.
- var img = new Image(1, 1);
- img.src = ""
- showPingResult();
-}
-
-function showPingResult() {
- var iframe = document.getElementById("result_frame");
- iframe._onload_ = function() {
- if (window.testRunner) { testRunner.notifyDone(); }
- }
- iframe.src = ""
-}
-</script>
-</head>
-
-<body>
-This test creates a CSP violation report, but the report URL matches a 'block-cookie' rule.
-<img src=""
- _onerror_="deletePing();">
-<div id="delete_ping_container"></div>
-<iframe id="result_frame" name="result_frame"><!-- Will contain ping data received by server --></iframe>
-</body>
-
Deleted: trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.php.json (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.php.json 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.php.json 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,10 +0,0 @@
-[
- {
- "trigger": {
- "url-filter": "save-ping.php"
- },
- "action": {
- "type": "block-cookies"
- }
- }
-]
Copied: trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.py (from rev 275203, trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.php) (0 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.py (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.py 2021-03-30 15:20:22 UTC (rev 275204)
@@ -0,0 +1,47 @@
+#!/usr/bin/env python3
+
+import sys
+
+sys.stdout.write(
+ 'Content-Security-Policy: img-src \'self\'; report-uri /contentextensions/resources/save-ping.py?test=contentextensions-block-cookies-in-csp-report\r\n'
+ 'Content-Type: text/html\r\n\r\n'
+)
+
+print('''<head>
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.dumpChildFramesAsText();
+ testRunner.waitUntilDone();
+}
+
+function deletePing() {
+ var deletePingContainer = document.getElementById("delete_ping_container");
+ deletePingContainer.innerHTML = '<img src="" _onerror_="loadCrossDomainImage();">';
+}
+
+function loadCrossDomainImage() {
+ // Trying to load an image from a different port
+ // will result in a CSP violation.
+ var img = new Image(1, 1);
+ img.src = ""
+ showPingResult();
+}
+
+function showPingResult() {
+ var iframe = document.getElementById("result_frame");
+ iframe._onload_ = function() {
+ if (window.testRunner) { testRunner.notifyDone(); }
+ }
+ iframe.src = ""
+}
+</script>
+</head>
+
+<body>
+This test creates a CSP violation report, but the report URL matches a 'block-cookie' rule.
+<img src=""
+ _onerror_="deletePing();">
+<div id="delete_ping_container"></div>
+<iframe id="result_frame" name="result_frame"><!-- Will contain ping data received by server --></iframe>
+</body>''')
\ No newline at end of file
Property changes: trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.py
Added: svn:executable
+*
\ No newline at end of property
Added: trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.py.json (0 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.py.json (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.py.json 2021-03-30 15:20:22 UTC (rev 275204)
@@ -0,0 +1,16 @@
+#!/usr/bin/env python3
+
+import sys
+
+sys.stdout.write('Content-Type: text/html\r\n\r\n')
+
+print('''[
+ {
+ "trigger": {
+ "url-filter": "save-ping.py"
+ },
+ "action": {
+ "type": "block-cookies"
+ }
+ }
+]''')
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.py.json
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Modified: trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-image-load-in-onunload-expected.txt (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-image-load-in-onunload-expected.txt 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-image-load-in-onunload-expected.txt 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,5 +1,5 @@
main frame - has 1 onunload handler(s)
Ping received.
HTTP_HOST: 127.0.0.1:8000
-REQUEST_URI: /contentextensions/resources/save-ping.php?test=contentextensions-block-cookies-in-image-load-in-onunload
+REQUEST_URI: /contentextensions/resources/save-ping.py?test=contentextensions-block-cookies-in-image-load-in-onunload
No cookies in ping.
Modified: trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-image-load-in-onunload.html (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-image-load-in-onunload.html 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-image-load-in-onunload.html 2021-03-30 15:20:22 UTC (rev 275204)
@@ -7,14 +7,14 @@
function deletePing() {
var deletePingContainer = document.getElementById("delete_ping_container");
- deletePingContainer.innerHTML = '<img src="" _onerror_="loadNextPage();">';
+ deletePingContainer.innerHTML = '<img src="" _onerror_="loadNextPage();">';
}
function loadNextPage() {
// Navigating to another location invokes the unload handler
- location.href = "" +
+ location.href = "" +
encodeURIComponent(
- "/contentextensions/resources/get-ping-data.php?" +
+ "/contentextensions/resources/get-ping-data.py?" +
"test=contentextensions-block-cookies-in-image-load-in-onunload&" +
"end_test=1");
}
@@ -21,7 +21,7 @@
function loadImage() {
var img = new Image(1, 1);
- img.src = ""
+ img.src = ""
}
</script>
</head>
Modified: trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-image-load-in-onunload.html.json (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-image-load-in-onunload.html.json 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-image-load-in-onunload.html.json 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,7 +1,7 @@
[
{
"trigger": {
- "url-filter": "save-ping.php"
+ "url-filter": "save-ping.py"
},
"action": {
"type": "block-cookies"
Modified: trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-ping-expected.txt (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-ping-expected.txt 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-ping-expected.txt 2021-03-30 15:20:22 UTC (rev 275204)
@@ -10,5 +10,5 @@
--------
Ping received.
HTTP_HOST: 127.0.0.1:8000
-REQUEST_URI: /contentextensions/resources/save-ping.php?test=contentextensions-block-cookies-in-ping
+REQUEST_URI: /contentextensions/resources/save-ping.py?test=contentextensions-block-cookies-in-ping
No cookies in ping.
Modified: trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-ping.html (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-ping.html 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-ping.html 2021-03-30 15:20:22 UTC (rev 275204)
@@ -11,11 +11,11 @@
var iframe = document.getElementById("link_frame");
var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
iframeDoc.write('' +
- '<img src="" ' +
+ '<img src="" ' +
'_onerror_="parent.clickOnLinkWithPing();">' +
'<a id="a" ' +
'href="" ' + // check-ping.html calls showPingResult()
- 'ping="resources/save-ping.php?test=contentextensions-block-cookies-in-ping"> ' +
+ 'ping="resources/save-ping.py?test=contentextensions-block-cookies-in-ping"> ' +
'Link with ping' +
'</a>'
@@ -40,7 +40,7 @@
iframe._onload_ = function() {
if (window.testRunner) { testRunner.notifyDone() }
}
- iframe.src = ""
+ iframe.src = ""
}
</script>
</head>
Modified: trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-ping.html.json (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-ping.html.json 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-cookies-in-ping.html.json 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,7 +1,7 @@
[
{
"trigger": {
- "url-filter": "save-ping.php"
+ "url-filter": "save-ping.py"
},
"action": {
"type": "block-cookies"
Modified: trunk/LayoutTests/http/tests/contentextensions/block-csp-report-expected.txt (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-csp-report-expected.txt 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-csp-report-expected.txt 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,5 +1,5 @@
CONSOLE MESSAGE: Refused to load http://localhost/foo.png because it does not appear in the img-src directive of the Content Security Policy.
-CONSOLE MESSAGE: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/block-csp-report.php from loading a resource from http://localhost:8000/contentextensions/resources/save-ping.php?test=contentextensions-block-csp-report
+CONSOLE MESSAGE: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/block-csp-report.py from loading a resource from http://localhost:8000/contentextensions/resources/save-ping.py?test=contentextensions-block-csp-report
This test creates a CSP violation report, but the report URL matches a 'block' rule.
--------
Deleted: trunk/LayoutTests/http/tests/contentextensions/block-csp-report.php (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-csp-report.php 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-csp-report.php 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,39 +0,0 @@
-<?php
- header("Content-Security-Policy: img-src 'self'; report-uri http://localhost:8000/contentextensions/resources/save-ping.php?test=contentextensions-block-csp-report");
-?>
-<head>
-<script>
-if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.dumpChildFramesAsText();
- testRunner.waitUntilDone();
-}
-
-function loadCrossDomainImage() {
- // Trying to load an image from a different port
- // will result in a CSP violation.
- var img = new Image(1, 1);
- img.src = ""
- showPingResult();
-}
-
-function showPingResult() {
- var iframe = document.getElementById("result_frame");
- iframe._onload_ = function() {
- if (window.testRunner) { testRunner.notifyDone(); }
- }
- iframe.src = ""
- // Why timeout_ms=1000:
- // To pass the test, the ping shouldn't arrive, so we need to
- // timeout at some point. We don't have to wait too long because
- // the console message can tell us whether the ping was blocked.
-}
-</script>
-</head>
-
-<body>
-This test creates a CSP violation report, but the report URL matches a 'block' rule.
-<img src="" _onerror_="loadCrossDomainImage();">
-<iframe id="result_frame" name="result_frame"><!-- Will contain ping data received by server --></iframe>
-</body>
-
Deleted: trunk/LayoutTests/http/tests/contentextensions/block-csp-report.php.json (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-csp-report.php.json 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-csp-report.php.json 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,10 +0,0 @@
-[
- {
- "trigger": {
- "url-filter": "save-ping.php"
- },
- "action": {
- "type": "block"
- }
- }
-]
Copied: trunk/LayoutTests/http/tests/contentextensions/block-csp-report.py (from rev 275203, trunk/LayoutTests/http/tests/contentextensions/block-csp-report.php) (0 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-csp-report.py (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/block-csp-report.py 2021-03-30 15:20:22 UTC (rev 275204)
@@ -0,0 +1,44 @@
+#!/usr/bin/env python3
+
+import sys
+
+sys.stdout.write(
+ 'Content-Security-Policy: img-src \'self\'; report-uri http://localhost:8000/contentextensions/resources/save-ping.py?test=contentextensions-block-csp-report\r\n'
+ 'Content-Type: text/html\r\n\r\n'
+)
+
+print('''<head>
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.dumpChildFramesAsText();
+ testRunner.waitUntilDone();
+}
+
+function loadCrossDomainImage() {
+ // Trying to load an image from a different port
+ // will result in a CSP violation.
+ var img = new Image(1, 1);
+ img.src = ""
+ showPingResult();
+}
+
+function showPingResult() {
+ var iframe = document.getElementById("result_frame");
+ iframe._onload_ = function() {
+ if (window.testRunner) { testRunner.notifyDone(); }
+ }
+ iframe.src = ""
+ // Why timeout_ms=1000:
+ // To pass the test, the ping shouldn't arrive, so we need to
+ // timeout at some point. We don't have to wait too long because
+ // the console message can tell us whether the ping was blocked.
+}
+</script>
+</head>
+
+<body>
+This test creates a CSP violation report, but the report URL matches a 'block' rule.
+<img src="" _onerror_="loadCrossDomainImage();">
+<iframe id="result_frame" name="result_frame"><!-- Will contain ping data received by server --></iframe>
+</body>''')
\ No newline at end of file
Property changes: trunk/LayoutTests/http/tests/contentextensions/block-csp-report.py
Added: svn:executable
+*
\ No newline at end of property
Added: trunk/LayoutTests/http/tests/contentextensions/block-csp-report.py.json (0 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-csp-report.py.json (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/block-csp-report.py.json 2021-03-30 15:20:22 UTC (rev 275204)
@@ -0,0 +1,16 @@
+#!/usr/bin/env python3
+
+import sys
+
+sys.stdout.write('Content-Type: text/html\r\n\r\n')
+
+print('''[
+ {
+ "trigger": {
+ "url-filter": "save-ping.py"
+ },
+ "action": {
+ "type": "block"
+ }
+ }
+]''')
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/contentextensions/block-csp-report.py.json
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Deleted: trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain-redirect.php (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain-redirect.php 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain-redirect.php 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,4 +0,0 @@
-<?php
- header('Location: http://localhost/contentextensions/resources/should-not-load.html');
- header('HTTP/1.0 302 Found');
-?>
Deleted: trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain-redirect.php.json (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain-redirect.php.json 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain-redirect.php.json 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,11 +0,0 @@
-[
- {
- "action": {
- "type": "block"
- },
- "trigger": {
- "url-filter": ".*",
- "unless-domain": ["127.0.0.1"]
- }
- }
-]
Added: trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain-redirect.py (0 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain-redirect.py (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain-redirect.py 2021-03-30 15:20:22 UTC (rev 275204)
@@ -0,0 +1,9 @@
+#!/usr/bin/env python3
+
+import sys
+
+sys.stdout.write(
+ 'Location: http://localhost/contentextensions/resources/should-not-load.html\r\n'
+ 'status: 302\r\n'
+ 'Content-Type: text/html\r\n\r\n'
+)
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain-redirect.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Copied: trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain-redirect.py.json (from rev 275203, trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain-redirect.php.json) (0 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain-redirect.py.json (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain-redirect.py.json 2021-03-30 15:20:22 UTC (rev 275204)
@@ -0,0 +1,17 @@
+#!/usr/bin/env python3
+
+import sys
+
+sys.stdout.write('Content-Type: text/html\r\n\r\n')
+
+print('''[
+ {
+ "action": {
+ "type": "block"
+ },
+ "trigger": {
+ "url-filter": ".*",
+ "unless-domain": ["127.0.0.1"]
+ }
+ }
+]''')
\ No newline at end of file
Property changes: trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain-redirect.py.json
Added: svn:executable
+*
\ No newline at end of property
Modified: trunk/LayoutTests/http/tests/contentextensions/block-image-load-in-onunload-expected.txt (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-image-load-in-onunload-expected.txt 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-image-load-in-onunload-expected.txt 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,3 +1,3 @@
main frame - has 1 onunload handler(s)
-CONSOLE MESSAGE: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/block-image-load-in-onunload.html from loading a resource from http://127.0.0.1:8000/contentextensions/resources/save-ping.php?test=contentextensions-block-image-load-in-onunload
+CONSOLE MESSAGE: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/block-image-load-in-onunload.html from loading a resource from http://127.0.0.1:8000/contentextensions/resources/save-ping.py?test=contentextensions-block-image-load-in-onunload
Ping not received - timed out.
Modified: trunk/LayoutTests/http/tests/contentextensions/block-image-load-in-onunload.html (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-image-load-in-onunload.html 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-image-load-in-onunload.html 2021-03-30 15:20:22 UTC (rev 275204)
@@ -7,9 +7,9 @@
function loadNextPage() {
// Navigating to another location invokes the unload handler
- location.href = "" +
+ location.href = "" +
encodeURIComponent(
- "/contentextensions/resources/get-ping-data.php?" +
+ "/contentextensions/resources/get-ping-data.py?" +
"test=contentextensions-block-image-load-in-onunload&" +
"timeout_ms=1000&" +
"end_test=1");
@@ -21,7 +21,7 @@
function loadImage() {
var img = new Image(1, 1);
- img.src = ""
+ img.src = ""
}
</script>
</head>
@@ -28,6 +28,6 @@
<body _onunload_="loadImage();">
This test loads an image in onunload, where the image URL matches a 'block' rule.
-<img src="" _onerror_="loadNextPage();">
+<img src="" _onerror_="loadNextPage();">
</body>
Modified: trunk/LayoutTests/http/tests/contentextensions/block-image-load-in-onunload.html.json (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-image-load-in-onunload.html.json 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-image-load-in-onunload.html.json 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,7 +1,7 @@
[
{
"trigger": {
- "url-filter": "save-ping.php"
+ "url-filter": "save-ping.py"
},
"action": {
"type": "block"
Modified: trunk/LayoutTests/http/tests/contentextensions/block-ping-expected.txt (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-ping-expected.txt 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-ping-expected.txt 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/block-ping.html from loading a resource from http://127.0.0.1:8000/contentextensions/resources/save-ping.php?test=contentextensions-block-ping
+CONSOLE MESSAGE: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/block-ping.html from loading a resource from http://127.0.0.1:8000/contentextensions/resources/save-ping.py?test=contentextensions-block-ping
This test follows a link with a ping attribute where the ping URL matches a 'block' rule.
--------
Modified: trunk/LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping-expected.txt (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping-expected.txt 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping-expected.txt 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/block-ping-resource-type-ping.html from loading a resource from http://127.0.0.1:8000/contentextensions/resources/save-ping.php?test=contentextensions-block-ping-resource-type-ping
+CONSOLE MESSAGE: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/block-ping-resource-type-ping.html from loading a resource from http://127.0.0.1:8000/contentextensions/resources/save-ping.py?test=contentextensions-block-ping-resource-type-ping
ALERT: PASS: successfully loaded ping url with fetch
This test follows a link with a ping attribute where the ping URL matches a 'block' rule.
Modified: trunk/LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping.html (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping.html 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping.html 2021-03-30 15:20:22 UTC (rev 275204)
@@ -11,11 +11,11 @@
var iframe = document.getElementById("link_frame");
var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
iframeDoc.write('' +
- '<img src="" ' +
+ '<img src="" ' +
'_onerror_="parent.clickOnLinkWithPing();">' +
'<a id="a" ' +
'href="" ' + // check-ping.html calls showPingResult()
- 'ping="resources/save-ping.php?test=contentextensions-block-ping-resource-type-ping"> ' +
+ 'ping="resources/save-ping.py?test=contentextensions-block-ping-resource-type-ping"> ' +
'Link with ping' +
'</a>'
@@ -38,14 +38,14 @@
function showPingResult() {
var iframe = document.getElementById("result_frame");
iframe._onload_ = function() {
- fetch("resources/save-ping.php?test=contentextensions-block-ping-resource-type-ping").then(()=>{
- fetch("resources/delete-ping.php?test=contentextensions-block-ping-resource-type-ping").then(()=>{
+ fetch("resources/save-ping.py?test=contentextensions-block-ping-resource-type-ping").then(()=>{
+ fetch("resources/delete-ping.py?test=contentextensions-block-ping-resource-type-ping").then(()=>{
alert("PASS: successfully loaded ping url with fetch");
if (window.testRunner) { testRunner.notifyDone(); }
})
}).catch(error => { alert("FAIL:" + error); if (window.testRunner) { testRunner.notifyDone(); } });
}
- iframe.src = ""
+ iframe.src = ""
// Why timeout_ms=1000:
// To pass the test, the ping shouldn't arrive, so we need to
// timeout at some point. We don't have to wait too long because
Modified: trunk/LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping.html.json (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping.html.json 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping.html.json 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,7 +1,7 @@
[
{
"trigger": {
- "url-filter": "save-ping.php",
+ "url-filter": "save-ping.py",
"resource-type": ["ping"]
},
"action": {
Modified: trunk/LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw-expected.txt (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw-expected.txt 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw-expected.txt 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,7 +1,7 @@
-CONSOLE MESSAGE: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/block-ping-resource-type-raw.html from loading a resource from http://127.0.0.1:8000/contentextensions/resources/save-ping.php?test=contentextensions-block-ping-resource-type-raw
-CONSOLE MESSAGE: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/block-ping-resource-type-raw.html from loading a resource from http://127.0.0.1:8000/contentextensions/resources/save-ping.php?test=contentextensions-block-ping-resource-type-raw
+CONSOLE MESSAGE: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/block-ping-resource-type-raw.html from loading a resource from http://127.0.0.1:8000/contentextensions/resources/save-ping.py?test=contentextensions-block-ping-resource-type-raw
+CONSOLE MESSAGE: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/block-ping-resource-type-raw.html from loading a resource from http://127.0.0.1:8000/contentextensions/resources/save-ping.py?test=contentextensions-block-ping-resource-type-raw
CONSOLE MESSAGE: Resource blocked by content blocker
-CONSOLE MESSAGE: Fetch API cannot load http://127.0.0.1:8000/contentextensions/resources/save-ping.php?test=contentextensions-block-ping-resource-type-raw due to access control checks.
+CONSOLE MESSAGE: Fetch API cannot load http://127.0.0.1:8000/contentextensions/resources/save-ping.py?test=contentextensions-block-ping-resource-type-raw due to access control checks.
ALERT: PASS:TypeError: Resource blocked by content blocker
This test follows a link with a ping attribute where the ping URL matches a 'block' rule.
Modified: trunk/LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw.html (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw.html 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw.html 2021-03-30 15:20:22 UTC (rev 275204)
@@ -11,11 +11,11 @@
var iframe = document.getElementById("link_frame");
var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
iframeDoc.write('' +
- '<img src="" ' +
+ '<img src="" ' +
'_onerror_="parent.clickOnLinkWithPing();">' +
'<a id="a" ' +
'href="" ' + // check-ping.html calls showPingResult()
- 'ping="resources/save-ping.php?test=contentextensions-block-ping-resource-type-raw"> ' +
+ 'ping="resources/save-ping.py?test=contentextensions-block-ping-resource-type-raw"> ' +
'Link with ping' +
'</a>'
@@ -38,14 +38,14 @@
function showPingResult() {
var iframe = document.getElementById("result_frame");
iframe._onload_ = function() {
- fetch("resources/save-ping.php?test=contentextensions-block-ping-resource-type-raw").then(()=>{
- fetch("resources/delete-ping.php?test=contentextensions-block-ping-resource-type-raw").then(()=>{
+ fetch("resources/save-ping.py?test=contentextensions-block-ping-resource-type-raw").then(()=>{
+ fetch("resources/delete-ping.py?test=contentextensions-block-ping-resource-type-raw").then(()=>{
alert("FAIL: successfully loaded ping url with fetch");
if (window.testRunner) { testRunner.notifyDone(); }
})
}).catch(error => { alert("PASS:" + error); if (window.testRunner) { testRunner.notifyDone(); } });
}
- iframe.src = ""
+ iframe.src = ""
// Why timeout_ms=1000:
// To pass the test, the ping shouldn't arrive, so we need to
// timeout at some point. We don't have to wait too long because
Modified: trunk/LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw.html.json (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw.html.json 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw.html.json 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,7 +1,7 @@
[
{
"trigger": {
- "url-filter": "save-ping.php",
+ "url-filter": "save-ping.py",
"resource-type": ["raw"]
},
"action": {
Modified: trunk/LayoutTests/http/tests/contentextensions/block-ping.html (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-ping.html 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-ping.html 2021-03-30 15:20:22 UTC (rev 275204)
@@ -11,11 +11,11 @@
var iframe = document.getElementById("link_frame");
var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
iframeDoc.write('' +
- '<img src="" ' +
+ '<img src="" ' +
'_onerror_="parent.clickOnLinkWithPing();">' +
'<a id="a" ' +
'href="" ' + // check-ping.html calls showPingResult()
- 'ping="resources/save-ping.php?test=contentextensions-block-ping"> ' +
+ 'ping="resources/save-ping.py?test=contentextensions-block-ping"> ' +
'Link with ping' +
'</a>'
@@ -40,7 +40,7 @@
iframe._onload_ = function() {
if (window.testRunner) { testRunner.notifyDone(); }
}
- iframe.src = ""
+ iframe.src = ""
// Why timeout_ms=1000:
// To pass the test, the ping shouldn't arrive, so we need to
// timeout at some point. We don't have to wait too long because
Modified: trunk/LayoutTests/http/tests/contentextensions/block-ping.html.json (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/block-ping.html.json 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/block-ping.html.json 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,7 +1,7 @@
[
{
"trigger": {
- "url-filter": "save-ping.php"
+ "url-filter": "save-ping.py"
},
"action": {
"type": "block"
Modified: trunk/LayoutTests/http/tests/contentextensions/fetch-redirect-blocked.html (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/fetch-redirect-blocked.html 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/fetch-redirect-blocked.html 2021-03-30 15:20:22 UTC (rev 275204)
@@ -4,7 +4,7 @@
<script>
promise_test((test) => {
- return fetch("resources/subresource-redirect.php", { mode : "no-cors" }).then(() => {
+ return fetch("resources/subresource-redirect.py", { mode : "no-cors" }).then(() => {
assert_not_reached("fetch should fail");
}, (e) => {
assert_equals(e.message, "Blocked by Content Security Policy.");
Modified: trunk/LayoutTests/http/tests/contentextensions/hide-on-csp-report-expected.txt (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/hide-on-csp-report-expected.txt 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/hide-on-csp-report-expected.txt 2021-03-30 15:20:22 UTC (rev 275204)
@@ -9,5 +9,5 @@
--------
Ping received.
HTTP_HOST: localhost:8000
-REQUEST_URI: /contentextensions/resources/save-ping.php?test=contentextensions-hide-on-csp-report
+REQUEST_URI: /contentextensions/resources/save-ping.py?test=contentextensions-hide-on-csp-report
No cookies in ping.
Deleted: trunk/LayoutTests/http/tests/contentextensions/hide-on-csp-report.php (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/hide-on-csp-report.php 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/hide-on-csp-report.php 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,37 +0,0 @@
-<?php
- header("Content-Security-Policy: img-src 'self'; report-uri http://localhost:8000/contentextensions/resources/save-ping.php?test=contentextensions-hide-on-csp-report");
-?>
-<head>
-<script>
-if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.dumpChildFramesAsText();
- testRunner.waitUntilDone();
-}
-
-function loadCrossDomainImage() {
- // Trying to load an image from a different port
- // will result in a CSP violation.
- var img = new Image(1, 1);
- img.src = ""
- showPingResult();
-}
-
-function showPingResult() {
- var iframe = document.getElementById("result_frame");
- iframe._onload_ = function() {
- if (window.testRunner) { testRunner.notifyDone(); }
- }
- iframe.src = ""
-}
-</script>
-</head>
-
-<body>
-This test creates a CSP violation report, but the report URL matches a 'css-display-none' rule.
-<p class="foo">This text should be hidden once the report is sent.</p>
-<p class="bar">This text should remain visible.</p>
-<img src="" _onerror_="loadCrossDomainImage();">
-<iframe id="result_frame" name="result_frame"><!-- Will contain ping data received by server --></iframe>
-</body>
-
Deleted: trunk/LayoutTests/http/tests/contentextensions/hide-on-csp-report.php.json (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/hide-on-csp-report.php.json 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/hide-on-csp-report.php.json 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,11 +0,0 @@
-[
- {
- "trigger": {
- "url-filter": "save-ping.php"
- },
- "action": {
- "type": "css-display-none",
- "selector": ".foo"
- }
- }
-]
Copied: trunk/LayoutTests/http/tests/contentextensions/hide-on-csp-report.py (from rev 275203, trunk/LayoutTests/http/tests/contentextensions/hide-on-csp-report.php) (0 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/hide-on-csp-report.py (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/hide-on-csp-report.py 2021-03-30 15:20:22 UTC (rev 275204)
@@ -0,0 +1,42 @@
+#!/usr/bin/env python3
+
+import sys
+
+sys.stdout.write(
+ 'Content-Security-Policy: img-src \'self\'; report-uri http://localhost:8000/contentextensions/resources/save-ping.py?test=contentextensions-hide-on-csp-report\r\n'
+ 'Content-Type: text/html\r\n\r\n'
+)
+
+print('''<head>
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.dumpChildFramesAsText();
+ testRunner.waitUntilDone();
+}
+
+function loadCrossDomainImage() {
+ // Trying to load an image from a different port
+ // will result in a CSP violation.
+ var img = new Image(1, 1);
+ img.src = ""
+ showPingResult();
+}
+
+function showPingResult() {
+ var iframe = document.getElementById("result_frame");
+ iframe._onload_ = function() {
+ if (window.testRunner) { testRunner.notifyDone(); }
+ }
+ iframe.src = ""
+}
+</script>
+</head>
+
+<body>
+This test creates a CSP violation report, but the report URL matches a 'css-display-none' rule.
+<p class="foo">This text should be hidden once the report is sent.</p>
+<p class="bar">This text should remain visible.</p>
+<img src="" _onerror_="loadCrossDomainImage();">
+<iframe id="result_frame" name="result_frame"><!-- Will contain ping data received by server --></iframe>
+</body>''')
\ No newline at end of file
Property changes: trunk/LayoutTests/http/tests/contentextensions/hide-on-csp-report.py
Added: svn:executable
+*
\ No newline at end of property
Added: trunk/LayoutTests/http/tests/contentextensions/hide-on-csp-report.py.json (0 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/hide-on-csp-report.py.json (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/hide-on-csp-report.py.json 2021-03-30 15:20:22 UTC (rev 275204)
@@ -0,0 +1,17 @@
+#!/usr/bin/env python3
+
+import sys
+
+sys.stdout.write('Content-Type: text/html\r\n\r\n')
+
+print('''[
+ {
+ "trigger": {
+ "url-filter": "save-ping.py"
+ },
+ "action": {
+ "type": "css-display-none",
+ "selector": ".foo"
+ }
+ }
+]''')
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/contentextensions/hide-on-csp-report.py.json
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Modified: trunk/LayoutTests/http/tests/contentextensions/hide-on-ping-expected.txt (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/hide-on-ping-expected.txt 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/hide-on-ping-expected.txt 2021-03-30 15:20:22 UTC (rev 275204)
@@ -8,5 +8,5 @@
--------
Ping received.
HTTP_HOST: 127.0.0.1:8000
-REQUEST_URI: /contentextensions/resources/save-ping.php?test=contentextensions-hide-on-ping
+REQUEST_URI: /contentextensions/resources/save-ping.py?test=contentextensions-hide-on-ping
No cookies in ping.
Modified: trunk/LayoutTests/http/tests/contentextensions/hide-on-ping-with-ping-that-redirects-expected.txt (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/hide-on-ping-with-ping-that-redirects-expected.txt 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/hide-on-ping-with-ping-that-redirects-expected.txt 2021-03-30 15:20:22 UTC (rev 275204)
@@ -8,5 +8,5 @@
--------
Ping received.
HTTP_HOST: 127.0.0.1:8000
-REQUEST_URI: /contentextensions/resources/save-ping.php?test=contentextensions-hide-on-ping-with-ping-that-redirects
+REQUEST_URI: /contentextensions/resources/save-ping.py?test=contentextensions-hide-on-ping-with-ping-that-redirects
No cookies in ping.
Modified: trunk/LayoutTests/http/tests/contentextensions/hide-on-ping-with-ping-that-redirects.html (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/hide-on-ping-with-ping-that-redirects.html 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/hide-on-ping-with-ping-that-redirects.html 2021-03-30 15:20:22 UTC (rev 275204)
@@ -24,7 +24,7 @@
iframe._onload_ = function() {
if (window.testRunner) { testRunner.notifyDone(); }
}
- iframe.src = ""
+ iframe.src = ""
}
// We assume that if redirects were followed when saving a ping that they will complete within one second.
// FIXME: Is there are better way to test that a redirect occurred?
@@ -38,8 +38,8 @@
<div class="foo">This text should be hidden once the ping is sent.</div>
<div class="bar">This text should remain visible.</div>
<div>
-<img src="" _onerror_="clickOnLinkWithPing();">
-<a id="a" href="" ping="resources/save-ping-and-redirect-to-save-ping.php?test=contentextensions-hide-on-ping-with-ping-that-redirects" _onclick_="showPingResult();">Link with ping</a>
+<img src="" _onerror_="clickOnLinkWithPing();">
+<a id="a" href="" ping="resources/save-ping-and-redirect-to-save-ping.py?test=contentextensions-hide-on-ping-with-ping-that-redirects" _onclick_="showPingResult();">Link with ping</a>
</div>
<iframe id="result_frame" name="result_frame"><!-- Will contain ping data received by server --></iframe>
</body>
Modified: trunk/LayoutTests/http/tests/contentextensions/hide-on-ping-with-ping-that-redirects.html.json (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/hide-on-ping-with-ping-that-redirects.html.json 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/hide-on-ping-with-ping-that-redirects.html.json 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,7 +1,7 @@
[
{
"trigger": {
- "url-filter": "save-ping.php"
+ "url-filter": "save-ping.py"
},
"action": {
"type": "css-display-none",
Modified: trunk/LayoutTests/http/tests/contentextensions/hide-on-ping.html (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/hide-on-ping.html 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/hide-on-ping.html 2021-03-30 15:20:22 UTC (rev 275204)
@@ -23,7 +23,7 @@
iframe._onload_ = function() {
if (window.testRunner) { testRunner.notifyDone(); }
}
- iframe.src = ""
+ iframe.src = ""
}
</script>
</head>
@@ -33,8 +33,8 @@
<div class="foo">This text should be hidden once the ping is sent.</div>
<div class="bar">This text should remain visible.</div>
<div>
-<img src="" _onerror_="clickOnLinkWithPing();">
-<a id="a" href="" ping="resources/save-ping.php?test=contentextensions-hide-on-ping" _onclick_="showPingResult();">Link with ping</a>
+<img src="" _onerror_="clickOnLinkWithPing();">
+<a id="a" href="" ping="resources/save-ping.py?test=contentextensions-hide-on-ping" _onclick_="showPingResult();">Link with ping</a>
</div>
<iframe id="result_frame" name="result_frame"><!-- Will contain ping data received by server --></iframe>
</body>
Modified: trunk/LayoutTests/http/tests/contentextensions/hide-on-ping.html.json (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/hide-on-ping.html.json 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/hide-on-ping.html.json 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,7 +1,7 @@
[
{
"trigger": {
- "url-filter": "save-ping.php"
+ "url-filter": "save-ping.py"
},
"action": {
"type": "css-display-none",
Deleted: trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-blocked.php (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-blocked.php 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-blocked.php 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,4 +0,0 @@
-<?php
- header('Location: resources/main-resource-redirect-blocked-target.html');
- header('HTTP/1.0 302 Found');
-?>
Deleted: trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-blocked.php.json (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-blocked.php.json 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-blocked.php.json 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,10 +0,0 @@
-[
- {
- "action": {
- "type": "block"
- },
- "trigger": {
- "url-filter": ".*main-resource-redirect-blocked-target.html"
- }
- }
-]
Added: trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-blocked.py (0 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-blocked.py (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-blocked.py 2021-03-30 15:20:22 UTC (rev 275204)
@@ -0,0 +1,9 @@
+#!/usr/bin/env python3
+
+import sys
+
+sys.stdout.write(
+ 'Location: resources/main-resource-redirect-blocked-target.html\r\n'
+ 'status: 302\r\n'
+ 'Content-Type: text/html\r\n\r\n'
+)
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-blocked.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Copied: trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-blocked.py.json (from rev 275203, trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-blocked.php.json) (0 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-blocked.py.json (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-blocked.py.json 2021-03-30 15:20:22 UTC (rev 275204)
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+
+import sys
+
+sys.stdout.write(
+ 'Content-Type: text/html\r\n\r\n'
+)
+
+print('''[
+ {
+ "action": {
+ "type": "block"
+ },
+ "trigger": {
+ "url-filter": ".*main-resource-redirect-blocked-target.html"
+ }
+ }
+]''')
\ No newline at end of file
Property changes: trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-blocked.py.json
Added: svn:executable
+*
\ No newline at end of property
Modified: trunk/LayoutTests/http/tests/contentextensions/reload-without-contentextensions.html (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/reload-without-contentextensions.html 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/reload-without-contentextensions.html 2021-03-30 15:20:22 UTC (rev 275204)
@@ -17,7 +17,7 @@
async function doTest(shouldFail)
{
- const result = await fetch("resources/subresource-redirect.php", { mode : "no-cors" }).then(() => {
+ const result = await fetch("resources/subresource-redirect.py", { mode : "no-cors" }).then(() => {
return !shouldFail;
}, () => {
return shouldFail;
Deleted: trunk/LayoutTests/http/tests/contentextensions/resources/delete-ping.php (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/resources/delete-ping.php 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/resources/delete-ping.php 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,5 +0,0 @@
-<?php
-require_once 'ping-file-path.php';
-
-unlink($pingFilePath);
-?>
Added: trunk/LayoutTests/http/tests/contentextensions/resources/delete-ping.py (0 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/resources/delete-ping.py (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/resources/delete-ping.py 2021-03-30 15:20:22 UTC (rev 275204)
@@ -0,0 +1,10 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+from ping_file_path import ping_filepath
+
+if os.path.isfile(ping_filepath):
+ os.remove(ping_filepath)
+
+sys.stdout.write('Content-Type: text/html\r\n\r\n')
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/contentextensions/resources/delete-ping.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Deleted: trunk/LayoutTests/http/tests/contentextensions/resources/get-ping-data.php (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/resources/get-ping-data.php 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/resources/get-ping-data.php 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,50 +0,0 @@
-<?php
-require_once 'ping-file-path.php';
-
-$noTimeout = True;
-$timeoutMsecs = 0;
-if (isset($_GET['timeout_ms'])) {
- $noTimeout = False;
- $timeoutMsecs = (int) $_GET['timeout_ms'];
-}
-
-$pingFileFound = False;
-while ($noTimeout || $timeoutMsecs > 0) {
- if (file_exists($pingFilePath)) {
- $pingFileFound = True;
- break;
- }
- $sleepMsecs = 10;
- usleep($sleepMsecs * 1000);
- if (!$noTimeout) {
- $timeoutMsecs -= $sleepMsecs;
- }
- // file_exists() caches results, we want to invalidate the cache.
- clearstatcache();
-}
-
-
-echo "<html><body>\n";
-
-if ($pingFileFound) {
- echo "Ping received.";
- $pingFile = fopen($pingFilePath, 'r');
- while ($line = fgets($pingFile)) {
- echo "<br>";
- echo trim($line);
- }
- fclose($pingFile);
- unlink($pingFilePath);
-} else {
- echo "Ping not received - timed out.";
-}
-
-if (isset($_GET['end_test'])) {
- echo "<script>";
- echo "if (window.testRunner)";
- echo " testRunner.notifyDone();";
- echo "</script>";
-}
-
-echo "</body></html>";
-?>
Added: trunk/LayoutTests/http/tests/contentextensions/resources/get-ping-data.py (0 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/resources/get-ping-data.py (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/resources/get-ping-data.py 2021-03-30 15:20:22 UTC (rev 275204)
@@ -0,0 +1,54 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+import time
+from ping_file_path import ping_filepath
+from urllib.parse import parse_qs
+
+query = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True)
+timeout_ms = query.get('timeout_ms', [None])[0]
+end_test = query.get('end_test', [None])[0]
+
+no_timeout = True
+timeout_msecs = 0
+if timeout_ms is not None:
+ no_timeout = False
+ timeout_msecs = int(timeout_ms)
+
+ping_file_found = False
+while no_timeout or timeout_msecs > 0:
+ if os.path.isfile(ping_filepath):
+ ping_file_found = True
+ break
+
+ time.sleep(0.01)
+ if not no_timeout:
+ timeout_msecs -= 10
+
+sys.stdout.write(
+ 'Content-Type: text/html\r\n\r\n'
+ '<html><body>\n'
+)
+
+if ping_file_found:
+ sys.stdout.write('Ping received.')
+ ping_file = open(ping_filepath, 'r')
+ for line in ping_file.readlines():
+ sys.stdout.write('<br>{}'.format(line.strip()))
+
+ ping_file.close()
+ if os.path.isfile(ping_filepath):
+ os.remove(ping_filepath)
+else:
+ sys.stdout.write('Ping not received - timed out.')
+
+if end_test is not None:
+ sys.stdout.write(
+ '<script>'
+ 'if (window.testRunner)'
+ ' testRunner.notifyDone();'
+ '</script>'
+ )
+
+sys.stdout.write('</body></html>')
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/contentextensions/resources/get-ping-data.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Deleted: trunk/LayoutTests/http/tests/contentextensions/resources/ping-file-path.php (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/resources/ping-file-path.php 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/resources/ping-file-path.php 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,8 +0,0 @@
-<?php
-require_once '../../resources/portabilityLayer.php';
-
-if (isset($_GET['test'])) {
- $pingFilePath = sys_get_temp_dir() . "/" . str_replace("/", "-", $_GET['test']) . ".ping.txt";
-}
-
-?>
Added: trunk/LayoutTests/http/tests/contentextensions/resources/ping_file_path.py (0 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/resources/ping_file_path.py (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/resources/ping_file_path.py 2021-03-30 15:20:22 UTC (rev 275204)
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+
+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))))
+sys.path.insert(0, http_root)
+
+test = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True).get('test', [None])[0]
+
+if test is not None:
+ ping_filepath = os.path.join(tempfile.gettempdir(), '{}.ping.txt'.format(test.replace('/', '-')))
+else:
+ sys.stdout.write('Content-Type: text/html\r\n\r\n')
+ sys.exit(0)
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/contentextensions/resources/ping_file_path.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Deleted: trunk/LayoutTests/http/tests/contentextensions/resources/redirect.php (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/resources/redirect.php 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/resources/redirect.php 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,6 +0,0 @@
-<?php
-if (isset($_GET['to'])) {
- echo("<script>location.href=''to'] . "';</script>");
-}
-echo "<body>Redirecting</body>";
-?>
Added: trunk/LayoutTests/http/tests/contentextensions/resources/redirect.py (0 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/resources/redirect.py (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/resources/redirect.py 2021-03-30 15:20:22 UTC (rev 275204)
@@ -0,0 +1,14 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+from urllib.parse import parse_qs
+
+to = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True).get('to', [None])[0]
+
+sys.stdout.write('Content-Type: text/html\r\n\r\n')
+
+if to is not None:
+ sys.stdout.write('<script>location.href=""
+
+sys.stdout.write('<body>Redirecting</body>')
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/contentextensions/resources/redirect.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Deleted: trunk/LayoutTests/http/tests/contentextensions/resources/save-ping-and-redirect-to-save-ping.php (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/resources/save-ping-and-redirect-to-save-ping.php 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/resources/save-ping-and-redirect-to-save-ping.php 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,9 +0,0 @@
-<?php
-require_once 'ping-file-path.php';
-
-$DO_NOT_CLEAR_COOKIES = true;
-require_once 'save-ping.php';
-
-header('HTTP/1.1 307');
-header('Location: save-ping.php' . (isset($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : ''));
-?>
Added: trunk/LayoutTests/http/tests/contentextensions/resources/save-ping-and-redirect-to-save-ping.py (0 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/resources/save-ping-and-redirect-to-save-ping.py (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/resources/save-ping-and-redirect-to-save-ping.py 2021-03-30 15:20:22 UTC (rev 275204)
@@ -0,0 +1,17 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+from save_ping import save_ping
+
+query_string = os.environ.get('QUERY_STRING', None)
+if query_string is not None:
+ query_string = '?{}'.format(query_string)
+
+save_ping(True)
+
+sys.stdout.write(
+ 'status: 307\r\n'
+ 'Location: save-ping.py{}\r\n'
+ 'Content-Type: text/html\r\n\r\n'.format(query_string)
+)
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/contentextensions/resources/save-ping-and-redirect-to-save-ping.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Deleted: trunk/LayoutTests/http/tests/contentextensions/resources/save-ping.php (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/resources/save-ping.php 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/resources/save-ping.php 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,25 +0,0 @@
-<?php
-require_once 'ping-file-path.php';
-
-$pingFile = fopen($pingFilePath . ".tmp", 'w');
-$httpHeaders = $_SERVER;
-$cookiesFound = false;
-foreach ($httpHeaders as $name => $value) {
- if ($name === "HTTP_HOST" || $name === "REQUEST_URI")
- fwrite($pingFile, "$name: $value\n");
- else if ($name === "HTTP_COOKIE") {
- fwrite($pingFile, "Cookies in ping: $value\n");
- $cookiesFound = true;
- }
-}
-if (!$cookiesFound) {
- fwrite($pingFile, "No cookies in ping.\n");
-}
-fclose($pingFile);
-rename($pingFilePath . ".tmp", $pingFilePath);
-
-if (!isset($DO_NOT_CLEAR_COOKIES) || !$DO_NOT_CLEAR_COOKIES) {
- foreach ($_COOKIE as $name => $value)
- setcookie($name, "deleted", time() - 60, "/");
-}
-?>
Added: trunk/LayoutTests/http/tests/contentextensions/resources/save-ping.py (0 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/resources/save-ping.py (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/resources/save-ping.py 2021-03-30 15:20:22 UTC (rev 275204)
@@ -0,0 +1,4 @@
+#!/usr/bin/env python3
+
+from save_ping import save_ping
+save_ping(False)
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/contentextensions/resources/save-ping.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Added: trunk/LayoutTests/http/tests/contentextensions/resources/save_ping.py (0 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/resources/save_ping.py (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/resources/save_ping.py 2021-03-30 15:20:22 UTC (rev 275204)
@@ -0,0 +1,47 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+from datetime import datetime, timedelta
+from ping_file_path import ping_filepath
+
+def not_being_called():
+ cookies = {}
+ expires= datetime.utcnow() - timedelta(seconds=60)
+ if 'HTTP_COOKIE' in os.environ:
+ header_cookies = os.environ['HTTP_COOKIE']
+ header_cookies = header_cookies.split('; ')
+
+ for cookie in header_cookies:
+ cookie = cookie.split('=')
+ sys.stdout.write('Set-Cookie: {}=deleted; expires={} GMT; Max-Age=0; path=/\r\n'.format(cookie[0], expires.strftime('%a, %d-%b-%Y %H:%M:%S')))
+
+ sys.stdout.write('Content-Type: text/html\r\n\r\n')
+
+def save_ping(is_being_called):
+ ping_file = open('{}.tmp'.format(ping_filepath), 'w')
+ cookies_found = False
+
+ for name in os.environ.keys():
+ if name == 'HTTP_HOST':
+ ping_file.write('{}: {}\n'.format(name, os.environ.get(name)))
+ elif name == 'REQUEST_URI':
+ uri = os.environ.get(name)
+ if is_being_called:
+ uri = '/contentextensions/resources/save-ping.py?{}'.format(uri.split('?')[-1])
+ ping_file.write('{}: {}\n'.format(name, uri))
+ else:
+ ping_file.write('{}: {}\n'.format(name, uri))
+ elif name == 'HTTP_COOKIE':
+ ping_file.write('Cookies in ping: {}\n'.format(os.environ.get(name)))
+ cookies_found = True
+
+ if not cookies_found:
+ ping_file.write('No cookies in ping.\n')
+
+ ping_file.close()
+ if os.path.isfile('{}.tmp'.format(ping_filepath)):
+ os.rename('{}.tmp'.format(ping_filepath), ping_filepath)
+
+ if not is_being_called:
+ not_being_called()
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/contentextensions/resources/save_ping.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Deleted: trunk/LayoutTests/http/tests/contentextensions/resources/subresource-redirect.php (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/resources/subresource-redirect.php 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/resources/subresource-redirect.php 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,4 +0,0 @@
-<?php
- header('Location: http://localhost:8000/resources/square128.png');
- header('HTTP/1.0 302 Found');
-?>
Added: trunk/LayoutTests/http/tests/contentextensions/resources/subresource-redirect.py (0 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/resources/subresource-redirect.py (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/resources/subresource-redirect.py 2021-03-30 15:20:22 UTC (rev 275204)
@@ -0,0 +1,9 @@
+#!/usr/bin/env python3
+
+import sys
+
+sys.stdout.write(
+ 'Location: http://localhost:8000/resources/square128.png\r\n'
+ 'status: 302\r\n'
+ 'Content-Type: text/html\r\n\r\n'
+)
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/contentextensions/resources/subresource-redirect.py
___________________________________________________________________
Added: svn:executable
+*
\ No newline at end of property
Modified: trunk/LayoutTests/http/tests/contentextensions/subresource-redirect-blocked.html (275203 => 275204)
--- trunk/LayoutTests/http/tests/contentextensions/subresource-redirect-blocked.html 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/contentextensions/subresource-redirect-blocked.html 2021-03-30 15:20:22 UTC (rev 275204)
@@ -1,3 +1,3 @@
This page has an image.<br>
The image load should be blocked by the content extension filter<br>
-<img src=""
+<img src=""
Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/redirectToConversionOnIPAddress.py (275203 => 275204)
--- trunk/LayoutTests/http/tests/privateClickMeasurement/resources/redirectToConversionOnIPAddress.py 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/resources/redirectToConversionOnIPAddress.py 2021-03-30 15:20:22 UTC (rev 275204)
@@ -16,4 +16,4 @@
if conversion_data is not None and priority is not None:
sys.stdout.write('Location: https://127.0.0.1:8000/.well-known/private-click-measurement/trigger-attribution/{}/{}\r\n\r\n'.format(conversion_data, priority))
elif conversion_data is not None:
- sys.stodut.write('Location: https://127.0.0.1:8000/.well-known/private-click-measurement/trigger-attribution/{}\r\n\r\n'.format(conversion_data))
\ No newline at end of file
+ sys.stdout.write('Location: https://127.0.0.1:8000/.well-known/private-click-measurement/trigger-attribution/{}\r\n\r\n'.format(conversion_data))
\ No newline at end of file
Modified: trunk/LayoutTests/http/tests/resourceLoadStatistics/ping-to-prevalent-resource-expected.txt (275203 => 275204)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/ping-to-prevalent-resource-expected.txt 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/ping-to-prevalent-resource-expected.txt 2021-03-30 15:20:22 UTC (rev 275204)
@@ -20,5 +20,5 @@
--------
Ping received.
HTTP_HOST: localhost:8000
-REQUEST_URI: /contentextensions/resources/save-ping.php?test=ping-to-prevalent-resource
+REQUEST_URI: /contentextensions/resources/save-ping.py?test=ping-to-prevalent-resource
No cookies in ping.
Modified: trunk/LayoutTests/http/tests/resourceLoadStatistics/ping-to-prevalent-resource.html (275203 => 275204)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/ping-to-prevalent-resource.html 2021-03-30 14:12:07 UTC (rev 275203)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/ping-to-prevalent-resource.html 2021-03-30 15:20:22 UTC (rev 275204)
@@ -7,7 +7,7 @@
</head>
<body>
<div id="description">Tests that cookie blocking is applied to ping loads.</div>
-<a id="targetLink" href="" ping="http://localhost:8000/contentextensions/resources/save-ping.php?test=ping-to-prevalent-resource">The link</a>
+<a id="targetLink" href="" ping="http://localhost:8000/contentextensions/resources/save-ping.py?test=ping-to-prevalent-resource">The link</a>
<script>
if (testRunner)
testRunner.waitUntilDone();
@@ -70,10 +70,10 @@
case "#step5":
// Click the link to trigger the ping.
activateElement("targetLink", function() {
- openIframe(thirdPartyOrigin + "/contentextensions/resources/get-ping-data.php?test=ping-to-prevalent-resource", function() {
+ openIframe(thirdPartyOrigin + "/contentextensions/resources/get-ping-data.py?test=ping-to-prevalent-resource", function() {
document.body.removeChild(document.getElementById("targetLink"));
setEnableFeature(false, function() {
- fetch("/contentextensions/resources/delete-ping.php?test=ping-to-prevalent-resource").then(()=>{ testRunner.notifyDone(); });
+ fetch("/contentextensions/resources/delete-ping.py?test=ping-to-prevalent-resource").then(()=>{ testRunner.notifyDone(); });
});
});
});