/* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; let doc, tbody, tabAboutProcesses; const rowTypes = ["process", "window", "thread-summary", "thread"]; function promiseUpdate() { return promiseAboutProcessesUpdated({ doc, tbody, force: true, tabAboutProcesses, }); } async function setTabAboutProcesses() { info("Setting up about:processes tab"); tabAboutProcesses = await BrowserTestUtils.openNewForegroundTab({ gBrowser, opening: "about:processes", waitForLoad: true, }); doc = tabAboutProcesses.linkedBrowser.contentDocument; tbody = doc.getElementById("process-tbody"); await promiseUpdate(); } add_setup(async function () { await setTabAboutProcesses(); await SpecialPowers.pushPrefEnv({ set: [ // Ensure both types of buttons are shown ["toolkit.aboutProcesses.showThreads", "true"], ["toolkit.aboutProcesses.showProfilerIcons", "true"], // Change profiler URL for the test to avoid opening a remote URL and crash ["devtools.performance.recording.ui-base-url", "https://example.com"], ], }); }); add_task(async function test_profiler_icon_button() { info("Verify the Profiler button is properly marked up."); let processRow = tbody.querySelector(".process"); let profilerButton = processRow.querySelector(".profiler-icon"); Assert.ok( profilerButton.hasAttribute("title"), "The Profile Process icon button has a title" ); Assert.equal( profilerButton.getAttribute("role") || profilerButton.tagName.toLowerCase(), "button", "The Profile Process icon is programmatically a button" ); // ToDo: Remove the "tabindex" check when the button is using