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

Side by Side Diff: LayoutTests/http/tests/navigation/resources/check-ping.php

Issue 334113003: Deflake http/tests/navigation/ping-*. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <?php 1 <?php
2 require_once '../../resources/portabilityLayer.php'; 2 require_once '../../resources/portabilityLayer.php';
3 3
4 $pingFilename = sys_get_temp_dir() . "/ping.txt"; 4 $pingFilename = sys_get_temp_dir() . "/ping." . $_GET["test"];
5 while (!file_exists($pingFilename)) { 5 while (!file_exists($pingFilename)) {
6 usleep(10000); 6 usleep(10000);
7 // file_exists() caches results, we want to invalidate the cache. 7 // file_exists() caches results, we want to invalidate the cache.
8 clearstatcache(); 8 clearstatcache();
9 } 9 }
10 10
11 echo "<html><body>\n"; 11 echo "<html><body>\n";
12 $pingFile = fopen($pingFilename, 'r'); 12 $pingFile = fopen($pingFilename, 'r');
13 if ($pingFile) { 13 if ($pingFile) {
14 echo "Ping sent successfully"; 14 echo "Ping sent successfully";
15 while ($line = fgets($pingFile)) { 15 while ($line = fgets($pingFile)) {
16 echo "<br>"; 16 echo "<br>";
17 echo trim($line); 17 echo trim($line);
18 } 18 }
19 fclose($pingFile); 19 fclose($pingFile);
20 unlink($pingFilename); 20 unlink($pingFilename);
21 } else { 21 } else {
22 echo "Ping not sent"; 22 echo "Ping not sent";
23 } 23 }
24 echo "<script>"; 24 echo "<script>";
25 echo "if (window.testRunner)"; 25 echo "if (window.testRunner)";
26 echo " testRunner.notifyDone();"; 26 echo " testRunner.notifyDone();";
27 echo "</script>"; 27 echo "</script>";
28 echo "</body></html>"; 28 echo "</body></html>";
29 ?> 29 ?>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698