OLD | NEW |
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 ?> |
OLD | NEW |