зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1731756: Pull site name from the array of site data. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D126212
This commit is contained in:
Родитель
ac34e350cd
Коммит
3eab4c935f
|
@ -310,8 +310,9 @@ class CommonNames {
|
|||
* @returns {string} The snapshot's common name.
|
||||
*/
|
||||
static getName(snapshot) {
|
||||
let commonName = snapshot.pageData.get(PageDataCollector.DATA_TYPE.GENERAL)
|
||||
?.site_name;
|
||||
let commonName = snapshot.pageData.get(
|
||||
PageDataCollector.DATA_TYPE.GENERAL
|
||||
)?.[0]?.site_name;
|
||||
if (commonName) {
|
||||
return commonName;
|
||||
}
|
||||
|
|
|
@ -40,9 +40,11 @@ add_task(async function fromMetadata() {
|
|||
PageDataService.pageDataDiscovered(TEST_URL1, [
|
||||
{
|
||||
type: PageDataCollector.DATA_TYPE.GENERAL,
|
||||
data: {
|
||||
site_name: "Test Example",
|
||||
},
|
||||
data: [
|
||||
{
|
||||
site_name: "Test Example",
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
await assertUrlNotification(TOPIC_ADDED, [TEST_URL1], () =>
|
||||
|
@ -88,9 +90,11 @@ add_task(async function customName_withMetadata() {
|
|||
PageDataService.pageDataDiscovered(TEST_URL3, [
|
||||
{
|
||||
type: PageDataCollector.DATA_TYPE.GENERAL,
|
||||
data: {
|
||||
site_name: "Test Example 2",
|
||||
},
|
||||
data: [
|
||||
{
|
||||
site_name: "Test Example 2",
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
await assertUrlNotification(TOPIC_ADDED, [TEST_URL3], () =>
|
||||
|
|
Загрузка…
Ссылка в новой задаче