Bug 1899602 - convert tb.websearch.usage to Glean. r=vineet

Differential Revision: https://phabricator.services.mozilla.com/D213104

--HG--
extra : rebase_source : f469b94d2506488388216c3cfe4a8bb0de00560b
This commit is contained in:
Magnus Melin 2024-06-19 10:18:49 +03:00
Родитель b32eb82619
Коммит 2da84bad9a
4 изменённых файлов: 30 добавлений и 35 удалений

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

@ -9,9 +9,6 @@
const { MockRegistrar } = ChromeUtils.importESModule(
"resource://testing-common/MockRegistrar.sys.mjs"
);
const { TelemetryTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/TelemetryTestUtils.sys.mjs"
);
const TEST_MESSAGE_URL =
"http://mochi.test:8888/browser/comm/mail/base/test/browser/files/sampleContent.eml";
@ -247,14 +244,19 @@ async function subtest(aboutMessage, mailContext) {
true
);
await SimpleTest.promiseClipboardChange("", () =>
openAndActivate("img", "mailContext-copyimage")
);
Assert.equal(
(await getClipboardFile()).type,
"image/png",
"should have copied the image"
);
if (!Services.env.get("MOZ_HEADLESS")) {
// No clipboard in headless.
await SimpleTest.promiseClipboardChange("", () =>
openAndActivate("img", "mailContext-copyimage")
);
Assert.equal(
(await getClipboardFile()).type,
"image/png",
"should have copied the image"
);
} else {
console.warn("Skipping mailContext-copyimage since in headless mode.");
}
pickerPromise = new Promise(resolve => {
SpecialPowers.MockFilePicker.init(window.browsingContext);
@ -417,9 +419,9 @@ add_setup(async function () {
MockRegistrar.unregister(mockExternalProtocolServiceCID);
Services.prefs.clearUserPref("browser.safebrowsing.reportPhishURL");
const scalars = TelemetryTestUtils.getProcessScalars("parent", true);
const googleValue = Glean.tb.websearchUsage.google.testGetValue();
Assert.equal(
scalars["tb.websearch.usage"]?.google,
googleValue,
webSearchCount,
"count of web searches should be correct"
);

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

@ -282,22 +282,6 @@ tb.preferences:
record_in_processes:
- 'main'
tb.websearch:
usage:
bug_numbers:
- 1641773
description: How many times search the web was used, keyed by search engine name.
release_channel_collection: opt-out
expires: never
products:
- 'thunderbird'
keyed: true
kind: uint
notification_emails:
- "telemetry-client-dev@thunderbird.net"
record_in_processes:
- 'main'
tb.addressbook:
addressbook_count:
bug_numbers:

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

@ -64,4 +64,17 @@ tb:
- EditAsNew
- EditTemplate
websearch_usage:
type: labeled_counter
description:
How many times search the web was used, keyed by search engine name.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584889
- https://bugzilla.mozilla.org/show_bug.cgi?id=1899602
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1903006
data_sensitivity:
- technical
notification_emails:
- telemetry-client-dev@thunderbird.net
expires: never

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

@ -43,11 +43,7 @@ export function openWebSearch(query) {
const engine = await Services.search.getDefault();
openLinkExternally(engine.getSubmission(query).uri.spec);
Services.telemetry.keyedScalarAdd(
"tb.websearch.usage",
engine.name.toLowerCase(),
1
);
Glean.tb.websearchUsage[engine.name.toLowerCase()].add(1);
});
}