Backed out changeset 813ca5b455a8 (bug 1615986) for test failures

This commit is contained in:
Magnus Melin 2020-06-10 23:34:35 +03:00
Родитель 1857a8bbd1
Коммит d06b8ac03a
4 изменённых файлов: 0 добавлений и 135 удалений

Просмотреть файл

@ -792,7 +792,6 @@ function LoadPostAccountWizard() {
}
setTimeout(reportAccountTypes, 0);
setTimeout(reportAddressBookTypes, 0);
}
/**
@ -832,46 +831,6 @@ function reportAccountTypes() {
}
}
/**
* Report addressbook count and contact count to telemetry, keyed by addressbook
* type. Type is one of ["jsaddrbook", "jscarddav", "moz-abldapdirectory"], see
* AddrBookManager.jsm for more details.
*
* NOTE: We didn't use `dir.dirType` because it's just an integer, instead we
* use the scheme of `dir.URI` as the type.
*/
function reportAddressBookTypes() {
let report = {};
for (let dir of MailServices.ab.directories) {
let type = dir.URI.split(":")[0];
if (!report[type]) {
report[type] = { count: 0, contactCount: 0 };
}
report[type].count++;
// Ignore LDAP contacts for now.
if (type !== "moz-abldapdirectory") {
report[type].contactCount += [...dir.childCards].filter(
c => !c.isMailList
).length;
}
}
for (let [type, { count, contactCount }] of Object.entries(report)) {
Services.telemetry.keyedScalarSet(
"tb.addressbook.addressbook_count",
type,
count
);
Services.telemetry.keyedScalarSet(
"tb.addressbook.contact_count",
type,
contactCount
);
}
}
function HandleAppCommandEvent(evt) {
evt.stopPropagation();
switch (evt.command) {

Просмотреть файл

@ -190,35 +190,6 @@ tb.websearch:
record_in_processes:
- 'main'
tb.addressbook:
addressbook_count:
bug_numbers:
- 1615986
description: How many addressbooks were set up, keyed by addressbook directory URI scheme.
expires: never
products:
- 'thunderbird'
keyed: true
kind: uint
notification_emails:
- "telemetry-client-dev@thunderbird.net"
record_in_processes:
- 'main'
contact_count:
bug_numbers:
- 1615986
description: Count of contacts in all addressbooks, keyed by addressbook directory URI scheme.
expires: never
products:
- 'thunderbird'
keyed: true
kind: uint
notification_emails:
- "telemetry-client-dev@thunderbird.net"
record_in_processes:
- 'main'
tb.calendar:
calendar_count:
bug_numbers:

Просмотреть файл

@ -12,5 +12,4 @@ tags = addrbook
[browser_addressBook.js]
skip-if = debug
[browser_addressBookPanes.js]
[browser_addressBookTelemetry.js]
[browser_updateMailingList.js]

Просмотреть файл

@ -1,64 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* global reportAddressBookTypes */
/**
* Test telemetry related to address book.
*/
let { TelemetryTestUtils } = ChromeUtils.import(
"resource://testing-common/TelemetryTestUtils.jsm"
);
let {
create_address_book,
delete_address_book,
create_contact,
create_ldap_address_book,
load_contacts_into_address_book,
} = ChromeUtils.import(
"resource://testing-common/mozmill/AddressBookHelpers.jsm"
);
/**
* Test we're counting address books and contacts.
*/
add_task(async function test_address_book_count() {
Services.telemetry.clearScalars();
// Adding some address books and contracts.
let addrBook1 = create_address_book("AB 1");
let addrBook2 = create_address_book("AB 2");
let ldapBook = create_ldap_address_book("LDAP Book");
let contact1 = create_contact("test1@example.com", "test1", true);
let contact2 = create_contact("test2@example.com", "test2", true);
let contact3 = create_contact("test3@example.com", "test3", true);
load_contacts_into_address_book(addrBook1, [contact1]);
load_contacts_into_address_book(addrBook2, [contact2, contact3]);
// Run the probe.
reportAddressBookTypes();
let scalars = TelemetryTestUtils.getProcessScalars("parent", true);
Assert.equal(
scalars["tb.addressbook.addressbook_count"]["moz-abldapdirectory"],
1,
"LDAP address book count must be correct"
);
Assert.equal(
scalars["tb.addressbook.addressbook_count"].jsaddrbook,
4,
"JS address book count must be correct"
);
Assert.equal(
scalars["tb.addressbook.contact_count"].jsaddrbook,
3,
"Contact count must be correct"
);
// Clean up.
delete_address_book(addrBook1);
delete_address_book(addrBook2);
delete_address_book(ldapBook);
});