michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: function run_test() { michael@0: const PROPERTIES = ["name", "host", "arch", "version", "pagesize", michael@0: "pageshift", "memmapalign", "cpucount", "memsize"]; michael@0: let sysInfo = Components.classes["@mozilla.org/system-info;1"]. michael@0: getService(Components.interfaces.nsIPropertyBag2); michael@0: michael@0: PROPERTIES.forEach(function(aPropertyName) { michael@0: print("Testing property: " + aPropertyName); michael@0: let value = sysInfo.getProperty(aPropertyName); michael@0: do_check_true(!!value); michael@0: }); michael@0: michael@0: // This property must exist, but its value might be zero. michael@0: print("Testing property: umask") michael@0: do_check_eq(typeof sysInfo.getProperty("umask"), "number"); michael@0: }