gecko/dom/base/test/bug403852_fileOpener.js
Andrea Marchesini 10a7313c71 Bug 1121722 - Chrome-only DOM File constructors should use lastModified attribute. r=bz
--HG--
extra : rebase_source : 0163bcaacf08c8b820811dc02e3365a9d1d4360f
2015-02-10 09:31:00 +01:00

18 lines
578 B
JavaScript

const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.importGlobalProperties(["File"]);
let testFile = Cc["@mozilla.org/file/directory_service;1"]
.getService(Ci.nsIDirectoryService)
.QueryInterface(Ci.nsIProperties)
.get("ProfD", Ci.nsIFile);
testFile.append("prefs.js");
addMessageListener("file.open", function () {
sendAsyncMessage("file.opened", {
file: new File(testFile),
mtime: testFile.lastModifiedTime,
fileWithDate: new File(testFile, { lastModified: 123 }),
fileDate: 123,
});
});