Backed out changeset ab60f9ab2024 (bug 1962317) for causing Linux mochitests failures in PerfStats.cpp.

This commit is contained in:
Stanca Serban
2025-04-29 07:30:25 +03:00
parent 548dc886ee
commit 430ce50b99
5 changed files with 0 additions and 140 deletions

View File

@@ -1,11 +0,0 @@
[DEFAULT]
subsuite = "a11y"
support-files = [
"head.js",
"!/accessible/tests/browser/shared-head.js",
"!/accessible/tests/mochitest/*.js",
]
["browser_manyMutations.js"]
["browser_spellingErrors.js"]

View File

@@ -1,25 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
addAccessibleTask(
`<div id="container" role="group"></div>`,
async function testManyShowEvents(browser) {
await timeThis("manyShowEvents", async () => {
info("Adding many children");
let lastShown = waitForEvent(EVENT_SHOW, "last");
await invokeContentTask(browser, [], () => {
const container = content.document.getElementById("container");
for (let c = 0; c < 100000; ++c) {
const child = content.document.createElement("p");
child.textContent = c;
container.append(child);
}
container.lastChild.id = "last";
});
info("Waiting for last show event");
await lastShown;
});
}
);

View File

@@ -1,32 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
addAccessibleTask(
`<div id="editable" contenteditable></div>`,
async function testRemoveManySpellingErrors(browser) {
let changed = waitForEvent(EVENT_TEXT_ATTRIBUTE_CHANGED);
await invokeContentTask(browser, [], () => {
const editable = content.document.getElementById("editable");
for (let i = 0; i < 500; ++i) {
const p = content.document.createElement("p");
p.textContent = "tset tset tset";
editable.append(p);
}
editable.focus();
});
// Spell checking is async, so we need to wait for it to happen.
info("Waiting for spell check");
await changed;
await timeThis("removeManySpellingErrors", async () => {
info("Removing all content from editable");
let reorder = waitForEvent(EVENT_REORDER, "editable");
await invokeContentTask(browser, [], () => {
content.document.getElementById("editable").innerHTML = "";
});
info("Waiting for reorder event");
await reorder;
});
}
);

View File

@@ -1,71 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
/* exported timeThis */
// Load the shared-head file first.
Services.scriptloader.loadSubScript(
"chrome://mochitests/content/browser/accessible/tests/browser/shared-head.js",
this
);
// Load common.js and promisified-events.js from accessible/tests/mochitest/ for
// all tests.
loadScripts(
{ name: "common.js", dir: MOCHITESTS_DIR },
{ name: "promisified-events.js", dir: MOCHITESTS_DIR }
);
// All the A11Y metrics in tools/performance/PerfStats.h.
const ALL_A11Y_PERFSTATS =
(1 << 29) |
(1 << 30) |
(1 << 31) |
(1 << 32) |
(1 << 33) |
(1 << 34) |
(1 << 35) |
(1 << 36) |
(1 << 37) |
(1 << 38) |
(1 << 39) |
(1 << 40) |
(1 << 41) |
(1 << 42) |
(1 << 43) |
(1 << 44);
/**
* Time a function and log how long it took. The given name is included in log
* messages. All accessibility PerfStats metrics are also captured and logged.
*/
async function timeThis(name, func) {
const logPrefix = `Timing: ${name}`;
info(`${logPrefix}: begin`);
const start = performance.now();
ChromeUtils.setPerfStatsCollectionMask(ALL_A11Y_PERFSTATS);
await func();
const delta = performance.now() - start;
info(`${logPrefix}: took ${delta} ms`);
const stats = JSON.parse(await ChromeUtils.collectPerfStats());
ChromeUtils.setPerfStatsCollectionMask(0);
// Filter stuff out of stats that we don't care about.
// Filter out the GPU process, since accessibility doesn't do anything there.
stats.processes = stats.processes.filter(process => process.type != "gpu");
for (const process of stats.processes) {
// Because of weird JS -> WebIDL 64 bit number issues, we get metrics here
// that aren't for accessibility. For example, 1 << 32 also gets us 1 << 0.
// Filter those out. Also, filter out any metrics with a count of 0.
process.perfstats.metrics = process.perfstats.metrics.filter(
metric => metric.metric.startsWith("A11Y_") && metric.count > 0
);
}
// Now that we've filtered metrics, remove any processes that have no metrics left.
stats.processes = stats.processes.filter(
process => !!process.perfstats.metrics.length
);
info(`${logPrefix}: PerfStats: ${JSON.stringify(stats, null, 2)}`);
}