mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 04:09:50 +00:00
Bug 1788813 - do not report spurious telemetry events for the toggling of the recently closed or tab pickup lists as a result of pageload, r=sclements
Differential Revision: https://phabricator.services.mozilla.com/D156370
This commit is contained in:
parent
e0deeeffa0
commit
c4a23e34f1
@ -57,6 +57,16 @@ export function createFaviconElement(image) {
|
||||
}
|
||||
|
||||
export function onToggleContainer(detailsContainer) {
|
||||
// <details> elements fire `toggle` events when added to the DOM with the
|
||||
// "open" attribute set, but we don't want to record telemetry for those
|
||||
// as they aren't the result of user action. Ensure we bail out:
|
||||
if (
|
||||
detailsContainer.open &&
|
||||
detailsContainer.ownerDocument.readyState != "complete"
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const newFluentString = detailsContainer.open
|
||||
? "firefoxview-collapse-button-hide"
|
||||
: "firefoxview-collapse-button-show";
|
||||
|
@ -15,6 +15,7 @@ const URLs = [
|
||||
];
|
||||
|
||||
const RECENTLY_CLOSED_EVENT = [
|
||||
["firefoxview", "entered", "firefoxview", undefined],
|
||||
["firefoxview", "recently_closed", "tabs", undefined],
|
||||
];
|
||||
|
||||
@ -114,6 +115,7 @@ add_task(async function test_list_ordering() {
|
||||
0,
|
||||
"Closed tab count after purging session history"
|
||||
);
|
||||
await clearAllParentTelemetryEvents();
|
||||
|
||||
await BrowserTestUtils.withNewTab(
|
||||
{
|
||||
@ -121,7 +123,6 @@ add_task(async function test_list_ordering() {
|
||||
url: "about:firefoxview",
|
||||
},
|
||||
async browser => {
|
||||
await clearAllParentTelemetryEvents();
|
||||
const { document } = browser.contentWindow;
|
||||
const closedObjectsChanged = () =>
|
||||
TestUtils.topicObserved("sessionstore-closed-objects-changed");
|
||||
@ -181,9 +182,9 @@ add_task(async function test_list_ordering() {
|
||||
Ci.nsITelemetry.DATASET_PRERELEASE_CHANNELS,
|
||||
false
|
||||
).parent;
|
||||
return events && events.length >= 1;
|
||||
return events && events.length >= 2;
|
||||
},
|
||||
"Waiting for recently_closed firefoxview telemetry events.",
|
||||
"Waiting for entered and recently_closed firefoxview telemetry events.",
|
||||
200,
|
||||
100
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user