summaryrefslogtreecommitdiffstats
path: root/toolkit/components/osfile/tests/xpcshell/test_constants.js
blob: 7bc2e72a075e52a83223958f8c8f5aa1b28266ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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");
  }
});