Bug 1469823 - A new Top Sites tile does not appear after deleting a tile. r=Mardak draft
authorEd Lee <edilee@mozilla.com>
Mon, 02 Jul 2018 14:27:28 -0700
changeset 813291 d9dcccdc7a39482e54be62542b89522a2dd5845c
parent 813289 ffad55b623109ae6ce3176bf61149223332d4660
child 813294 58184114d0da99ef43fe60e594702451ec619e9c
push id114847
push userbmo:edilee@mozilla.com
push dateMon, 02 Jul 2018 21:28:03 +0000
reviewersMardak
bugs1469823
milestone62.0
Bug 1469823 - A new Top Sites tile does not appear after deleting a tile. r=Mardak MozReview-Commit-ID: C7SgdnHyv6S
browser/extensions/activity-stream/install.rdf.in
browser/extensions/activity-stream/lib/TopSitesFeed.jsm
browser/extensions/activity-stream/test/unit/lib/TopSitesFeed.test.js
--- a/browser/extensions/activity-stream/install.rdf.in
+++ b/browser/extensions/activity-stream/install.rdf.in
@@ -3,17 +3,17 @@
 #filter substitution
 
 <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
   <Description about="urn:mozilla:install-manifest">
     <em:id>activity-stream@mozilla.org</em:id>
     <em:type>2</em:type>
     <em:bootstrap>true</em:bootstrap>
     <em:unpack>false</em:unpack>
-    <em:version>2018.07.02.1272-c3df1302</em:version>
+    <em:version>2018.07.02.1284-8861276b</em:version>
     <em:name>Activity Stream</em:name>
     <em:description>A rich visual history feed and a reimagined home page make it easier than ever to find exactly what you're looking for in Firefox.</em:description>
     <em:multiprocessCompatible>true</em:multiprocessCompatible>
 
     <em:targetApplication>
       <Description>
         <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
         <em:minVersion>@MOZ_APP_VERSION@</em:minVersion>
--- a/browser/extensions/activity-stream/lib/TopSitesFeed.jsm
+++ b/browser/extensions/activity-stream/lib/TopSitesFeed.jsm
@@ -390,16 +390,17 @@ this.TopSitesFeed = class TopSitesFeed {
         this.init();
         break;
       case at.SYSTEM_TICK:
         this.refresh({broadcast: false});
         break;
       // All these actions mean we need new top sites
       case at.MIGRATION_COMPLETED:
       case at.PLACES_HISTORY_CLEARED:
+      case at.PLACES_LINK_DELETED:
         this.frecentCache.expire();
         this.refresh({broadcast: true});
         break;
       case at.PLACES_LINKS_CHANGED:
         this.frecentCache.expire();
         this.refresh({broadcast: false});
         break;
       case at.PLACES_LINK_BLOCKED:
--- a/browser/extensions/activity-stream/test/unit/lib/TopSitesFeed.test.js
+++ b/browser/extensions/activity-stream/test/unit/lib/TopSitesFeed.test.js
@@ -758,16 +758,24 @@ describe("Top Sites Feed", () => {
     it("should call refresh without a target if we clear history with PLACES_HISTORY_CLEARED", () => {
       sandbox.stub(feed, "refresh");
 
       feed.onAction({type: at.PLACES_HISTORY_CLEARED});
 
       assert.calledOnce(feed.refresh);
       assert.calledWithExactly(feed.refresh, {broadcast: true});
     });
+    it("should call refresh without a target if we remove a Topsite from history", () => {
+      sandbox.stub(feed, "refresh");
+
+      feed.onAction({type: at.PLACES_LINK_DELETED});
+
+      assert.calledOnce(feed.refresh);
+      assert.calledWithExactly(feed.refresh, {broadcast: true});
+    });
     it("should still dispatch an action even if there's no target provided", async () => {
       sandbox.stub(feed, "_fetchIcon");
       await feed.refresh({broadcast: true});
       assert.calledOnce(feed.store.dispatch);
       assert.propertyVal(feed.store.dispatch.firstCall.args[0], "type", at.TOP_SITES_UPDATED);
     });
     it("should call init on INIT action", async () => {
       sinon.stub(feed, "init");