File.lastModifiedDate must return null if the modified time info is not available
[WebKit-https.git] / LayoutTests / http / tests / local / fileapi / resources / temp-file-utils.js
1 function createTempFile(fileName, fileData)
2 {
3     var xhr = new XMLHttpRequest();
4     xhr.open("POST", "http://127.0.0.1:8000/resources/write-temp-file.php?filename=" + fileName + "&data=" + fileData, false);
5     xhr.send();
6     if (xhr.status != 200) {
7         testFailed("Unexpected response status received: " + xhr.status);
8         return;
9     }
10
11     var values = xhr.responseText.split('\n');
12     if (xhr.responseText.indexOf("FAIL") == 0) {
13         testFailed("Unexpected response text received: " + xhr.responseText);
14         return;
15     }
16
17     return xhr.responseText;
18 }
19
20 function touchTempFile(fileName)
21 {
22     var xhr = new XMLHttpRequest();
23     xhr.open("POST", "http://127.0.0.1:8000/resources/touch-temp-file.php?filename=" + fileName, false);
24     xhr.send();
25 }
26
27 function removeTempFile(fileName)
28 {
29     var xhr = new XMLHttpRequest();
30     xhr.open("POST", "http://127.0.0.1:8000/resources/reset-temp-file.php?filename=" + fileName, false);
31     xhr.send();
32 }