blob: 8feef39b4c97a0747cf5af36dd7a5d5f76ada45f [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../../../resources/js-test-pre.js"></script>
<script src="../../../../resources/ui-helper.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script src="resources/setup-file-input-element-for-drag.js"></script>
<script>
description("Test File.lastModifiedDate.");
jsTestIsAsync = true;
function onFileChange(file, filePath)
{
var xhr = new XMLHttpRequest();
xhr.open("GET", "http://127.0.0.1:8000/resources/file-last-modified.py?path=../local/fileapi/" + filePath, false);
xhr.send();
var expectedDate = new Date(parseInt(xhr.responseText) * 1000);
var actualDate = file.lastModified;
if (expectedDate.getTime() == actualDate)
testPassed("file.lastModified verified");
else
testFailed("file.lastModified incorrect");
// Clean up after ourselves
removeFileInputElement();
finishJSTest();
}
function runTest()
{
var testFilePath = "../resources/file-for-drag-to-send.txt";
setFileInputChangeCallback(function(file) { onFileChange(file, testFilePath); });
testRunner.setOpenPanelFiles([testFilePath]);
var centerX = fileInput.offsetLeft + fileInput.offsetWidth / 2;
var centerY = fileInput.offsetTop + fileInput.offsetHeight / 2;
UIHelper.activateAt(centerX, centerY);
}
if (window.testRunner)
runTest();
else
testFailed("This test is not interactive, please run using a test harness");
var successfullyParsed = true;
</script>
<script src="../../../../resources/js-test-post.js"></script>
</body>
</html>