Commit 6f8ac314 authored by William Durand's avatar William Durand
Browse files

Bug 1819997 - Allow `dlsource` in attribution data. r=mixedpuppy, a=dsmith

parent f037a501
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ const ATTR_CODE_KEYS = [
  "ua",
  "dltoken",
  "msstoresignedin",
  "dlsource",
];

let gCachedAttrData = null;
+6 −0
Original line number Diff line number Diff line
@@ -64,6 +64,12 @@ let validAttrCodes = [
    code: "dltoken%3Dc18f86a3-f228-4d98-91bb-f90135c0aa9c",
    parsed: { dltoken: "c18f86a3-f228-4d98-91bb-f90135c0aa9c" },
  },
  {
    code: "dlsource%3Dsome-dl-source",
    parsed: {
      dlsource: "some-dl-source",
    },
  },
];

let invalidAttrCodes = [
+1 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ Structure:
          ua: <string>, // identifier derived from the user agent downloading the installer, e.g., chrome, Google Chrome 123
          dltoken: <string>, // Unique token created at Firefox download time. ex: c18f86a3-f228-4d98-91bb-f90135c0aa9c
          msstoresignedin: <boolean>, // optional, only present if the installation was done through the Microsoft Store, and was able to retrieve the "campaign ID" it was first installed with. this value is "true" if the user was signed into the Microsoft Store when they first installed, and false otherwise
          dlsource: <string>, // identifier that indicate where installations of Firefox originate
        },
        sandbox: {
          effectiveContentProcessLevel: <integer>,
+2 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ const GFX_DEVICE_ID = "0x1234";
const EXPECTED_HDD_FIELDS = ["profile", "binary", "system"];

// Valid attribution code to write so that settings.attribution can be tested.
const ATTRIBUTION_CODE = "source%3Dgoogle.com";
const ATTRIBUTION_CODE = "source%3Dgoogle.com%26dlsource%3Dunittest";

function truncateToDays(aMsec) {
  return Math.floor(aMsec / MILLISECONDS_PER_DAY);
@@ -340,6 +340,7 @@ export var TelemetryEnvironmentTesting = {
    if ((gIsWindows || gIsMac) && AppConstants.MOZ_BUILD_APP == "browser") {
      lazy.Assert.equal(typeof data.settings.attribution, "object");
      lazy.Assert.equal(data.settings.attribution.source, "google.com");
      lazy.Assert.equal(data.settings.attribution.dlsource, "unittest");
    }

    this.checkIntlSettings(data.settings);