diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /toolkit/components/osfile/tests/xpcshell/test_creationDate.js | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/osfile/tests/xpcshell/test_creationDate.js')
-rw-r--r-- | toolkit/components/osfile/tests/xpcshell/test_creationDate.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/toolkit/components/osfile/tests/xpcshell/test_creationDate.js b/toolkit/components/osfile/tests/xpcshell/test_creationDate.js new file mode 100644 index 0000000000..71beac2430 --- /dev/null +++ b/toolkit/components/osfile/tests/xpcshell/test_creationDate.js @@ -0,0 +1,36 @@ +"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); |