Bug 1514890 - Change installation source for addons installed from ActivityStream r=Mardak a=lizzard
authork88hudson <k88hudson@gmail.com>
Wed, 13 Feb 2019 05:45:50 +0200
changeset 513029 7c05ff161fb2
parent 513028 c8852307aca0
child 513030 bfed614819c3
push id10690
push userapavel@mozilla.com
push dateWed, 13 Feb 2019 04:19:22 +0000
treeherdermozilla-beta@05a7b1efca0d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMardak, lizzard
bugs1514890
milestone66.0
Bug 1514890 - Change installation source for addons installed from ActivityStream r=Mardak a=lizzard Reviewers: Mardak Reviewed By: Mardak Subscribers: bogdan_maris, RyanVM, lizzard, rpl, k88hudson, ddurst, pascalc Tags: #secure-revision, #bmo-mozilla-employee-confidential Bug #: 1514890 Differential Revision: https://phabricator.services.mozilla.com/D19390
browser/components/newtab/lib/ASRouter.jsm
browser/components/newtab/test/unit/asrouter/MessageLoaderUtils.test.js
--- a/browser/components/newtab/lib/ASRouter.jsm
+++ b/browser/components/newtab/lib/ASRouter.jsm
@@ -241,19 +241,18 @@ const MessageLoaderUtils = {
   },
 
   async installAddonFromURL(browser, url) {
     try {
       MessageLoaderUtils._loadAddonIconInURLBar(browser);
       const aUri = Services.io.newURI(url);
       const systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
 
-      // AddonManager installation source associated to the addons installed from activitystream
-      // (See Bug 1496167 for a rationale).
-      const amTelemetryInfo = {source: "activitystream"};
+      // AddonManager installation source associated to the addons installed from activitystream's CFR
+      const amTelemetryInfo = {source: "amo"};
       const install = await AddonManager.getInstallForURL(aUri.spec, "application/x-xpinstall", null,
                                                           null, null, null, null, amTelemetryInfo);
       await AddonManager.installAddonFromWebpage("application/x-xpinstall", browser,
         systemPrincipal, install);
     } catch (e) {
       Cu.reportError(e);
     }
   },
--- a/browser/components/newtab/test/unit/asrouter/MessageLoaderUtils.test.js
+++ b/browser/components/newtab/test/unit/asrouter/MessageLoaderUtils.test.js
@@ -299,17 +299,17 @@ describe("MessageLoaderUtils", () => {
       await MessageLoaderUtils.installAddonFromURL({}, "foo.com");
 
       assert.calledOnce(getInstallStub);
       assert.calledOnce(installAddonStub);
 
       // Verify that the expected installation source has been passed to the getInstallForURL
       // method (See Bug 1496167 for a rationale).
       assert.calledWithExactly(getInstallStub, "foo.com", "application/x-xpinstall", null,
-                               null, null, null, null, {source: "activitystream"});
+                               null, null, null, null, {source: "amo"});
     });
     it("should not call the Addons API on invalid URLs", async () => {
       sandbox.stub(global.Services.scriptSecurityManager, "getSystemPrincipal").throws();
 
       await MessageLoaderUtils.installAddonFromURL({}, "https://foo.com");
 
       assert.notCalled(getInstallStub);
       assert.notCalled(installAddonStub);