gecko-dev/toolkit/components/osfile/tests/xpcshell/test_creationDate.js
Mark Banner 691543ee89 Bug 1486739 - Add missing dangling commas in browser/, services/, taskcluster/ and toolkit/. r=mossop
Automatic changes by ESLint, except for manual corrections for .xml files.

Differential Revision: https://phabricator.services.mozilla.com/D4439

--HG--
extra : moz-landing-system : lando
2018-08-31 05:59:17 +00:00

34 lines
890 B
JavaScript

"use strict";
function run_test() {
do_test_pending();
run_next_test();
}
/**
* Test to ensure that deprecation warning is issued on use
* of creationDate.
*/
add_task(async function test_deprecatedCreationDate() {
let currentDir = await OS.File.getCurrentDirectory();
let path = OS.Path.join(currentDir, "test_creationDate.js");
let consoleMessagePromise = new Promise(resolve => {
let consoleListener = {
observe(aMessage) {
if (aMessage.message.indexOf("Field 'creationDate' is deprecated.") > -1) {
info("Deprecation message printed");
Assert.ok(true);
Services.console.unregisterListener(consoleListener);
resolve();
}
},
};
Services.console.registerListener(consoleListener);
});
(await OS.File.stat(path)).creationDate;
await consoleMessagePromise;
});
add_task(do_test_finished);