diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /toolkit/components/osfile/tests/xpcshell/test_constants.js | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/osfile/tests/xpcshell/test_constants.js')
-rw-r--r-- | toolkit/components/osfile/tests/xpcshell/test_constants.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/toolkit/components/osfile/tests/xpcshell/test_constants.js b/toolkit/components/osfile/tests/xpcshell/test_constants.js new file mode 100644 index 0000000000..7bc2e72a07 --- /dev/null +++ b/toolkit/components/osfile/tests/xpcshell/test_constants.js @@ -0,0 +1,20 @@ +"use strict"; + +const { OS } = ChromeUtils.import("resource://gre/modules/osfile.jsm"); + +// Test that OS.Constants is defined correctly. +add_task(async function check_definition() { + Assert.ok(OS.Constants != null); + Assert.ok(!!OS.Constants.Win || !!OS.Constants.libc); + Assert.ok(OS.Constants.Path != null); + Assert.ok(OS.Constants.Sys != null); + // check system name + Assert.equal(Services.appinfo.OS, OS.Constants.Sys.Name); + + // check if using DEBUG build + if (Cc["@mozilla.org/xpcom/debug;1"].getService(Ci.nsIDebug2).isDebugBuild) { + Assert.ok(OS.Constants.Sys.DEBUG); + } else { + Assert.ok(typeof OS.Constants.Sys.DEBUG == "undefined"); + } +}); |