Bug 1541508 - Use Services.env in tools/ r=marco
Differential Revision: https://phabricator.services.mozilla.com/D160150
This commit is contained in:
@@ -8,17 +8,14 @@
|
|||||||
|
|
||||||
var EXPORTED_SYMBOLS = ["PerTestCoverageUtils"];
|
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.
|
// 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.
|
// 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.
|
// 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.
|
// 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(
|
const gcovPrefixDir = Cc["@mozilla.org/file/local;1"].createInstance(
|
||||||
Ci.nsIFile
|
Ci.nsIFile
|
||||||
|
|||||||
@@ -7,11 +7,8 @@ var { AppConstants } = ChromeUtils.importESModule(
|
|||||||
);
|
);
|
||||||
|
|
||||||
function getFiles() {
|
function getFiles() {
|
||||||
const env = Cc["@mozilla.org/process/environment;1"].getService(
|
|
||||||
Ci.nsIEnvironment
|
|
||||||
);
|
|
||||||
// This is the directory where gcov is emitting the gcda files.
|
// 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(
|
const jsCoverageDir = Cc["@mozilla.org/file/local;1"].createInstance(
|
||||||
Ci.nsIFile
|
Ci.nsIFile
|
||||||
|
|||||||
@@ -117,10 +117,7 @@ function findServiceWorkerThreads(profile) {
|
|||||||
allThreads.forEach(logInformationForThread.bind(null, ""));
|
allThreads.forEach(logInformationForThread.bind(null, ""));
|
||||||
|
|
||||||
// Let's write the profile on disk if MOZ_UPLOAD_DIR is present
|
// Let's write the profile on disk if MOZ_UPLOAD_DIR is present
|
||||||
const env = Cc["@mozilla.org/process/environment;1"].getService(
|
const path = Services.env.get("MOZ_UPLOAD_DIR");
|
||||||
Ci.nsIEnvironment
|
|
||||||
);
|
|
||||||
const path = env.get("MOZ_UPLOAD_DIR");
|
|
||||||
if (path) {
|
if (path) {
|
||||||
const profileName = `profile_${Date.now()}.json`;
|
const profileName = `profile_${Date.now()}.json`;
|
||||||
const profilePath = PathUtils.join(path, profileName);
|
const profilePath = PathUtils.join(path, profileName);
|
||||||
|
|||||||
Reference in New Issue
Block a user