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

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

Issue 232053005: Implement navigator.sendBeacon() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Adjust unrelated test expectation Created 6 years, 8 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: LayoutTests/http/tests/navigation/resources/check-beacon.php
diff --git a/LayoutTests/http/tests/navigation/resources/check-beacon.php b/LayoutTests/http/tests/navigation/resources/check-beacon.php
new file mode 100644
index 0000000000000000000000000000000000000000..aadf62a2674c46c6c1743f19a7d5bb544512bf60
--- /dev/null
+++ b/LayoutTests/http/tests/navigation/resources/check-beacon.php
@@ -0,0 +1,19 @@
+<?php
+$beaconFilename = "beacon" . (isset($_REQUEST['name']) ? $_REQUEST['name'] : "") . ".txt";
+while (!file_exists($beaconFilename)) {
+ usleep(10000);
+ // file_exists() caches results, we want to invalidate the cache.
+ clearstatcache();
+}
+
+header('Content-Type: text/plain');
+echo "Beacon sent successfully\n";
+$beaconFile = fopen($beaconFilename, 'r');
+while ($line = fgets($beaconFile)) {
+ $trimmed = trim($line);
+ if ($trimmed != "")
+ echo "$trimmed\n";
+}
+fclose($beaconFile);
+unlink($beaconFilename);
+?>

Powered by Google App Engine
This is Rietveld 408576698