Bug 1558305 - Fix sideload and file-url install_method values in AbuseReporter.getReportData method. r=mixedpuppy r=jcristau
authorLuca Greco <lgreco@mozilla.com>
Wed, 12 Jun 2019 18:24:39 +0000
changeset 536967 c6010ac4cc04f39ff3360e77329684e8215051fe
parent 536966 e56d843335ef048ff651a89d64257baea6271a20
child 536968 f2b815c3bbaf5b4cb37c6e4c2cac927e4bc01f8d
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmixedpuppy, jcristau
bugs1558305
milestone68.0
Bug 1558305 - Fix sideload and file-url install_method values in AbuseReporter.getReportData method. r=mixedpuppy r=jcristau Differential Revision: https://phabricator.services.mozilla.com/D34414
toolkit/mozapps/extensions/AbuseReporter.jsm
toolkit/mozapps/extensions/test/xpcshell/test_AbuseReporter.js
--- a/toolkit/mozapps/extensions/AbuseReporter.jsm
+++ b/toolkit/mozapps/extensions/AbuseReporter.jsm
@@ -130,31 +130,31 @@ const AbuseReporter = {
     // Map addon.installTelemetryInfo values to the supported addon_install_method
     // values supported by the API endpoint (See API endpoint docs at
     // https://addons-server.readthedocs.io/en/latest/topics/api/abuse.html).
     let install_method = "other";
     if (addon.installTelemetryInfo) {
       const {source, method} = addon.installTelemetryInfo;
       switch (source) {
         case "enterprise-policy":
-        case "file-uri":
+        case "file-url":
         case "system-addon":
         case "temporary-addon":
           install_method = source.replace(/-/g, "_");
           break;
         case "distribution":
-        case "sideload":
         case "sync":
           install_method = source;
           break;
         default:
           install_method = "other";
       }
 
       switch (method) {
+        case "sideload":
         case "link":
           install_method = method;
           break;
         case "amWebAPI":
         case "installTrigger":
           install_method = method.toLowerCase();
           break;
         case "drag-and-drop":
--- a/toolkit/mozapps/extensions/test/xpcshell/test_AbuseReporter.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_AbuseReporter.js
@@ -167,22 +167,22 @@ add_task(async function test_addon_insta
 
   // Array of [ expected, amInstallTelemetryInfo ]
   const TEST_CASES = [
     ["amwebapi", {source: "amo", method: "amWebAPI"}],
     ["amwebapi", {source: "disco", method: "amWebAPI"}],
     ["distribution", {source: "distribution"}],
     ["drag_and_drop", {source: "about:addons", method: "drag-and-drop"}],
     ["enterprise_policy", {source: "enterprise-policy"}],
-    ["file_uri", {source: "file-uri"}],
+    ["file_url", {source: "file-url"}],
     ["install_from_file", {source: "about:addons", method: "install-from-file"}],
     ["installtrigger", {source: "test-host", method: "installTrigger"}],
     ["link", {source: "unknown", method: "link"}],
     ["management_webext_api", {source: "extension", method: "management-webext-api"}],
-    ["sideload", {source: "sideload"}],
+    ["sideload", {source: "app-profile", method: "sideload"}],
     ["sync", {source: "sync"}],
     ["system_addon", {source: "system-addon"}],
     ["temporary_addon", {source: "temporary-addon"}],
     ["other", {source: "internal"}],
     ["other", {source: "about:debugging"}],
     ["other", {source: "webide"}],
   ];