Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(485)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/navigation/resources/check-beacon.php

Issue 2702113003: Move tests for sendBeacon to a separate dedicated directory for clearer ownership (Closed)
Patch Set: a Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/navigation/resources/check-beacon.php
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigation/resources/check-beacon.php b/third_party/WebKit/LayoutTests/http/tests/navigation/resources/check-beacon.php
deleted file mode 100644
index 9b42b96672311573eb3e85c40ae336a42c145479..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/http/tests/navigation/resources/check-beacon.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-require_once '../../resources/portabilityLayer.php';
-
-$beaconFilename = sys_get_temp_dir() . "/beacon" . (isset($_REQUEST['name']) ? $_REQUEST['name'] : "") . ".txt";
-
-$max_attempts = 700;
-$retries = isset($_REQUEST['retries']) ? (int)$_REQUEST['retries'] : $max_attempts;
-while (!file_exists($beaconFilename) && $retries != 0) {
- usleep(10000);
- # file_exists() caches results, we want to invalidate the cache.
- clearstatcache();
- $retries--;
-}
-
-header('Content-Type: text/plain');
-header('Access-Control-Allow-Origin: *');
-if (file_exists($beaconFilename)) {
- $beaconFile = false;
- if (is_readable($beaconFilename)) {
- $beaconFile = fopen($beaconFilename, 'r');
- }
- if ($beaconFile) {
- echo "Beacon sent successfully\n";
- while ($line = fgets($beaconFile)) {
- $trimmed = trim($line);
- if ($trimmed != "")
- echo "$trimmed\n";
- }
- fclose($beaconFile);
- unlink($beaconFilename);
- } else {
- echo "Beacon status not readable\n";
- }
-} else {
- echo "Beacon not sent\n";
-}
-?>

Powered by Google App Engine
This is Rietveld 408576698