Bug 1469823 - A new Top Sites tile does not appear after deleting a tile. r=Mardak
MozReview-Commit-ID: C7SgdnHyv6S
--- 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");