From d06b8ac03a6d5c48613544da342674dd88dc503f Mon Sep 17 00:00:00 2001 From: Magnus Melin Date: Wed, 10 Jun 2020 23:34:35 +0300 Subject: [PATCH] Backed out changeset 813ca5b455a8 (bug 1615986) for test failures --- mail/base/content/msgMail3PaneWindow.js | 41 ------------ mail/components/telemetry/Scalars.yaml | 29 --------- mail/test/browser/addrbook/browser.ini | 1 - .../addrbook/browser_addressBookTelemetry.js | 64 ------------------- 4 files changed, 135 deletions(-) delete mode 100644 mail/test/browser/addrbook/browser_addressBookTelemetry.js diff --git a/mail/base/content/msgMail3PaneWindow.js b/mail/base/content/msgMail3PaneWindow.js index 3eb72beb7b..7580f68f09 100644 --- a/mail/base/content/msgMail3PaneWindow.js +++ b/mail/base/content/msgMail3PaneWindow.js @@ -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) { diff --git a/mail/components/telemetry/Scalars.yaml b/mail/components/telemetry/Scalars.yaml index 8af29a79bc..f36f51150c 100644 --- a/mail/components/telemetry/Scalars.yaml +++ b/mail/components/telemetry/Scalars.yaml @@ -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: diff --git a/mail/test/browser/addrbook/browser.ini b/mail/test/browser/addrbook/browser.ini index 3eb2df1794..9a33cd93d8 100644 --- a/mail/test/browser/addrbook/browser.ini +++ b/mail/test/browser/addrbook/browser.ini @@ -12,5 +12,4 @@ tags = addrbook [browser_addressBook.js] skip-if = debug [browser_addressBookPanes.js] -[browser_addressBookTelemetry.js] [browser_updateMailingList.js] diff --git a/mail/test/browser/addrbook/browser_addressBookTelemetry.js b/mail/test/browser/addrbook/browser_addressBookTelemetry.js deleted file mode 100644 index a88b88448b..0000000000 --- a/mail/test/browser/addrbook/browser_addressBookTelemetry.js +++ /dev/null @@ -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); -});