Title: [274801] trunk/LayoutTests
Revision
274801
Author
cgambr...@apple.com
Date
2021-03-22 14:34:09 -0700 (Mon, 22 Mar 2021)

Log Message

[LayoutTests] Convert http/tests/privateClickMeasurement convert PHP to Python
https://bugs.webkit.org/show_bug.cgi?id=223575
<rdar://problem/75691545>

Reviewed by Alex Christensen.

* http/tests/contentextensions/block-private-click-measurement-expected.txt:
* http/tests/contentextensions/block-private-click-measurement.html:
* http/tests/privateClickMeasurement/attribution-conversion-through-cross-site-image-redirect.html:
* http/tests/privateClickMeasurement/attribution-conversion-through-fetch-keepalive.html:
* http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-with-priority.html:
* http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-without-priority.html:
* http/tests/privateClickMeasurement/clear-through-website-data-removal.html:
* http/tests/privateClickMeasurement/conversion-disabled-in-ephemeral-session.html:
* http/tests/privateClickMeasurement/expired-ad-click-gets-removed-on-session-start.html:
* http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start-expected.txt:
* http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start.html:
* http/tests/privateClickMeasurement/expired-attributions-removed.html:
* http/tests/privateClickMeasurement/resources/conversionFilePath.php: Removed.
* http/tests/privateClickMeasurement/resources/conversionFilePath.py: Added.
* http/tests/privateClickMeasurement/resources/conversionReport.php: Removed.
* http/tests/privateClickMeasurement/resources/conversionReport.py: Added.
* http/tests/privateClickMeasurement/resources/convertAndPostMessageBack.html:
* http/tests/privateClickMeasurement/resources/fraudPreventionTestURL.php: Removed.
* http/tests/privateClickMeasurement/resources/fraudPreventionTestURL.py: Added.
* http/tests/privateClickMeasurement/resources/getConversionData.php: Removed.
* http/tests/privateClickMeasurement/resources/getConversionData.py: Added.
* http/tests/privateClickMeasurement/resources/getTokenSigningData.php: Removed.
* http/tests/privateClickMeasurement/resources/getTokenSigningData.py: Added.
* http/tests/privateClickMeasurement/resources/redirectToConversion.php: Removed.
* http/tests/privateClickMeasurement/resources/redirectToConversion.py: Added.
* http/tests/privateClickMeasurement/resources/redirectToConversionOnIPAddress.php: Removed.
* http/tests/privateClickMeasurement/resources/redirectToConversionOnIPAddress.py: Added.
* http/tests/privateClickMeasurement/resources/tokenSigningFilePath.php: Removed.
* http/tests/privateClickMeasurement/resources/tokenSigningFilePath.py: Added.
* http/tests/privateClickMeasurement/second-attribution-converted-with-higher-priority.html:
* http/tests/privateClickMeasurement/second-attribution-converted-with-lower-priority.html:
* http/tests/privateClickMeasurement/second-conversion-with-higher-priority.html:
* http/tests/privateClickMeasurement/second-conversion-with-lower-priority.html:
* http/tests/privateClickMeasurement/send-attribution-conversion-request-expected.txt:
* http/tests/privateClickMeasurement/send-attribution-conversion-request.html:
* http/tests/privateClickMeasurement/store-private-click-measurement-with-source-nonce-expected.txt:
* http/tests/privateClickMeasurement/store-private-click-measurement-with-source-nonce.html:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (274800 => 274801)


--- trunk/LayoutTests/ChangeLog	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/ChangeLog	2021-03-22 21:34:09 UTC (rev 274801)
@@ -1,3 +1,49 @@
+2021-03-22  Chris Gambrell  <cgambr...@apple.com>
+
+        [LayoutTests] Convert http/tests/privateClickMeasurement convert PHP to Python
+        https://bugs.webkit.org/show_bug.cgi?id=223575
+        <rdar://problem/75691545>
+
+        Reviewed by Alex Christensen.
+
+        * http/tests/contentextensions/block-private-click-measurement-expected.txt:
+        * http/tests/contentextensions/block-private-click-measurement.html:
+        * http/tests/privateClickMeasurement/attribution-conversion-through-cross-site-image-redirect.html:
+        * http/tests/privateClickMeasurement/attribution-conversion-through-fetch-keepalive.html:
+        * http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-with-priority.html:
+        * http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-without-priority.html:
+        * http/tests/privateClickMeasurement/clear-through-website-data-removal.html:
+        * http/tests/privateClickMeasurement/conversion-disabled-in-ephemeral-session.html:
+        * http/tests/privateClickMeasurement/expired-ad-click-gets-removed-on-session-start.html:
+        * http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start-expected.txt:
+        * http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start.html:
+        * http/tests/privateClickMeasurement/expired-attributions-removed.html:
+        * http/tests/privateClickMeasurement/resources/conversionFilePath.php: Removed.
+        * http/tests/privateClickMeasurement/resources/conversionFilePath.py: Added.
+        * http/tests/privateClickMeasurement/resources/conversionReport.php: Removed.
+        * http/tests/privateClickMeasurement/resources/conversionReport.py: Added.
+        * http/tests/privateClickMeasurement/resources/convertAndPostMessageBack.html:
+        * http/tests/privateClickMeasurement/resources/fraudPreventionTestURL.php: Removed.
+        * http/tests/privateClickMeasurement/resources/fraudPreventionTestURL.py: Added.
+        * http/tests/privateClickMeasurement/resources/getConversionData.php: Removed.
+        * http/tests/privateClickMeasurement/resources/getConversionData.py: Added.
+        * http/tests/privateClickMeasurement/resources/getTokenSigningData.php: Removed.
+        * http/tests/privateClickMeasurement/resources/getTokenSigningData.py: Added.
+        * http/tests/privateClickMeasurement/resources/redirectToConversion.php: Removed.
+        * http/tests/privateClickMeasurement/resources/redirectToConversion.py: Added.
+        * http/tests/privateClickMeasurement/resources/redirectToConversionOnIPAddress.php: Removed.
+        * http/tests/privateClickMeasurement/resources/redirectToConversionOnIPAddress.py: Added.
+        * http/tests/privateClickMeasurement/resources/tokenSigningFilePath.php: Removed.
+        * http/tests/privateClickMeasurement/resources/tokenSigningFilePath.py: Added.
+        * http/tests/privateClickMeasurement/second-attribution-converted-with-higher-priority.html:
+        * http/tests/privateClickMeasurement/second-attribution-converted-with-lower-priority.html:
+        * http/tests/privateClickMeasurement/second-conversion-with-higher-priority.html:
+        * http/tests/privateClickMeasurement/second-conversion-with-lower-priority.html:
+        * http/tests/privateClickMeasurement/send-attribution-conversion-request-expected.txt:
+        * http/tests/privateClickMeasurement/send-attribution-conversion-request.html:
+        * http/tests/privateClickMeasurement/store-private-click-measurement-with-source-nonce-expected.txt:
+        * http/tests/privateClickMeasurement/store-private-click-measurement-with-source-nonce.html:
+
 2021-03-22  Wenson Hsieh  <wenson_hs...@apple.com>
 
         [iOS] Composition text is not initially highlighted when typing in text fields using Pinyin keyboard

Modified: trunk/LayoutTests/http/tests/contentextensions/block-private-click-measurement-expected.txt (274800 => 274801)


--- trunk/LayoutTests/http/tests/contentextensions/block-private-click-measurement-expected.txt	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/contentextensions/block-private-click-measurement-expected.txt	2021-03-22 21:34:09 UTC (rev 274801)
@@ -1,5 +1,5 @@
 CONSOLE MESSAGE: Blocked by content extension
-CONSOLE MESSAGE: Cannot load image https://127.0.0.1:8443/privateClickMeasurement/resources/redirectToConversion.php?conversionData=12 due to access control checks.
+CONSOLE MESSAGE: Cannot load image https://127.0.0.1:8443/privateClickMeasurement/resources/redirectToConversion.py?conversionData=12 due to access control checks.
 Tests that private click measurement redirects to well-known location don't trigger a conversion if they are blocked by content blockers.
 
 

Modified: trunk/LayoutTests/http/tests/contentextensions/block-private-click-measurement.html (274800 => 274801)


--- trunk/LayoutTests/http/tests/contentextensions/block-private-click-measurement.html	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/contentextensions/block-private-click-measurement.html	2021-03-22 21:34:09 UTC (rev 274801)
@@ -15,7 +15,7 @@
 
     if (window.testRunner) {
         testRunner.setPrivateClickMeasurementOverrideTimerForTesting(true);
-        testRunner.setPrivateClickMeasurementAttributionReportURLsForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/conversionReport.php", "http://localhost:8000/privateClickMeasurement/resources/conversionReport.php");
+        testRunner.setPrivateClickMeasurementAttributionReportURLsForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/conversionReport.py", "http://localhost:8000/privateClickMeasurement/resources/conversionReport.py");
     }
 
     function activateElement(elementID) {
@@ -45,7 +45,7 @@
         document.body.removeChild(document.getElementById("targetLink"));
         document.body.removeChild(document.getElementById("pixel"));
 
-        appendIframe("http://127.0.0.1:8000/privateClickMeasurement/resources/getConversionData.php?timeout_ms=1000", function() {
+        appendIframe("http://127.0.0.1:8000/privateClickMeasurement/resources/getConversionData.py?timeout_ms=1000", function() {
             tearDownAndFinish();
         });
     }
@@ -54,7 +54,7 @@
         if (window.testRunner) {
             if (window.location.search === "?stepTwo") {
                 let imageElement = document.createElement("img");
-                imageElement.src = ""
+                imageElement.src = ""
                 imageElement.id = "pixel";
                 imageElement._onerror_ = function() {
                     appendConversionDataIframeAndFinish();

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-cross-site-image-redirect.html (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-cross-site-image-redirect.html	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-cross-site-image-redirect.html	2021-03-22 21:34:09 UTC (rev 274801)
@@ -31,7 +31,7 @@
         if (window.testRunner) {
             if (window.location.search === "?stepTwo") {
                 let imageElement = document.createElement("img");
-                imageElement.src = ""
+                imageElement.src = ""
                 imageElement.id = "pixel";
                 imageElement._onerror_ = function(e) {
                     testRunner.dumpPrivateClickMeasurement();

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-fetch-keepalive.html (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-fetch-keepalive.html	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-fetch-keepalive.html	2021-03-22 21:34:09 UTC (rev 274801)
@@ -27,7 +27,7 @@
     }
 
     function triggerFetch(conversionData) {
-        return fetch("https://127.0.0.1:8443/privateClickMeasurement/resources/redirectToConversion.php?conversionData="+ conversionData + "&delay_ms=100", { keepalive: true });
+        return fetch("https://127.0.0.1:8443/privateClickMeasurement/resources/redirectToConversion.py?conversionData="+ conversionData + "&delay_ms=100", { keepalive: true });
     }
 
     function runTest() {

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-with-priority.html (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-with-priority.html	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-with-priority.html	2021-03-22 21:34:09 UTC (rev 274801)
@@ -31,7 +31,7 @@
         if (window.testRunner) {
             if (window.location.search === "?stepTwo") {
                 let imageElement = document.createElement("img");
-                imageElement.src = ""
+                imageElement.src = ""
                 imageElement.id = "pixel";
                 imageElement._onerror_ = function(e) {
                     testRunner.dumpPrivateClickMeasurement();

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-without-priority.html (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-without-priority.html	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-without-priority.html	2021-03-22 21:34:09 UTC (rev 274801)
@@ -31,7 +31,7 @@
         if (window.testRunner) {
             if (window.location.search === "?stepTwo") {
                 let imageElement = document.createElement("img");
-                imageElement.src = ""
+                imageElement.src = ""
                 imageElement.id = "pixel";
                 imageElement._onerror_ = function() {
                     testRunner.dumpPrivateClickMeasurement();

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/clear-through-website-data-removal.html (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/clear-through-website-data-removal.html	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/clear-through-website-data-removal.html	2021-03-22 21:34:09 UTC (rev 274801)
@@ -57,7 +57,7 @@
             } else if (window.location.search === "?stepTwo") {
                 // Convert the first ad click with priority 4, then do a reverse ad click.
                 let imageElement = document.createElement("img");
-                imageElement.src = ""
+                imageElement.src = ""
                 imageElement.id = "pixel";
                 imageElement._onerror_ = function(e) {
                     // Second ad click localhost –> 127.0.0.1.

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/conversion-disabled-in-ephemeral-session.html (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/conversion-disabled-in-ephemeral-session.html	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/conversion-disabled-in-ephemeral-session.html	2021-03-22 21:34:09 UTC (rev 274801)
@@ -18,7 +18,7 @@
     prepareTest();
 
     if (window.testRunner)
-        testRunner.setPrivateClickMeasurementAttributionReportURLsForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/conversionReport.php?nonce=" + nonce, "http://localhost:8000/privateClickMeasurement/resources/conversionReport.php?nonce=" + nonce);
+        testRunner.setPrivateClickMeasurementAttributionReportURLsForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/conversionReport.py?nonce=" + nonce, "http://localhost:8000/privateClickMeasurement/resources/conversionReport.py?nonce=" + nonce);
 
     function activateElement(elementID) {
         var element = document.getElementById(elementID);
@@ -46,7 +46,7 @@
         testRunner.dumpPrivateClickMeasurement();
         document.body.removeChild(document.getElementById("targetLink"));
 
-        appendIframe("http://127.0.0.1:8000/privateClickMeasurement/resources/getConversionData.php?timeout_ms=1000&nonce=" + nonce, function() {
+        appendIframe("http://127.0.0.1:8000/privateClickMeasurement/resources/getConversionData.py?timeout_ms=1000&nonce=" + nonce, function() {
             tearDownAndFinish();
         });
     }
@@ -58,7 +58,7 @@
                 window.location = "http://localhost:8000/privateClickMeasurement/conversion-disabled-in-ephemeral-session.html?stepThree";
             } else if (window.location.search === "?stepThree") {
                 let imageElement = document.createElement("img");
-                imageElement.src = "" + nonce;
+                imageElement.src = "" + nonce;
                 imageElement.id = "pixel";
                 imageElement._onerror_ = function() {
                     testRunner.setShouldSwapToDefaultSessionOnNextNavigation(true);

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/expired-ad-click-gets-removed-on-session-start.html (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/expired-ad-click-gets-removed-on-session-start.html	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/expired-ad-click-gets-removed-on-session-start.html	2021-03-22 21:34:09 UTC (rev 274801)
@@ -49,7 +49,7 @@
             document.body.removeChild(pixelElement);
 
         let imageElement = document.createElement("img");
-        imageElement.src = ""
+        imageElement.src = ""
         imageElement.id = "pixel";
         imageElement._onerror_ = callback;
         document.body.appendChild(imageElement);

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start-expected.txt (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start-expected.txt	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start-expected.txt	2021-03-22 21:34:09 UTC (rev 274801)
@@ -8,7 +8,7 @@
 Attribution received.
 HTTP_HOST: 127.0.0.1:8000
 Content type: application/json
-REQUEST_URI: /privateClickMeasurement/resources/conversionReport.php
+REQUEST_URI: /privateClickMeasurement/resources/conversionReport.py
 No cookies in attribution request.
 Request body:
 {"source_engagement_type":"click","source_site":"127.0.0.1","source_id":3,"attributed_on_site":"localhost","trigger_data":12,"version":2}

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start.html (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start.html	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start.html	2021-03-22 21:34:09 UTC (rev 274801)
@@ -18,7 +18,7 @@
     prepareTest();
 
     if (window.testRunner) {
-        testRunner.setPrivateClickMeasurementAttributionReportURLsForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/conversionReport.php?nonce=" + nonce, "http://localhost:8000/privateClickMeasurement/resources/conversionReport.php?nonce=" + nonce);
+        testRunner.setPrivateClickMeasurementAttributionReportURLsForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/conversionReport.py?nonce=" + nonce, "http://localhost:8000/privateClickMeasurement/resources/conversionReport.py?nonce=" + nonce);
     }
 
     function activateElement(elementID) {
@@ -52,7 +52,7 @@
         document.body.removeChild(document.getElementById("targetLink"));
         document.body.removeChild(document.getElementById("pixel"));
 
-        appendIframe("http://127.0.0.1:8000/privateClickMeasurement/resources/getConversionData.php?timeout_ms=2000&nonce=" + nonce, function() {
+        appendIframe("http://127.0.0.1:8000/privateClickMeasurement/resources/getConversionData.py?timeout_ms=2000&nonce=" + nonce, function() {
             tearDownAndFinish();
         });
     }
@@ -61,7 +61,7 @@
         if (window.testRunner) {
             if (window.location.search === "?stepTwo") {
                 let imageElement = document.createElement("img");
-                imageElement.src = "" + nonce;
+                imageElement.src = "" + nonce;
                 imageElement.id = "pixel";
                 imageElement._onerror_ = function() {
                     appendConversionDataIframeAndFinish();

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/expired-attributions-removed.html (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/expired-attributions-removed.html	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/expired-attributions-removed.html	2021-03-22 21:34:09 UTC (rev 274801)
@@ -32,7 +32,7 @@
             if (window.location.search === "?stepTwo") {
                 testRunner.markPrivateClickMeasurementsAsExpiredForTesting();
                 let imageElement = document.createElement("img");
-                imageElement.src = ""
+                imageElement.src = ""
                 imageElement.id = "pixel";
                 imageElement._onerror_ = function() {
                     testRunner.dumpPrivateClickMeasurement();

Deleted: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/conversionFilePath.php (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/resources/conversionFilePath.php	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/resources/conversionFilePath.php	2021-03-22 21:34:09 UTC (rev 274801)
@@ -1,9 +0,0 @@
-<?php
-require_once '../../resources/portabilityLayer.php';
-
-if (isset($_GET["nonce"]))
-    $conversionFileName = "/privateClickMeasurementConversion" . $_GET["nonce"] . ".txt";
-else
-    $conversionFileName = "/privateClickMeasurementConversion.txt";
-$conversionFilePath = sys_get_temp_dir() . $conversionFileName;
-?>

Added: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/conversionFilePath.py (0 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/resources/conversionFilePath.py	                        (rev 0)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/resources/conversionFilePath.py	2021-03-22 21:34:09 UTC (rev 274801)
@@ -0,0 +1,19 @@
+#!/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)
+
+nonce = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True).get('nonce', [None])[0]
+
+if nonce is not None:
+    conversion_file_name = 'privateClickMeasurementConversion{}.txt'.format(nonce)
+else:
+    conversion_file_name = 'privateClickMeasurementConversion.txt'
+
+conversion_file_path = os.path.join(tempfile.gettempdir(), conversion_file_name)
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/conversionFilePath.py
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Deleted: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/conversionReport.php (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/resources/conversionReport.php	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/resources/conversionReport.php	2021-03-22 21:34:09 UTC (rev 274801)
@@ -1,44 +0,0 @@
-<?php
-require_once 'conversionFilePath.php';
-
-$conversionFile = fopen($conversionFilePath . ".tmp", 'w');
-$httpHeaders = $_SERVER;
-$cookiesFound = false;
-
-if ($value = $httpHeaders["HTTP_HOST"]) {
-    fwrite($conversionFile, "HTTP_HOST: $value\n");
-}
-
-if ($value = $httpHeaders["HTTP_COOKIE"]) {
-    fwrite($conversionFile, "Cookies in attribution request: $value\n");
-    $cookiesFound = true;
-}
-
-if ($value = $httpHeaders["CONTENT_TYPE"]) {
-    fwrite($conversionFile, "Content type: $value\n");
-}
-
-if ($value = $httpHeaders["REQUEST_URI"]) {
-    $value = $httpHeaders["REQUEST_URI"];
-    $positionOfNonce = strpos($value, "?nonce=");
-    if ($positionOfNonce === false)
-        $outputURL = $value;
-    else
-        $outputURL = substr($value, 0, $positionOfNonce);
-    fwrite($conversionFile, "REQUEST_URI: $outputURL\n");
-}
-
-if (!$cookiesFound) {
-    fwrite($conversionFile, "No cookies in attribution request.\n");
-}
-
-$requestBody = file_get_contents('php://input');
-fwrite($conversionFile, "Request body:\n$requestBody\n");
-
-fclose($conversionFile);
-rename($conversionFilePath . ".tmp", $conversionFilePath);
-
-header("HTTP/1.1 200 OK");
-setcookie("cookieSetInConversionReport", "1", 0, "/");
-
-?>

Added: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/conversionReport.py (0 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/resources/conversionReport.py	                        (rev 0)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/resources/conversionReport.py	2021-03-22 21:34:09 UTC (rev 274801)
@@ -0,0 +1,52 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+from conversionFilePath import conversion_file_path
+
+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)
+
+request_body = ''.join(sys.stdin.readlines())
+conversion_file = open('{}.tmp'.format(conversion_file_path), 'w')
+cookies_found = False
+
+cookie = os.environ.get('HTTP_COOKIE', None)
+content_type = os.environ.get('CONTENT_TYPE', None)
+host = os.environ.get('HTTP_HOST', None)
+uri = os.environ.get('REQUEST_URI', None)
+
+if host is not None:
+    conversion_file.write('HTTP_HOST: {}\n'.format(host))
+
+if cookie is not None:
+    conversion_file.write('Cookies in attribution request: {}\n'.format(cookie))
+    cookies_found = True
+
+if content_type is not None:
+    conversion_file.write('Content type: {}\n'.format(content_type))
+
+if uri is not None:
+    position_of_nonce = uri.find('?nonce=')
+    if position_of_nonce == -1:
+        output_url = uri
+    else:
+        output_url = uri[0:position_of_nonce]
+
+    conversion_file.write('REQUEST_URI: {}\n'.format(output_url))
+
+if not cookies_found:
+    conversion_file.write('No cookies in attribution request.\n')
+
+conversion_file.write('Request body:\n{}\n'.format(request_body))
+conversion_file.close()
+
+if os.path.isfile('{}.tmp'.format(conversion_file_path)):
+    os.rename('{}.tmp'.format(conversion_file_path), conversion_file_path)
+
+sys.stdout.write(
+    'status: 200\r\n'
+    'Set-Cookie: cookieSetInConversionReport=1; path=/\r\n'
+    'Content-Type: text/html\r\n\r\n'
+)
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/conversionReport.py
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/convertAndPostMessageBack.html (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/resources/convertAndPostMessageBack.html	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/resources/convertAndPostMessageBack.html	2021-03-22 21:34:09 UTC (rev 274801)
@@ -5,7 +5,7 @@
     <script>
         function fireConversionPixel() {
             let imageElement = document.createElement("img");
-            imageElement.src = ""
+            imageElement.src = ""
             imageElement.id = "pixel";
             imageElement._onerror_ = function() {
                 document.body.removeChild(document.getElementById("pixel"));

Deleted: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/fraudPreventionTestURL.php (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/resources/fraudPreventionTestURL.php	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/resources/fraudPreventionTestURL.php	2021-03-22 21:34:09 UTC (rev 274801)
@@ -1,59 +0,0 @@
-<?php
-require_once "tokenSigningFilePath.php";
-
-$tokenSigningFile = fopen($tokenSigningFilePath . ".tmp", 'a');
-$httpHeaders = $_SERVER;
-$cookiesFound = false;
-// This php will respond to four consecutive server requests.
-// It will only complete the transaction when the last request finishes.
-$isLastRequest = false;
-
-if ($value = $httpHeaders["REQUEST_METHOD"]) {
-    fwrite($tokenSigningFile, "REQUEST_METHOD: $value\n");
-}
-
-if ($value = $httpHeaders["HTTP_HOST"]) {
-    fwrite($tokenSigningFile, "HTTP_HOST: $value\n");
-}
-
-if ($value = $httpHeaders["HTTP_COOKIE"]) {
-    fwrite($tokenSigningFile, "Cookies in token signing request: $value\n");
-    $cookiesFound = true;
-}
-
-if ($value = $httpHeaders["CONTENT_TYPE"]) {
-    fwrite($tokenSigningFile, "Content type: $value\n");
-}
-
-if ($value = $httpHeaders["REQUEST_URI"]) {
-    $value = $httpHeaders["REQUEST_URI"];
-    $positionOfDummy = strpos($value, "?dummy=");
-    if ($positionOfDummy === false)
-        $outputURL = $value;
-    else
-        $outputURL = substr($value, 0, $positionOfDummy);
-    fwrite($tokenSigningFile, "REQUEST_URI: $outputURL\n");
-
-    $positionOfDummy = strpos($value, "&last=");
-    if ($positionOfDummy != false)
-        $isLastRequest = true;
-}
-
-if (!$cookiesFound) {
-    fwrite($tokenSigningFile, "No cookies in token signing request.\n");
-}
-
-$requestBody = file_get_contents("php://input");
-fwrite($tokenSigningFile, "Request body:\n$requestBody\n");
-
-fclose($tokenSigningFile);
-// Complete the transaction.
-if ($isLastRequest)
-    rename($tokenSigningFilePath . ".tmp", $tokenSigningFilePath);
-
-header("HTTP/1.1 201 Created");
-header("unlinkable_token_public_key: ABCD");
-header("secret_token_signature: ABCD");
-setcookie("cookieSetInTokenSigningResponse", "1", 0, "/");
-
-?>

Added: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/fraudPreventionTestURL.py (0 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/resources/fraudPreventionTestURL.py	                        (rev 0)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/resources/fraudPreventionTestURL.py	2021-03-22 21:34:09 UTC (rev 274801)
@@ -0,0 +1,63 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+from tokenSigningFilePath import token_signing_filepath
+
+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)
+
+token_signing_file = open('{}.tmp'.format(token_signing_filepath), 'a')
+cookies_found = False
+is_last_request = False
+
+request_method = os.environ.get('REQUEST_METHOD', None)
+host = os.environ.get('HTTP_HOST', None)
+cookie = os.environ.get('HTTP_COOKIE', None)
+content_type = os.environ.get('CONTENT_TYPE', None)
+uri = os.environ.get('REQUEST_URI', None)
+
+if request_method:
+    token_signing_file.write('REQUEST_METHOD: {}\n'.format(request_method))
+
+if host:
+    token_signing_file.write('HTTP_HOST: {}\n'.format(host))
+
+if cookie:
+    token_signing_file.write('Cookies in token signing request: {}\n'.format(cookie))
+    cookies_found = True
+
+if content_type:
+    token_signing_file.write('Content type: {}\n'.format(content_type))
+
+if uri:
+    position_of_dummy = uri.find('?dummy=')
+    if position_of_dummy == -1:
+        output_url = uri
+    else:
+        output_url = uri[0:position_of_dummy]
+    token_signing_file.write('REQUEST_URI: {}\n'.format(output_url))
+
+    position_of_dummy = uri.find('&last=')
+    if position_of_dummy != -1:
+        is_last_request = True
+
+if not cookies_found:
+    token_signing_file.write('No cookies in token signing request.\n')
+
+request_body = ''.join(sys.stdin.readlines())
+token_signing_file.write('Request body:\n{}\n'.format(request_body))
+token_signing_file.close()
+
+if is_last_request:
+    if os.path.isfile('{}.tmp'.format(token_signing_filepath)):
+        os.rename('{}.tmp'.format(token_signing_filepath), token_signing_filepath)
+
+sys.stdout.write(
+    'status: 201\r\n'
+    'unlinkable_token_public_key: ABCD\r\n'
+    'secret_token_signature: ABCD\r\n'
+    'Set-Cookie: cookieSetInTokenSigningResponse=1; path=/\r\n'
+    'Content-Type: text/html\r\n\r\n'
+)
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/fraudPreventionTestURL.py
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Deleted: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/getConversionData.php (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/resources/getConversionData.php	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/resources/getConversionData.php	2021-03-22 21:34:09 UTC (rev 274801)
@@ -1,54 +0,0 @@
-<?php
-require_once 'conversionFilePath.php';
-
-$noTimeout = True;
-$timeoutMsecs = 0;
-if (isset($_GET['timeout_ms'])) {
-    $noTimeout = False;
-    $timeoutMsecs = (int) $_GET['timeout_ms'];
-}
-
-$conversionFileFound = False;
-while ($noTimeout || $timeoutMsecs > 0) {
-    if (file_exists($conversionFilePath)) {
-        $conversionFileFound = 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 ($conversionFileFound) {
-    echo "Attribution received.";
-    $conversionFile = fopen($conversionFilePath, 'r');
-    while ($line = fgets($conversionFile)) {
-        echo "<br>";
-        echo trim($line);
-    }
-    echo "<br>";
-    fclose($conversionFile);
-    unlink($conversionFilePath);
-} else {
-    echo "Attribution not received - timed out.<br>";
-}
-
-if (isset($_GET['endTest'])) {
-    echo "<script>";
-    echo "if (window.testRunner) {";
-    echo "    testRunner.notifyDone();";
-    echo "    testRunner.setPrivateClickMeasurementOverrideTimerForTesting(false);";
-    echo "    testRunner.setPrivateClickMeasurementAttributionReportURLsForTesting('', '');";
-    echo "}";
-    echo "</script>";
-}
-
-echo "</body></html>";
-?>

Added: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/getConversionData.py (0 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/resources/getConversionData.py	                        (rev 0)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/resources/getConversionData.py	2021-03-22 21:34:09 UTC (rev 274801)
@@ -0,0 +1,65 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+import time
+from conversionFilePath import conversion_file_path
+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)
+
+query = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True)
+timeout_ms = query.get('timeout_ms', [None])[0]
+end_test = query.get('endTest', [None])[0]
+
+no_timeout = True
+timeout_msecs = 0
+if timeout_ms is not None:
+    no_timeout = False
+    timeout_msecs = int(timeout_ms)
+
+conversion_file_found = False
+while no_timeout or timeout_msecs > 0:
+    if os.path.isfile(conversion_file_path):
+        conversion_file_found = True
+        break
+
+    sleep_msecs = 10
+    time.sleep(sleep_msecs * 0.001)
+    if not no_timeout:
+        timeout_msecs -= sleep_msecs
+
+sys.stdout.write(
+    'Content-Type: text/html\r\n\r\n'
+    '<html><body>\n'
+)
+
+if conversion_file_found:
+    sys.stdout.write('Attribution received.')
+
+    conversion_file = open(conversion_file_path, 'r')
+    for line in conversion_file.readlines():
+        sys.stdout.write('<br>{}'.format(line.strip()))
+    
+    sys.stdout.write('<br>')
+    
+    conversion_file.close()
+    if os.path.isfile(conversion_file_path):
+        os.remove(conversion_file_path)
+else:
+    sys.stdout.write('Attribution not received - timed out.<br>')
+
+if end_test is not None:
+    sys.stdout.write(
+        '<script>'
+        'if (window.testRunner) {'
+        '    testRunner.notifyDone();'
+        '    testRunner.setPrivateClickMeasurementOverrideTimerForTesting(false);'
+        '    testRunner.setPrivateClickMeasurementAttributionReportURLsForTesting(\'\', \'\');'
+        '}'
+        '</script>'
+    )
+
+sys.stdout.write('</body></html>')
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/getConversionData.py
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Deleted: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/getTokenSigningData.php (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/resources/getTokenSigningData.php	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/resources/getTokenSigningData.php	2021-03-22 21:34:09 UTC (rev 274801)
@@ -1,55 +0,0 @@
-<?php
-require_once 'tokenSigningFilePath.php';
-
-$noTimeout = True;
-$timeoutMsecs = 0;
-if (isset($_GET['timeout_ms'])) {
-    $noTimeout = False;
-    $timeoutMsecs = (int) $_GET['timeout_ms'];
-}
-
-$tokenSigningFileFound = False;
-while ($noTimeout || $timeoutMsecs > 0) {
-    if (file_exists($tokenSigningFilePath)) {
-        $tokenSigningFileFound = 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 ($tokenSigningFileFound) {
-    echo "Token signing request received.";
-    $tokenSigningFile = fopen($tokenSigningFilePath, 'r');
-    while ($line = fgets($tokenSigningFile)) {
-        echo "<br>";
-        echo trim($line);
-    }
-    echo "<br>";
-    fclose($tokenSigningFile);
-    unlink($tokenSigningFilePath);
-} else {
-    echo "Token signing request not received - timed out.<br>";
-}
-
-if (isset($_GET['endTest'])) {
-    echo "<script>";
-    echo "if (window.testRunner) {";
-    echo "    testRunner.setPrivateClickMeasurementOverrideTimerForTesting(false);";
-    echo "    testRunner.setPrivateClickMeasurementTokenPublicKeyURLForTesting('');";
-    echo "    testRunner.setPrivateClickMeasurementTokenSignatureURLForTesting('');";
-    echo "    testRunner.notifyDone();";
-    echo "}";
-    echo "</script>";
-}
-
-echo "</body></html>";
-?>

Added: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/getTokenSigningData.py (0 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/resources/getTokenSigningData.py	                        (rev 0)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/resources/getTokenSigningData.py	2021-03-22 21:34:09 UTC (rev 274801)
@@ -0,0 +1,65 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+import time
+from tokenSigningFilePath import token_signing_filepath
+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)
+
+query = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True)
+timeout_ms = query.get('timeout_ms', [None])[0]
+end_test = query.get('endTest', [None])[0]
+
+no_timeout = True
+timeout_msecs = 0
+
+if timeout_ms is not None:
+    no_timeout = False
+    timeout_msecs = int(timeout_ms)
+
+token_signing_file_found = False
+while no_timeout or timeout_msecs > 0:
+    if os.path.isfile(token_signing_filepath):
+        token_signing_file_found = True
+        break
+
+    time.sleep(0.01)
+    if no_timeout:
+        timeout_msecs -= 10
+
+sys.stdout.write(
+    'Content-Type: text/html\r\n\r\n'
+    '<html><body>\n'
+)
+
+if token_signing_file_found:
+    sys.stdout.write('Token signing request received.')
+
+    token_signing_file = open(token_signing_filepath, 'r')
+    for line in token_signing_file.readlines():
+        sys.stdout.write('<br>{}'.format(line.strip()))
+    sys.stdout.write('<br>')
+
+    token_signing_file.close()
+    if os.path.isfile(token_signing_filepath):
+        os.remove(token_signing_filepath)
+else:
+    sys.stdout.write('Token signing request not received - timed out.<br>')
+
+if end_test is not None:
+    sys.stdout.write(
+        '<script>'
+        'if (window.testRunner) {'
+        '    testRunner.setPrivateClickMeasurementOverrideTimerForTesting(false);'
+        '    testRunner.setPrivateClickMeasurementTokenPublicKeyURLForTesting(\'\');'
+        '    testRunner.setPrivateClickMeasurementTokenSignatureURLForTesting(\'\');'
+        '    testRunner.notifyDone();'
+        '}'
+        '</script>'
+    )
+
+sys.stdout.write('</body></html>')
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/getTokenSigningData.py
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Deleted: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/redirectToConversion.php (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/resources/redirectToConversion.php	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/resources/redirectToConversion.php	2021-03-22 21:34:09 UTC (rev 274801)
@@ -1,14 +0,0 @@
-<?php
-if (isset($_GET["delay_ms"])) {
-    usleep($_GET["delay_ms"] * 1000);
-}
-header("HTTP/1.1 302 Found");
-header("Cache-Control: no-cache, no-store, must-revalidate");
-header("Access-Control-Allow-Origin: *");
-header("Access-Control-Allow-Methods: GET");
-if (isset($_GET["conversionData"]) && isset($_GET["priority"])) {
-  header("Location: /.well-known/private-click-measurement/trigger-attribution/" . $_GET["conversionData"] . "/" . $_GET["priority"]);
-} else if (isset($_GET["conversionData"])) {
-  header("Location: /.well-known/private-click-measurement/trigger-attribution/" . $_GET["conversionData"]);
-}
-?>

Added: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/redirectToConversion.py (0 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/resources/redirectToConversion.py	                        (rev 0)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/resources/redirectToConversion.py	2021-03-22 21:34:09 UTC (rev 274801)
@@ -0,0 +1,29 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+import time
+from urllib.parse import parse_qs
+
+query = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True)
+delay_ms = query.get('delay_ms', [None])[0]
+conversion_data = query.get('conversionData', [None])[0]
+priority = query.get('priority', [None])[0]
+
+if delay_ms is not None:
+    time.sleep(int(delay_ms) * 0.001)
+
+sys.stdout.write(
+    'status: 302\r\n'
+    'Cache-Control: no-cache, no-store, must-revalidate\r\n'
+    'Access-Control-Allow-Origin: *\r\n'
+    'Access-Control-Allow-Methods: GET\r\n'
+    'Content-Type: text/html\r\n'
+)
+
+if conversion_data is not None and priority is not None:
+    sys.stdout.write('Location: /.well-known/private-click-measurement/trigger-attribution/{}/{}\r\n'.format(conversion_data, priority))
+elif conversion_data is not None:
+    sys.stdout.write('Location: /.well-known/private-click-measurement/trigger-attribution/{}\r\n'.format(conversion_data))
+
+sys.stdout.write('\r\n')
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/redirectToConversion.py
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Deleted: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/redirectToConversionOnIPAddress.php (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/resources/redirectToConversionOnIPAddress.php	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/resources/redirectToConversionOnIPAddress.php	2021-03-22 21:34:09 UTC (rev 274801)
@@ -1,8 +0,0 @@
-<?php
-header("HTTP/1.0 302 Found");
-if (isset($_GET["conversionData"]) && isset($_GET["priority"])) {
-  header("Location: https://127.0.0.1:8000/.well-known/private-click-measurement/trigger-attribution/" . $_GET["conversionData"] . "/" . $_GET["priority"]);
-} else if (isset($_GET["conversionData"])) {
-  header("Location: https://127.0.0.1:8000/.well-known/private-click-measurement/trigger-attribution/" . $_GET["conversionData"]);
-}
-?>

Added: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/redirectToConversionOnIPAddress.py (0 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/resources/redirectToConversionOnIPAddress.py	                        (rev 0)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/resources/redirectToConversionOnIPAddress.py	2021-03-22 21:34:09 UTC (rev 274801)
@@ -0,0 +1,19 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+from urllib.parse import parse_qs
+
+query = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True)
+conversion_data = query.get('conversionData', [None])[0]
+priority = query.get('priority', [None])[0]
+
+sys.stdout.write(
+    'status: 302\r\n'
+    'Content-Type: text/html\r\n'
+)
+
+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
Property changes on: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/redirectToConversionOnIPAddress.py
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Deleted: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/tokenSigningFilePath.php (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/resources/tokenSigningFilePath.php	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/resources/tokenSigningFilePath.php	2021-03-22 21:34:09 UTC (rev 274801)
@@ -1,9 +0,0 @@
-<?php
-require_once '../../resources/portabilityLayer.php';
-
-if (isset($_GET["dummy"]))
-    $tokenSigningFileName = "/privateClickMeasurementTokenSigningRequest" . $_GET["dummy"] . ".txt";
-else
-    $tokenSigningFileName = "/privateClickMeasurementTokenSigningRequest.txt";
-$tokenSigningFilePath = sys_get_temp_dir() . $tokenSigningFileName;
-?>

Added: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/tokenSigningFilePath.py (0 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/resources/tokenSigningFilePath.py	                        (rev 0)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/resources/tokenSigningFilePath.py	2021-03-22 21:34:09 UTC (rev 274801)
@@ -0,0 +1,15 @@
+#!/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)
+
+dummy = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True).get('dummy', [''])[0]
+
+token_signing_filename = 'privateClickMeasurementTokenSigningRequest{}.txt'.format(dummy)
+token_signing_filepath = os.path.join(tempfile.gettempdir(), token_signing_filename)
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/tokenSigningFilePath.py
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/second-attribution-converted-with-higher-priority.html (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/second-attribution-converted-with-higher-priority.html	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/second-attribution-converted-with-higher-priority.html	2021-03-22 21:34:09 UTC (rev 274801)
@@ -57,7 +57,7 @@
             } else if (window.location.search === "?stepTwo") {
                 // Convert the first ad click with priority 3 and navigate back to 127.0.0.1.
                 let imageElement = document.createElement("img");
-                imageElement.src = ""
+                imageElement.src = ""
                 imageElement.id = "pixel";
                 imageElement._onerror_ = function(e) {
                     document.location.href = "" + path + "?stepThree";
@@ -70,7 +70,7 @@
             } else if (window.location.search === "?stepFour") {
                 // Convert the second ad click with priority 4 and finish.
                 let imageElement = document.createElement("img");
-                imageElement.src = ""
+                imageElement.src = ""
                 imageElement.id = "pixel";
                 imageElement._onerror_ = function(e) {
                     testRunner.dumpPrivateClickMeasurement();

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/second-attribution-converted-with-lower-priority.html (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/second-attribution-converted-with-lower-priority.html	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/second-attribution-converted-with-lower-priority.html	2021-03-22 21:34:09 UTC (rev 274801)
@@ -57,7 +57,7 @@
             } else if (window.location.search === "?stepTwo") {
                 // Convert the first ad click with priority 4 and navigate back to 127.0.0.1.
                 let imageElement = document.createElement("img");
-                imageElement.src = ""
+                imageElement.src = ""
                 imageElement.id = "pixel";
                 imageElement._onerror_ = function(e) {
                     document.location.href = "" + path + "?stepThree";
@@ -70,7 +70,7 @@
             } else if (window.location.search === "?stepFour") {
                 // Convert the second ad click with priority 3 and finish.
                 let imageElement = document.createElement("img");
-                imageElement.src = ""
+                imageElement.src = ""
                 imageElement.id = "pixel";
                 imageElement._onerror_ = function(e) {
                     testRunner.dumpPrivateClickMeasurement();

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/second-conversion-with-higher-priority.html (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/second-conversion-with-higher-priority.html	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/second-conversion-with-higher-priority.html	2021-03-22 21:34:09 UTC (rev 274801)
@@ -49,7 +49,7 @@
             document.body.removeChild(pixelElement);
 
         let imageElement = document.createElement("img");
-        imageElement.src = "" + priority;
+        imageElement.src = "" + priority;
         imageElement.id = "pixel";
         imageElement._onerror_ = callback;
         document.body.appendChild(imageElement);

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/second-conversion-with-lower-priority.html (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/second-conversion-with-lower-priority.html	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/second-conversion-with-lower-priority.html	2021-03-22 21:34:09 UTC (rev 274801)
@@ -49,7 +49,7 @@
             document.body.removeChild(pixelElement);
 
         let imageElement = document.createElement("img");
-        imageElement.src = "" + priority;
+        imageElement.src = "" + priority;
         imageElement.id = "pixel";
         imageElement._onerror_ = callback;
         document.body.appendChild(imageElement);

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/send-attribution-conversion-request-expected.txt (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/send-attribution-conversion-request-expected.txt	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/send-attribution-conversion-request-expected.txt	2021-03-22 21:34:09 UTC (rev 274801)
@@ -13,7 +13,7 @@
 Attribution received.
 HTTP_HOST: 127.0.0.1:8000
 Content type: application/json
-REQUEST_URI: /privateClickMeasurement/resources/conversionReport.php
+REQUEST_URI: /privateClickMeasurement/resources/conversionReport.py
 No cookies in attribution request.
 Request body:
 {"source_engagement_type":"click","source_site":"127.0.0.1","source_id":3,"attributed_on_site":"localhost","trigger_data":12,"version":2}

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/send-attribution-conversion-request.html (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/send-attribution-conversion-request.html	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/send-attribution-conversion-request.html	2021-03-22 21:34:09 UTC (rev 274801)
@@ -49,7 +49,7 @@
         document.body.removeChild(document.getElementById("pixel"));
 
         appendIframe("http://127.0.0.1:8000/cookies/resources/echo-cookies.php");
-        appendIframe("http://127.0.0.1:8000/privateClickMeasurement/resources/getConversionData.php?timeout_ms=2000&nonce=" + nonce, function() {
+        appendIframe("http://127.0.0.1:8000/privateClickMeasurement/resources/getConversionData.py?timeout_ms=2000&nonce=" + nonce, function() {
             appendIframe("http://127.0.0.1:8000/cookies/resources/echo-cookies.php", function() {
                 tearDownAndFinish();
             });
@@ -59,9 +59,9 @@
     function runTest() {
         if (window.testRunner) {
             if (window.location.search === "?stepTwo") {
-                testRunner.setPrivateClickMeasurementAttributionReportURLsForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/conversionReport.php?nonce=" + nonce, "http://localhost:8000/privateClickMeasurement/resources/conversionReport.php?nonce=" + nonce);
+                testRunner.setPrivateClickMeasurementAttributionReportURLsForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/conversionReport.py?nonce=" + nonce, "http://localhost:8000/privateClickMeasurement/resources/conversionReport.py?nonce=" + nonce);
                 let imageElement = document.createElement("img");
-                imageElement.src = "" + nonce;
+                imageElement.src = "" + nonce;
                 imageElement.id = "pixel";
                 imageElement._onerror_ = function() {
                     appendConversionDataIframeAndFinish();

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/store-private-click-measurement-with-source-nonce-expected.txt (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/store-private-click-measurement-with-source-nonce-expected.txt	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/store-private-click-measurement-with-source-nonce-expected.txt	2021-03-22 21:34:09 UTC (rev 274801)
@@ -8,7 +8,7 @@
 Token signing request received.
 REQUEST_METHOD: GET
 HTTP_HOST: 127.0.0.1:8000
-REQUEST_URI: /privateClickMeasurement/resources/fraudPreventionTestURL.php
+REQUEST_URI: /privateClickMeasurement/resources/fraudPreventionTestURL.py
 No cookies in token signing request.
 Request body:
 
@@ -15,13 +15,13 @@
 REQUEST_METHOD: POST
 HTTP_HOST: 127.0.0.1:8000
 Content type: application/json
-REQUEST_URI: /privateClickMeasurement/resources/fraudPreventionTestURL.php
+REQUEST_URI: /privateClickMeasurement/resources/fraudPreventionTestURL.py
 No cookies in token signing request.
 Request body:
 {"source_engagement_type":"click","source_nonce":"ABCDEFabcdef0123456789","source_unlinkable_token":"unlinkableToken","version":2}
 REQUEST_METHOD: GET
 HTTP_HOST: 127.0.0.1:8000
-REQUEST_URI: /privateClickMeasurement/resources/fraudPreventionTestURL.php
+REQUEST_URI: /privateClickMeasurement/resources/fraudPreventionTestURL.py
 No cookies in token signing request.
 Request body:
 
@@ -28,7 +28,7 @@
 REQUEST_METHOD: POST
 HTTP_HOST: 127.0.0.1:8000
 Content type: application/json
-REQUEST_URI: /privateClickMeasurement/resources/fraudPreventionTestURL.php
+REQUEST_URI: /privateClickMeasurement/resources/fraudPreventionTestURL.py
 No cookies in token signing request.
 Request body:
 {"source_engagement_type":"click","source_site":"127.0.0.1","source_id":3,"attributed_on_site":"localhost","trigger_data":12,"version":2,"source_secret_token":"secretToken","source_secret_token_signature":"signature"}

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/store-private-click-measurement-with-source-nonce.html (274800 => 274801)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/store-private-click-measurement-with-source-nonce.html	2021-03-22 21:23:38 UTC (rev 274800)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/store-private-click-measurement-with-source-nonce.html	2021-03-22 21:34:09 UTC (rev 274801)
@@ -41,7 +41,7 @@
     }
 
     function appendTokenSignatureIframeAndFinish(dummy) {
-        appendIframe("http://127.0.0.1:8000/privateClickMeasurement/resources/getTokenSigningData.php?timeout_ms=4000&dummy=" + dummy, function() {
+        appendIframe("http://127.0.0.1:8000/privateClickMeasurement/resources/getTokenSigningData.py?timeout_ms=4000&dummy=" + dummy, function() {
             testRunner.dumpPrivateClickMeasurement();
             document.body.removeChild(document.getElementById("targetLink"));
             tearDownAndFinish();
@@ -51,9 +51,9 @@
     function runTest() {
         if (window.testRunner) {
             if (!window.location.search) {
-                testRunner.setPrivateClickMeasurementTokenPublicKeyURLForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/fraudPreventionTestURL.php?dummy=" + dummy);
-                testRunner.setPrivateClickMeasurementTokenSignatureURLForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/fraudPreventionTestURL.php?dummy=" + dummy);
-                testRunner.setPrivateClickMeasurementAttributionReportURLsForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/fraudPreventionTestURL.php?dummy=" + dummy + "&last=true", "http://localhost:8000/privateClickMeasurement/resources/fraudPreventionTestURL.php?dummy=" + dummy + "&last=true");
+                testRunner.setPrivateClickMeasurementTokenPublicKeyURLForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/fraudPreventionTestURL.py?dummy=" + dummy);
+                testRunner.setPrivateClickMeasurementTokenSignatureURLForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/fraudPreventionTestURL.py?dummy=" + dummy);
+                testRunner.setPrivateClickMeasurementAttributionReportURLsForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/fraudPreventionTestURL.py?dummy=" + dummy + "&last=true", "http://localhost:8000/privateClickMeasurement/resources/fraudPreventionTestURL.py?dummy=" + dummy + "&last=true");
                 testRunner.setPrivateClickMeasurementOverrideTimerForTesting(true);
                 testRunner.setPrivateClickMeasurementFraudPreventionValuesForTesting("unlinkableToken", "secretToken", "signature", "WF3Ugg");
 
@@ -63,7 +63,7 @@
                 let params = new URLSearchParams(window.location.search);
 
                 let imageElement = document.createElement("img");
-                imageElement.src = "" + dummy + "&delay_ms=500";
+                imageElement.src = "" + dummy + "&delay_ms=500";
                 imageElement.id = "pixel";
                 imageElement._onerror_ = function() {
                     appendTokenSignatureIframeAndFinish(params.get("dummy"));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to