Bug 1445386 - Use GreD for artifact build scalars. r=chutten
On macOS, the paths for the special directories `GreD` (Resources) vs. `GreBinD`
(MacOS) are different. On other platforms, they are the same.
With scalar loading for artifact builds, we need to load a file from
`Resources`, so `GreD` should be used for this case.
MozReview-Commit-ID: 91JFwOISQCk
--- a/toolkit/components/telemetry/TelemetryController.jsm
+++ b/toolkit/components/telemetry/TelemetryController.jsm
@@ -1066,17 +1066,17 @@ var Impl = {
if (AppConstants.MOZILLA_OFFICIAL && !this._testMode) {
return;
}
this._log.trace("registerJsProbes - registering builtin JS probes");
// Load the scalar probes JSON file.
const scalarProbeFilename = "ScalarArtifactDefinitions.json";
- let scalarProbeFile = Services.dirsvc.get("GreBinD", Ci.nsIFile);
+ let scalarProbeFile = Services.dirsvc.get("GreD", Ci.nsIFile);
scalarProbeFile.append(scalarProbeFilename);
if (!scalarProbeFile.exists()) {
this._log.trace("registerJsProbes - no scalar builtin JS probes");
return;
}
// Load the file off the disk.
let scalarJSProbes = {};
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryScalars_buildFaster.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryScalars_buildFaster.js
@@ -10,17 +10,17 @@ const KEYED_UINT_SCALAR = "telemetry.tes
ChromeUtils.import("resource://services-common/utils.js");
/**
* Return the path to the definitions file for the scalars.
*/
function getDefinitionsPath() {
// Write the scalar definition to the spec file in the binary directory.
let definitionFile = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
- definitionFile = Services.dirsvc.get("GreBinD", Ci.nsIFile);
+ definitionFile = Services.dirsvc.get("GreD", Ci.nsIFile);
definitionFile.append("ScalarArtifactDefinitions.json");
return definitionFile.path;
}
add_task(async function test_setup() {
do_get_profile();
});