function onOpened(message) { var fileList = document.getElementById('fileList');
SpecialPowers.wrap(fileList).mozSetFileArray([message.file]);
// Make sure the file is accessible with indexed notation var domFile = fileList.files[0];
is(domFile.name, "prefs.js", "fileName should be prefs.js");
ok("lastModified" in domFile, "lastModified must be present");
var d = new Date(message.mtime);
is(d.getTime(), (new Date(domFile.lastModified)).getTime(), "lastModified should be the same");
var x = new Date();
// In our implementation of File object, lastModified is unknown only for new objects.
// Using canvas or input[type=file] elements, we 'often' have a valid lastModified values.
// For canvas we use memory files and the lastModified is now(). var f = new File([new Blob(['test'], {type: 'text/plain'})], "test-name");
var y = new Date(f.lastModified); var z = new Date();
ok((x.getTime() <= y.getTime()) && (y.getTime() <= z.getTime()), "lastModified of file which does not have last modified date should be current time");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.