Changeset 244325 in webkit
- Timestamp:
- Apr 15, 2019, 9:24:23 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/tests/adClickAttribution/resources/conversionFilePath.php (modified) (1 diff)
-
LayoutTests/http/tests/adClickAttribution/resources/conversionReport.php (modified) (1 diff)
-
LayoutTests/http/tests/adClickAttribution/resources/getConversionData.php (modified) (1 diff)
-
LayoutTests/http/tests/adClickAttribution/send-attribution-conversion-request.html (modified) (4 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/loader/AdClickAttribution.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r244312 r244325 1 2019-04-15 John Wilander <wilander@apple.com> 2 3 Add a query string nonce to LayoutTests/http/tests/adClickAttribution/send-attribution-conversion-request.html to address flakiness 4 https://bugs.webkit.org/show_bug.cgi?id=196955 5 6 Unreviewed test gardening. 7 8 * http/tests/adClickAttribution/resources/conversionFilePath.php: 9 * http/tests/adClickAttribution/resources/conversionReport.php: 10 * http/tests/adClickAttribution/resources/getConversionData.php: 11 * http/tests/adClickAttribution/send-attribution-conversion-request.html: 12 1 13 2019-04-15 Devin Rousso <drousso@apple.com> 2 14 -
trunk/LayoutTests/http/tests/adClickAttribution/resources/conversionFilePath.php
r244288 r244325 2 2 require_once '../../resources/portabilityLayer.php'; 3 3 4 $conversionFilePath = sys_get_temp_dir() . "/adClickConversion.txt"; 5 4 if (isset($_GET["nonce"])) 5 $conversionFileName = "/adClickConversion" . $_GET["nonce"] . ".txt"; 6 else 7 $conversionFileName = "/adClickConversion.txt"; 8 $conversionFilePath = sys_get_temp_dir() . $conversionFileName; 6 9 ?> -
trunk/LayoutTests/http/tests/adClickAttribution/resources/conversionReport.php
r244288 r244325 6 6 $cookiesFound = false; 7 7 foreach ($httpHeaders as $name => $value) { 8 if ($name === "HTTP_HOST" || $name === "REQUEST_URI")8 if ($name === "HTTP_HOST") { 9 9 fwrite($conversionFile, "$name: $value\n"); 10 else if ($name === "HTTP_COOKIE") { 10 } else if ($name === "REQUEST_URI") { 11 $positionOfNonce = strpos($value, "&nonce="); 12 if ($positionOfNonce === false) 13 $outputURL = $value; 14 else 15 $outputURL = substr($value, 0, $positionOfNonce); 16 fwrite($conversionFile, "$name: $outputURL\n"); 17 } else if ($name === "HTTP_COOKIE") { 11 18 fwrite($conversionFile, "Cookies in conversion request: $value\n"); 12 19 $cookiesFound = true; -
trunk/LayoutTests/http/tests/adClickAttribution/resources/getConversionData.php
r244288 r244325 37 37 unlink($conversionFilePath); 38 38 } else { 39 echo "Conversion not received - timed out. ";39 echo "Conversion not received - timed out.<br>"; 40 40 } 41 41 -
trunk/LayoutTests/http/tests/adClickAttribution/send-attribution-conversion-request.html
r244288 r244325 11 11 <div id="output"></div> 12 12 <script> 13 const currentTimeMillis = (new Date()).getTime(); 14 const highEntropyBits = currentTimeMillis - (Math.floor(currentTimeMillis / 1000000) * 1000000); 15 const nonce = highEntropyBits + "" + Math.floor(Math.random() * 100); 16 13 17 if (window.testRunner) { 14 18 testRunner.waitUntilDone(); … … 16 20 testRunner.setAllowsAnySSLCertificate(true); 17 21 testRunner.setAdClickAttributionOverrideTimerForTesting(true); 18 testRunner.setAdClickAttributionConversionURLForTesting("http://127.0.0.1:8000/adClickAttribution/resources/conversionReport.php");19 22 } 20 23 … … 39 42 40 43 let iframeElement = document.createElement("iframe"); 41 iframeElement.src = "http://127.0.0.1:8000/adClickAttribution/resources/getConversionData.php?endTest=true&timeout_ms=2000 ";44 iframeElement.src = "http://127.0.0.1:8000/adClickAttribution/resources/getConversionData.php?endTest=true&timeout_ms=2000&nonce=" + nonce; 42 45 document.body.appendChild(iframeElement); 43 46 } … … 46 49 if (window.testRunner) { 47 50 if (window.location.search === "?stepTwo") { 51 testRunner.setAdClickAttributionConversionURLForTesting("http://127.0.0.1:8000/adClickAttribution/resources/conversionReport.php?nonce=" + nonce); 48 52 let imageElement = document.createElement("img"); 49 53 imageElement.src = "https://127.0.0.1:8443/adClickAttribution/resources/redirectToConversion.php?conversionData=12"; -
trunk/Source/WebCore/ChangeLog
r244321 r244325 1 2019-04-15 John Wilander <wilander@apple.com> 2 3 Add a query string nonce to LayoutTests/http/tests/adClickAttribution/send-attribution-conversion-request.html to address flakiness 4 https://bugs.webkit.org/show_bug.cgi?id=196955 5 6 Unreviewed test gardening. The WebCore change is only in a dedicated 7 test function. 8 9 No new tests. Existing test updated. 10 11 * loader/AdClickAttribution.cpp: 12 (WebCore::AdClickAttribution::urlForTesting const): 13 Now preserves the query string in the test URL. 14 1 15 2019-04-15 Chris Dumez <cdumez@apple.com> 2 16 -
trunk/Source/WebCore/loader/AdClickAttribution.cpp
r244288 r244325 142 142 builder.appendLiteral("&campaign="); 143 143 builder.appendNumber(m_campaign.id); 144 if (baseURL.hasQuery()) { 145 builder.append('&'); 146 builder.append(baseURL.query()); 147 } 144 148 return URL(baseURL, builder.toString()); 145 149 }
Note:
See TracChangeset
for help on using the changeset viewer.