mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-18 23:15:38 +00:00
Bug 1896265 - Part 3: Force consumers to use TopSites.insert - r=dao
Differential Revision: https://phabricator.services.mozilla.com/D211419
This commit is contained in:
parent
14630a1c35
commit
0cbfa05b7a
@ -1125,9 +1125,6 @@ class _TopSites {
|
||||
this.refreshDefaults(action.data[DEFAULT_SITES_PREF]);
|
||||
}
|
||||
break;
|
||||
case at.TOP_SITES_INSERT:
|
||||
this.insert(action);
|
||||
break;
|
||||
case at.UPDATE_PINNED_SEARCH_SHORTCUTS:
|
||||
this.updatePinnedSearchShortcuts(action.data);
|
||||
break;
|
||||
|
@ -1112,7 +1112,7 @@ add_task(async function test_onAction_part_2() {
|
||||
type: at.TOP_SITES_INSERT,
|
||||
data: { site: { url: "foo.bar", label: "foo" } },
|
||||
};
|
||||
TopSites.onAction(addAction);
|
||||
TopSites.insert(addAction);
|
||||
Assert.ok(
|
||||
NewTabUtils.pinnedLinks.pin.calledOnce,
|
||||
"NewTabUtils.pinnedLinks.pin called once"
|
||||
@ -1128,7 +1128,7 @@ add_task(async function test_onAction_part_2() {
|
||||
type: at.TOP_SITES_INSERT,
|
||||
data: { site: { url: "foo.bar", label: "foo" }, index: 3 },
|
||||
};
|
||||
TopSites.onAction(dropAction);
|
||||
TopSites.insert(dropAction);
|
||||
Assert.ok(
|
||||
NewTabUtils.pinnedLinks.pin.calledOnce,
|
||||
"NewTabUtils.pinnedLinks.pin called once"
|
||||
@ -1755,7 +1755,7 @@ add_task(async function test_integration() {
|
||||
NewTabUtils.pinnedLinks.links.push(link);
|
||||
});
|
||||
|
||||
TopSites.onAction({ type: at.TOP_SITES_INSERT, data: { site: { url } } });
|
||||
await TopSites.insert({ type: at.TOP_SITES_INSERT, data: { site: { url } } });
|
||||
await TestUtils.topicObserved("topsites-refreshed");
|
||||
let oldSites = await TopSites.getSites();
|
||||
NewTabUtils.pinnedLinks.links.pop();
|
||||
|
Loading…
x
Reference in New Issue
Block a user