/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
PROPERTIES.forEach(function (aPropertyName) {
print("Testing property: " + aPropertyName);
let value = sysInfo.getProperty(aPropertyName); Assert.ok(!!value);
});
// This property must exist, but its value might be zero.
print("Testing property: umask"); Assert.equal(typeof sysInfo.getProperty("umask"), "number");
});
add_task(async function gleanSystemCpu() {
do_get_profile();
Services.fog.initializeFOG();
let sysInfo = Services.sysinfo;
for (let metric in gleanToProcessInfoNames) { Assert.equal(
Glean.systemCpu[metric].testGetValue(), null,
metric + " should not be set yet"
);
}
let processInfo = await sysInfo.processInfo;
for (let name in gleanToProcessInfoNames) {
let gleanValue = Glean.systemCpu[name].testGetValue(); if (gleanValue) { Assert.equal(
gleanValue,
processInfo[gleanToProcessInfoNames[name]],
`Glean.systemCpu.${name} should match Services.sysinfo.processInfo.${gleanToProcessInfoNames[name]}`
);
} else { Assert.ok(
!processInfo[gleanToProcessInfoNames[name]],
`Services.sysinfo.processInfo.${gleanToProcessInfoNames[name]} should be falsy when Glean.systemCpu.${name} is`
);
}
}
});
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.