Bug 1541508 - Use Services.env in tools/ r=marco

Differential Revision: https://phabricator.services.mozilla.com/D160150
This commit is contained in:
Barret Rennie
2022-11-25 19:09:11 +00:00
parent 0fb8313b89
commit eb65c20256
3 changed files with 6 additions and 15 deletions

View File

@@ -8,17 +8,14 @@
var EXPORTED_SYMBOLS = ["PerTestCoverageUtils"];
const env = Cc["@mozilla.org/process/environment;1"].getService(
Ci.nsIEnvironment
);
// This is the directory where gcov is emitting the gcda files.
const gcovPrefixPath = env.get("GCOV_PREFIX");
const gcovPrefixPath = Services.env.get("GCOV_PREFIX");
// This is the directory where codecoverage.py is expecting to see the gcda files.
const gcovResultsPath = env.get("GCOV_RESULTS_DIR");
const gcovResultsPath = Services.env.get("GCOV_RESULTS_DIR");
// This is the directory where the JS engine is emitting the lcov files.
const jsvmPrefixPath = env.get("JS_CODE_COVERAGE_OUTPUT_DIR");
const jsvmPrefixPath = Services.env.get("JS_CODE_COVERAGE_OUTPUT_DIR");
// This is the directory where codecoverage.py is expecting to see the lcov files.
const jsvmResultsPath = env.get("JSVM_RESULTS_DIR");
const jsvmResultsPath = Services.env.get("JSVM_RESULTS_DIR");
const gcovPrefixDir = Cc["@mozilla.org/file/local;1"].createInstance(
Ci.nsIFile

View File

@@ -7,11 +7,8 @@ var { AppConstants } = ChromeUtils.importESModule(
);
function getFiles() {
const env = Cc["@mozilla.org/process/environment;1"].getService(
Ci.nsIEnvironment
);
// This is the directory where gcov is emitting the gcda files.
const jsCoveragePath = env.get("JS_CODE_COVERAGE_OUTPUT_DIR");
const jsCoveragePath = Services.env.get("JS_CODE_COVERAGE_OUTPUT_DIR");
const jsCoverageDir = Cc["@mozilla.org/file/local;1"].createInstance(
Ci.nsIFile

View File

@@ -117,10 +117,7 @@ function findServiceWorkerThreads(profile) {
allThreads.forEach(logInformationForThread.bind(null, ""));
// Let's write the profile on disk if MOZ_UPLOAD_DIR is present
const env = Cc["@mozilla.org/process/environment;1"].getService(
Ci.nsIEnvironment
);
const path = env.get("MOZ_UPLOAD_DIR");
const path = Services.env.get("MOZ_UPLOAD_DIR");
if (path) {
const profileName = `profile_${Date.now()}.json`;
const profilePath = PathUtils.join(path, profileName);