mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-10 21:28:04 +02:00
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
34 lines
890 B
JavaScript
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);
|