Bug 1469823 - A new Top Sites tile does not appear after deleting a tile. r=Mardak a=lizzard
authorEd Lee <edilee@mozilla.com>
Mon, 02 Jul 2018 14:27:28 -0700
changeset 480305 42ed67641f893224d00195f90304f152f119a3d9
parent 480304 7d3146d065feeba6ee6dc06b674c2763f42e28c0
child 480306 b55af4da7030e83fd7d3ead356f3279ee774b9ea
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMardak, lizzard
bugs1469823
milestone62.0
Bug 1469823 - A new Top Sites tile does not appear after deleting a tile. r=Mardak a=lizzard 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");