forked from mirrors/gecko-dev
Bug 1836191 - remove the about:performance implementation, r=mconley,fluent-reviewers,desktop-theme-reviewers,sfoster.
Differential Revision: https://phabricator.services.mozilla.com/D179695
This commit is contained in:
parent
ebb3633d22
commit
d272e36525
21 changed files with 0 additions and 2093 deletions
|
|
@ -1,223 +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/. */
|
||||
|
||||
@import url("chrome://global/skin/in-content/common.css");
|
||||
|
||||
html {
|
||||
background-color: var(--in-content-page-background);
|
||||
}
|
||||
body {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
#dispatch-table {
|
||||
user-select: none;
|
||||
font-size: 1em;
|
||||
border-spacing: 0;
|
||||
background-color: var(--in-content-box-background);
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
inset-inline-start: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-width: 40em;
|
||||
}
|
||||
|
||||
/* Avoid scrolling the header */
|
||||
#dispatch-tbody {
|
||||
display: block;
|
||||
margin-top: 2em;
|
||||
}
|
||||
#dispatch-thead {
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
height: 2em;
|
||||
border-bottom: 1px solid var(--in-content-border-color);
|
||||
min-width: 40em;
|
||||
background-color: var(--in-content-box-background);
|
||||
}
|
||||
tr {
|
||||
display: table;
|
||||
table-layout: fixed;
|
||||
width: 100%;
|
||||
}
|
||||
td:nth-child(2) {
|
||||
width: 8em;
|
||||
}
|
||||
td:nth-child(3) {
|
||||
width: 12em;
|
||||
}
|
||||
td:nth-child(4) {
|
||||
width: 5em;
|
||||
}
|
||||
#dispatch-tbody td:nth-child(4) {
|
||||
text-align: end;
|
||||
}
|
||||
td:nth-child(5) {
|
||||
width: 24px;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
|
||||
/* Show action icons on selected or hovered rows */
|
||||
tr:is([selected], :hover) > td > .action-icon {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.action-icon {
|
||||
opacity: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.action-icon::before {
|
||||
content: "";
|
||||
display: inline-block;
|
||||
-moz-context-properties: fill;
|
||||
fill: currentColor;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: 16px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.action-icon:hover::before {
|
||||
background-color: color-mix(in srgb, currentColor 15%, transparent);
|
||||
}
|
||||
.action-icon:hover:active::before {
|
||||
background-color: color-mix(in srgb, currentColor 30%, transparent);
|
||||
}
|
||||
|
||||
/* icons */
|
||||
|
||||
.addon-icon::before {
|
||||
background-image: url("chrome://global/skin/icons/shortcut.svg");
|
||||
}
|
||||
.addon-icon:dir(rtl)::before {
|
||||
transform: scaleX(-1);
|
||||
}
|
||||
.close-icon::before {
|
||||
background-image: url("chrome://global/skin/icons/close.svg");
|
||||
}
|
||||
|
||||
#dispatch-thead > tr {
|
||||
height: inherit;
|
||||
}
|
||||
|
||||
#dispatch-thead > tr > td {
|
||||
border: none;
|
||||
}
|
||||
#dispatch-thead > tr > td:not(:first-child) {
|
||||
border-inline-start-width: 1px;
|
||||
border-inline-start-style: solid;
|
||||
border-image: linear-gradient(transparent 0%, transparent 20%, var(--in-content-box-border-color) 20%, var(--in-content-box-border-color) 80%, transparent 80%, transparent 100%) 1 1;
|
||||
border-bottom: 1px solid var(--in-content-border-color);
|
||||
}
|
||||
td {
|
||||
padding: 5px 10px;
|
||||
min-height: 2em;
|
||||
max-width: 70vw;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
#dispatch-tbody > tr > td:first-child {
|
||||
text-overflow: ellipsis;
|
||||
padding-inline-start: 32px;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 16px 16px;
|
||||
background-position-y: center;
|
||||
-moz-context-properties: fill;
|
||||
fill: currentColor;
|
||||
}
|
||||
#dispatch-tbody > tr > td.root {
|
||||
background-position-x: left 36px;
|
||||
padding-inline-start: 62px;
|
||||
}
|
||||
#dispatch-tbody > tr > td.root:dir(rtl) {
|
||||
background-position-x: right 36px;
|
||||
}
|
||||
.twisty {
|
||||
margin-inline: -62px 26px;
|
||||
padding-inline: 18px;
|
||||
position: relative;
|
||||
}
|
||||
/* Putting the background image in a positioned pseudo element lets us
|
||||
* use CSS transforms on the background image, which we need for rtl. */
|
||||
.twisty::before {
|
||||
content: url("chrome://global/skin/icons/arrow-right-12.svg");
|
||||
position: absolute;
|
||||
display: block;
|
||||
line-height: 50%;
|
||||
top: 4px; /* Half the image's height */
|
||||
width: 100%;
|
||||
inset-inline-start: 0;
|
||||
text-align: center;
|
||||
-moz-context-properties: fill;
|
||||
fill: currentColor;
|
||||
}
|
||||
.twisty:dir(rtl)::before {
|
||||
content: url("chrome://global/skin/icons/arrow-left-12.svg");
|
||||
}
|
||||
.twisty.open::before {
|
||||
content: url("chrome://global/skin/icons/arrow-down-12.svg");
|
||||
}
|
||||
#dispatch-tbody > tr > td.indent {
|
||||
padding-inline-start: 88px;
|
||||
background-position-x: left 62px;
|
||||
}
|
||||
#dispatch-tbody > tr > td.indent:dir(rtl) {
|
||||
background-position-x: right 62px;
|
||||
}
|
||||
#dispatch-tbody > tr > td.tracker {
|
||||
background-image: url("chrome://global/skin/icons/trackers.svg");
|
||||
-moz-context-properties: fill;
|
||||
fill: rgb(224, 41, 29);
|
||||
}
|
||||
#dispatch-tbody > tr > td.worker {
|
||||
background-image: url("chrome://devtools/skin/images/debugging-workers.svg");
|
||||
-moz-context-properties: fill;
|
||||
fill: #808080;
|
||||
}
|
||||
|
||||
#dispatch-tbody > tr:hover {
|
||||
background-color: var(--in-content-item-hover);
|
||||
color: var(--in-content-item-hover-text);
|
||||
}
|
||||
#dispatch-tbody > tr[selected] {
|
||||
background-color: var(--in-content-item-selected);
|
||||
color: var(--in-content-item-selected-text);
|
||||
}
|
||||
|
||||
.clickable {
|
||||
background-repeat: no-repeat;
|
||||
background-position: right 4px center;
|
||||
}
|
||||
.clickable:dir(rtl) {
|
||||
background-position-x: left 4px;
|
||||
}
|
||||
.asc {
|
||||
background-image: url(chrome://global/skin/icons/arrow-up-12.svg);
|
||||
-moz-context-properties: fill;
|
||||
fill: currentColor;
|
||||
}
|
||||
.desc {
|
||||
background-image: url(chrome://global/skin/icons/arrow-down-12.svg);
|
||||
-moz-context-properties: fill;
|
||||
fill: currentColor;
|
||||
}
|
||||
#dispatch-thead > tr > td.clickable:hover {
|
||||
background-color: var(--in-content-button-background-hover);
|
||||
color: var(--in-content-button-text-color-hover);
|
||||
}
|
||||
#dispatch-thead > tr > td.clickable:hover:active {
|
||||
background-color: var(--in-content-button-background-active);
|
||||
color: var(--in-content-button-text-color-active);
|
||||
}
|
||||
|
||||
.energy-impact {
|
||||
--bar-width: 0;
|
||||
background: linear-gradient(to right, var(--blue-40) calc(var(--bar-width) * 1%), transparent calc(var(--bar-width) * 1%));
|
||||
}
|
||||
.energy-impact:dir(rtl) {
|
||||
background: linear-gradient(to left, var(--blue-40) calc(var(--bar-width) * 1%), transparent calc(var(--bar-width) * 1%));
|
||||
}
|
||||
|
|
@ -1,57 +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/. -->
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta
|
||||
http-equiv="Content-Security-Policy"
|
||||
content="default-src chrome:;img-src data:; object-src 'none'"
|
||||
/>
|
||||
<meta name="color-scheme" content="light dark" />
|
||||
<title data-l10n-id="about-performance-title"></title>
|
||||
<link
|
||||
rel="icon"
|
||||
id="favicon"
|
||||
href="chrome://global/skin/icons/performance.svg"
|
||||
/>
|
||||
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css" />
|
||||
<link rel="localization" href="toolkit/about/aboutPerformance.ftl" />
|
||||
<script src="chrome://global/content/aboutPerformance.js"></script>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="chrome://global/content/aboutPerformance.css"
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
<table id="dispatch-table">
|
||||
<thead id="dispatch-thead">
|
||||
<tr>
|
||||
<td
|
||||
class="clickable"
|
||||
id="column-name"
|
||||
data-l10n-id="column-name"
|
||||
></td>
|
||||
<td
|
||||
class="clickable"
|
||||
id="column-type"
|
||||
data-l10n-id="column-type"
|
||||
></td>
|
||||
<td
|
||||
class="clickable"
|
||||
id="column-energy-impact"
|
||||
data-l10n-id="column-energy-impact"
|
||||
></td>
|
||||
<td
|
||||
class="clickable"
|
||||
id="column-memory"
|
||||
data-l10n-id="column-memory"
|
||||
></td>
|
||||
<td></td>
|
||||
<!-- actions -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="dispatch-tbody"></tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,8 +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/.
|
||||
|
||||
toolkit.jar:
|
||||
content/global/aboutPerformance.html (content/aboutPerformance.html)
|
||||
content/global/aboutPerformance.js (content/aboutPerformance.js)
|
||||
content/global/aboutPerformance.css (content/aboutPerformance.css)
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# 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/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Toolkit", "Performance Monitoring")
|
||||
|
||||
JAR_MANIFESTS += ["jar.mn"]
|
||||
|
||||
BROWSER_CHROME_MANIFESTS += ["tests/browser/browser.ini"]
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
[DEFAULT]
|
||||
support-files =
|
||||
browser_compartments.html
|
||||
browser_compartments_frame.html
|
||||
browser_compartments_script.js
|
||||
workers.html
|
||||
workers_memory.html
|
||||
workers_script.js
|
||||
workers_memory_script.js
|
||||
tab_use_memory.html
|
||||
|
||||
[browser_aboutperformance.js]
|
||||
|
||||
|
|
@ -1,425 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
async function setup_tab(url) {
|
||||
info(`Setting up ${url}`);
|
||||
let tabContent = BrowserTestUtils.addTab(gBrowser, url);
|
||||
|
||||
await BrowserTestUtils.browserLoaded(tabContent.linkedBrowser);
|
||||
|
||||
// For some of these tests we have to wait for the test to consume some
|
||||
// computation or memory.
|
||||
await SpecialPowers.spawn(tabContent.linkedBrowser, [], async () => {
|
||||
await content.wrappedJSObject.waitForTestReady();
|
||||
});
|
||||
|
||||
return tabContent;
|
||||
}
|
||||
|
||||
async function setup_about_performance() {
|
||||
info("Setting up about:performance");
|
||||
let tabAboutPerformance = (gBrowser.selectedTab = BrowserTestUtils.addTab(
|
||||
gBrowser,
|
||||
"about:performance"
|
||||
));
|
||||
|
||||
await BrowserTestUtils.browserLoaded(tabAboutPerformance.linkedBrowser);
|
||||
|
||||
let doc = tabAboutPerformance.linkedBrowser.contentDocument;
|
||||
let tbody = doc.getElementById("dispatch-tbody");
|
||||
|
||||
// Wait until the table has first been populated.
|
||||
await TestUtils.waitForCondition(() => tbody.childElementCount);
|
||||
|
||||
// And wait for another update using a mutation observer, to give our newly created test tab some time
|
||||
// to burn some CPU.
|
||||
await new Promise(resolve => {
|
||||
let observer = new doc.ownerGlobal.MutationObserver(() => {
|
||||
observer.disconnect();
|
||||
resolve();
|
||||
});
|
||||
observer.observe(tbody, { childList: true });
|
||||
});
|
||||
|
||||
return {
|
||||
tab: tabAboutPerformance,
|
||||
doc,
|
||||
tbody,
|
||||
};
|
||||
}
|
||||
|
||||
function find_row(tbody, title, tab) {
|
||||
// Find the row for our test tab.
|
||||
let row = tbody.firstChild;
|
||||
while (row && row.firstChild.textContent != title) {
|
||||
row = row.nextSibling;
|
||||
}
|
||||
|
||||
Assert.ok(row, "found a table row for our test tab");
|
||||
Assert.equal(
|
||||
row.windowId,
|
||||
tab.linkedBrowser.outerWindowID,
|
||||
"the correct window id is set"
|
||||
);
|
||||
|
||||
return row;
|
||||
}
|
||||
|
||||
function checkEnergyMedHigh(row) {
|
||||
let l10nId = row.children[2].getAttribute("data-l10n-id");
|
||||
Assert.ok(
|
||||
["energy-impact-medium", "energy-impact-high"].includes(l10nId),
|
||||
"our test tab is medium or high energy impact"
|
||||
);
|
||||
}
|
||||
|
||||
async function checkMemoryAtLeast(bytes, row) {
|
||||
let memCell = row.children[3];
|
||||
ok(memCell, "Found the cell containing the amount of memory");
|
||||
|
||||
if (!memCell.innerText) {
|
||||
info("There's no text yet, wait for an update");
|
||||
await new Promise(resolve => {
|
||||
let observer = new row.ownerDocument.ownerGlobal.MutationObserver(() => {
|
||||
observer.disconnect();
|
||||
resolve();
|
||||
});
|
||||
observer.observe(memCell, { childList: true });
|
||||
});
|
||||
}
|
||||
|
||||
let text = memCell.innerText;
|
||||
ok(text, "Found the text from the memory cell");
|
||||
// We only bother to work in Megabytes, there's currently no reason to
|
||||
// make this more complex.
|
||||
info(`Text is ${text}.`);
|
||||
let mbStr = text.match(/^(\d+(\.\d+)?) MB$/);
|
||||
ok(mbStr && mbStr[1], "Matched a memory size in Megabytes");
|
||||
if (!mbStr) {
|
||||
return;
|
||||
}
|
||||
|
||||
ok(bytes < Number(mbStr[1]) * 1024 * 1024, "Memory usage is high enough");
|
||||
}
|
||||
|
||||
// Test that we can select the row for a tab and close it using the close
|
||||
// button.
|
||||
add_task(async function test_tab_operations() {
|
||||
let tabContent = await setup_tab(
|
||||
"http://example.com/browser/toolkit/components/aboutperformance/tests/browser/browser_compartments.html?test=" +
|
||||
Math.random()
|
||||
);
|
||||
|
||||
let aboutPerformance = await setup_about_performance();
|
||||
|
||||
// Find the row corresponding to our tab.
|
||||
let row = find_row(
|
||||
aboutPerformance.tbody,
|
||||
"Main frame for test browser_aboutperformance.js",
|
||||
tabContent
|
||||
);
|
||||
|
||||
// Verify selecting a row works.
|
||||
EventUtils.synthesizeMouseAtCenter(
|
||||
row,
|
||||
{},
|
||||
aboutPerformance.tab.linkedBrowser.contentWindow
|
||||
);
|
||||
|
||||
Assert.equal(
|
||||
row.getAttribute("selected"),
|
||||
"true",
|
||||
"doing a single click selects the row"
|
||||
);
|
||||
|
||||
// Verify selecting a tab with a double click.
|
||||
Assert.equal(
|
||||
gBrowser.selectedTab,
|
||||
aboutPerformance.tab,
|
||||
"the about:performance tab is selected"
|
||||
);
|
||||
EventUtils.synthesizeMouseAtCenter(
|
||||
row,
|
||||
{ clickCount: 2 },
|
||||
aboutPerformance.tab.linkedBrowser.contentWindow
|
||||
);
|
||||
Assert.equal(
|
||||
gBrowser.selectedTab,
|
||||
tabContent,
|
||||
"after a double click the test tab is selected"
|
||||
);
|
||||
|
||||
info("Verify we can toggle subitems using a twisty image button");
|
||||
|
||||
// Find the row with subtitems for twisty toggle test group.
|
||||
let twistyBtn = aboutPerformance.doc.querySelector("tr > td.root > .twisty");
|
||||
|
||||
// When "toolkit.aboutPerformance.showInternals=false", there is no Twisty.
|
||||
if (
|
||||
Services.prefs.getBoolPref("toolkit.aboutPerformance.showInternals", false)
|
||||
) {
|
||||
Assert.ok(twistyBtn, "A twisty button was found");
|
||||
let groupRow = twistyBtn.parentNode.parentNode;
|
||||
|
||||
// Verify twisty button is properly set up.
|
||||
Assert.ok(
|
||||
twistyBtn.hasAttribute("aria-label"),
|
||||
"the Twisty image button has an aria-label"
|
||||
);
|
||||
Assert.equal(
|
||||
twistyBtn.getAttribute("aria-label"),
|
||||
groupRow.firstChild.textContent,
|
||||
"the Twisty image button's aria-label is the same as the Name of its row"
|
||||
);
|
||||
Assert.equal(
|
||||
twistyBtn.getAttribute("role"),
|
||||
"button",
|
||||
"the Twisty image is programmatically a button"
|
||||
);
|
||||
Assert.equal(
|
||||
twistyBtn.getAttribute("tabindex"),
|
||||
"0",
|
||||
"the Twisty image button is included in the focus order"
|
||||
);
|
||||
Assert.equal(
|
||||
twistyBtn.getAttribute("aria-expanded"),
|
||||
"false",
|
||||
"the Twisty image button is collapsed by default"
|
||||
);
|
||||
|
||||
// Verify we can toggle/show subitems by clicking the twisty button.
|
||||
EventUtils.synthesizeMouseAtCenter(
|
||||
twistyBtn,
|
||||
{},
|
||||
aboutPerformance.tab.linkedBrowser.contentWindow
|
||||
);
|
||||
Assert.ok(
|
||||
groupRow.nextSibling.children[0].classList.contains("indent"),
|
||||
"clicking a collapsed Twisty adds subitems after the row"
|
||||
);
|
||||
Assert.equal(
|
||||
twistyBtn.getAttribute("aria-expanded"),
|
||||
"true",
|
||||
"the Twisty image button is expanded after a click"
|
||||
);
|
||||
|
||||
// Verify the twisty button can be focused with a keyboard.
|
||||
twistyBtn.focus();
|
||||
Assert.equal(
|
||||
twistyBtn,
|
||||
aboutPerformance.doc.activeElement,
|
||||
"the Twisty image button can be focused"
|
||||
);
|
||||
// Verify we can toggle subitems with a keyboard.
|
||||
// Twisty is expanded
|
||||
EventUtils.synthesizeKey(
|
||||
"KEY_Enter",
|
||||
{},
|
||||
aboutPerformance.tab.linkedBrowser.contentWindow
|
||||
);
|
||||
Assert.ok(
|
||||
!groupRow.nextSibling ||
|
||||
!groupRow.nextSibling.children[0].classList.contains("indent"),
|
||||
"pressing Enter on expanded Twisty removes subitems after the row"
|
||||
);
|
||||
Assert.equal(
|
||||
twistyBtn.getAttribute("aria-expanded"),
|
||||
"false",
|
||||
"the Twisty image button is collapsed after a keypress"
|
||||
);
|
||||
Assert.equal(
|
||||
twistyBtn,
|
||||
aboutPerformance.doc.activeElement,
|
||||
"the Twisty retains focus after the page is updated"
|
||||
);
|
||||
// Twisty is collapsed
|
||||
EventUtils.synthesizeKey(
|
||||
" ",
|
||||
{},
|
||||
aboutPerformance.tab.linkedBrowser.contentWindow
|
||||
);
|
||||
Assert.ok(
|
||||
groupRow.nextSibling.children[0].classList.contains("indent"),
|
||||
"pressing Space on collapsed Twisty adds subitems after the row"
|
||||
);
|
||||
Assert.equal(
|
||||
twistyBtn.getAttribute("aria-expanded"),
|
||||
"true",
|
||||
"the Twisty image button is expanded after a keypress"
|
||||
);
|
||||
|
||||
info("Verify the focus stays on a twisty image button");
|
||||
|
||||
Assert.equal(
|
||||
twistyBtn,
|
||||
aboutPerformance.doc.activeElement,
|
||||
"the Twisty retains focus after the page is updated"
|
||||
);
|
||||
Assert.notEqual(
|
||||
aboutPerformance.doc.activeElement.tagName,
|
||||
"body",
|
||||
"the body does not pull the focus after the page is updated"
|
||||
);
|
||||
EventUtils.synthesizeKey(
|
||||
"KEY_Tab",
|
||||
{ shiftKey: true },
|
||||
aboutPerformance.tab.linkedBrowser.contentWindow
|
||||
);
|
||||
Assert.notEqual(
|
||||
twistyBtn,
|
||||
aboutPerformance.doc.activeElement,
|
||||
"the Twisty does not pull the focus after the page is updated"
|
||||
);
|
||||
} else {
|
||||
Assert.ok(
|
||||
!twistyBtn,
|
||||
"No twisty button should exist when the showInternals pref is false"
|
||||
);
|
||||
}
|
||||
|
||||
info("Verify we can close a tab using the X button");
|
||||
// Switch back to about:performance...
|
||||
await BrowserTestUtils.switchTab(gBrowser, aboutPerformance.tab);
|
||||
// ... and click the X button at the end of the row.
|
||||
let tabClosing = BrowserTestUtils.waitForTabClosing(tabContent);
|
||||
EventUtils.synthesizeMouseAtCenter(
|
||||
row.children[4],
|
||||
{},
|
||||
aboutPerformance.tab.linkedBrowser.contentWindow
|
||||
);
|
||||
await tabClosing;
|
||||
|
||||
BrowserTestUtils.removeTab(aboutPerformance.tab);
|
||||
});
|
||||
|
||||
add_task(async function test_tab_energy() {
|
||||
let tabContent = await setup_tab(
|
||||
"http://example.com/browser/toolkit/components/aboutperformance/tests/browser/browser_compartments.html?test=" +
|
||||
Math.random()
|
||||
);
|
||||
|
||||
let aboutPerformance = await setup_about_performance();
|
||||
|
||||
// Find the row corresponding to our tab.
|
||||
let row = find_row(
|
||||
aboutPerformance.tbody,
|
||||
"Main frame for test browser_aboutperformance.js",
|
||||
tabContent
|
||||
);
|
||||
|
||||
// Ensure it is reported as a medium or high energy impact.
|
||||
checkEnergyMedHigh(row);
|
||||
|
||||
await BrowserTestUtils.removeTab(tabContent);
|
||||
await BrowserTestUtils.removeTab(aboutPerformance.tab);
|
||||
});
|
||||
|
||||
add_task(async function test_tab_memory() {
|
||||
let tabContent = await setup_tab(
|
||||
"http://example.com/browser/toolkit/components/aboutperformance/tests/browser/tab_use_memory.html"
|
||||
);
|
||||
|
||||
let aboutPerformance = await setup_about_performance();
|
||||
|
||||
// Find the row corresponding to our tab.
|
||||
let row = find_row(
|
||||
aboutPerformance.tbody,
|
||||
"Main frame for test browser_aboutperformance.js",
|
||||
tabContent
|
||||
);
|
||||
|
||||
// The page is using at least 32 MB, due to the big array that it
|
||||
// contains.
|
||||
await checkMemoryAtLeast(32 * 1024 * 1024, row);
|
||||
|
||||
await BrowserTestUtils.removeTab(tabContent);
|
||||
await BrowserTestUtils.removeTab(aboutPerformance.tab);
|
||||
});
|
||||
|
||||
add_task(async function test_worker_energy() {
|
||||
let tabContent = await setup_tab(
|
||||
"http://example.com/browser/toolkit/components/aboutperformance/tests/browser/workers.html"
|
||||
);
|
||||
|
||||
let aboutPerformance = await setup_about_performance();
|
||||
|
||||
// Find the row corresponding to our tab.
|
||||
let row = find_row(
|
||||
aboutPerformance.tbody,
|
||||
"Main frame for test browser_aboutperformance.js",
|
||||
tabContent
|
||||
);
|
||||
|
||||
// Find the worker under this row.
|
||||
let button = row.firstChild.firstChild;
|
||||
Assert.ok(button && button.classList, "Has a span to create the button");
|
||||
Assert.ok(button.classList.contains("twisty"), "Button is expandable.");
|
||||
Assert.ok(!button.classList.contains("open"), "Not already open");
|
||||
|
||||
// Click the expand button.
|
||||
EventUtils.synthesizeMouseAtCenter(
|
||||
button,
|
||||
{},
|
||||
aboutPerformance.tab.linkedBrowser.contentWindow
|
||||
);
|
||||
|
||||
Assert.ok(button.classList.contains("open"), "It's now open");
|
||||
|
||||
// Move to the next row which is the worker we want to imspect.
|
||||
row = row.nextSibling;
|
||||
|
||||
// Check that it is a worker.
|
||||
Assert.equal(row.children[1].getAttribute("data-l10n-id"), "type-worker");
|
||||
|
||||
// Ensure it is reported as a medium or high energy impact.
|
||||
checkEnergyMedHigh(row);
|
||||
|
||||
await BrowserTestUtils.removeTab(tabContent);
|
||||
await BrowserTestUtils.removeTab(aboutPerformance.tab);
|
||||
});
|
||||
|
||||
add_task(async function test_worker_memory() {
|
||||
let tabContent = await setup_tab(
|
||||
"http://example.com/browser/toolkit/components/aboutperformance/tests/browser/workers_memory.html"
|
||||
);
|
||||
|
||||
let aboutPerformance = await setup_about_performance();
|
||||
|
||||
// Find the row corresponding to our tab.
|
||||
let row = find_row(
|
||||
aboutPerformance.tbody,
|
||||
"Main frame for test browser_aboutperformance.js",
|
||||
tabContent
|
||||
);
|
||||
Assert.ok(row, "Found the row for our test tab");
|
||||
|
||||
// Find the worker under this row.
|
||||
let button = row.firstChild.firstChild;
|
||||
Assert.ok(button && button.classList, "Has a span to create the button");
|
||||
Assert.ok(button.classList.contains("twisty"), "Button is expandable.");
|
||||
Assert.ok(!button.classList.contains("open"), "Not already open");
|
||||
|
||||
// Click the expand button.
|
||||
EventUtils.synthesizeMouseAtCenter(
|
||||
button,
|
||||
{},
|
||||
aboutPerformance.tab.linkedBrowser.contentWindow
|
||||
);
|
||||
|
||||
Assert.ok(button.classList.contains("open"), "It's now open");
|
||||
|
||||
// Move to the next row which is the worker we want to imspect.
|
||||
row = row.nextSibling;
|
||||
|
||||
// Check that it is a worker.
|
||||
Assert.equal(row.children[1].getAttribute("data-l10n-id"), "type-worker");
|
||||
|
||||
// The page is using at least 32 MB, due to the big array that it
|
||||
// contains.
|
||||
await checkMemoryAtLeast(32 * 1024 * 1024, row);
|
||||
|
||||
await BrowserTestUtils.removeTab(tabContent);
|
||||
await BrowserTestUtils.removeTab(aboutPerformance.tab);
|
||||
});
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>
|
||||
Main frame for test browser_aboutperformance.js
|
||||
</title>
|
||||
</head>
|
||||
<body>
|
||||
Main frame.
|
||||
|
||||
<iframe src="browser_compartments_frame.html?frame=1">
|
||||
Subframe 1
|
||||
</iframe>
|
||||
|
||||
<iframe src="browser_compartments_frame.html?frame=2">
|
||||
Subframe 2.
|
||||
</iframe>
|
||||
|
||||
</body>
|
||||
|
||||
<script>
|
||||
window.waitForTestReady = async () => {
|
||||
// This test page was born ready.
|
||||
};
|
||||
</script>
|
||||
|
||||
</html>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>
|
||||
Subframe for test browser_compartments.html (do not change this title)
|
||||
</title>
|
||||
<script src="browser_compartments_script.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
Subframe loaded.
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
// Use some CPU.
|
||||
var interval = window.setInterval(() => {
|
||||
// Compute an arbitrary value, print it out to make sure that the JS
|
||||
// engine doesn't discard all our computation.
|
||||
var date = Date.now();
|
||||
var array = [];
|
||||
var i = 0;
|
||||
while (Date.now() - date <= 100) {
|
||||
array[i % 2] = i++;
|
||||
}
|
||||
}, 300);
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>
|
||||
Main frame for test browser_aboutperformance.js
|
||||
</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
Mostly empty document, the script creates a big array.
|
||||
</p>
|
||||
</body>
|
||||
<script>
|
||||
var big_array = [];
|
||||
for (let i = 0; i < 4 * 1024 * 1024; i++) {
|
||||
big_array[i] = i*i;
|
||||
}
|
||||
|
||||
window.waitForTestReady = async () => {
|
||||
// big_array is created so we are ready.
|
||||
};
|
||||
</script>
|
||||
</html>
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>
|
||||
Main frame for test browser_aboutperformance.js
|
||||
</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>
|
||||
fib(<span id="n">?</span>) = <span id="result">?</span>
|
||||
</p>
|
||||
|
||||
</body>
|
||||
<script>
|
||||
var result = document.querySelector('#result');
|
||||
var span_n = document.querySelector('#n');
|
||||
var worker = new Worker("workers_script.js");
|
||||
var n = 1;
|
||||
|
||||
var wait = new Promise(ready => {
|
||||
worker.onmessage = function(event) {
|
||||
result.textContent = event.data;
|
||||
span_n.textContent = n;
|
||||
console.log(`Got: fib($n) = $result\n`);
|
||||
n++;
|
||||
ready();
|
||||
// Keep looping to keep the worker as "High energy use"
|
||||
worker.postMessage(n);
|
||||
};
|
||||
});
|
||||
|
||||
worker.postMessage(n);
|
||||
|
||||
window.waitForTestReady = async () => {
|
||||
await wait;
|
||||
};
|
||||
|
||||
</script>
|
||||
</html>
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>
|
||||
Main frame for test browser_aboutperformance.js
|
||||
</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>
|
||||
Result: <span id="result">?</span>
|
||||
</p>
|
||||
|
||||
</body>
|
||||
<script>
|
||||
var result = document.querySelector('#result');
|
||||
var worker = new Worker("workers_memory_script.js");
|
||||
var n = 1;
|
||||
|
||||
var waitPromise = new Promise(ready => {
|
||||
worker.onmessage = function(event) {
|
||||
result.textContent = event.data;
|
||||
ready();
|
||||
|
||||
// We seem to need to keep the worker doing something to keep the
|
||||
// memory usage up.
|
||||
setTimeout(() => {
|
||||
n++;
|
||||
worker.postMessage(n);
|
||||
}, 1000);
|
||||
};
|
||||
});
|
||||
|
||||
worker.postMessage(n);
|
||||
|
||||
window.waitForTestReady = async () => {
|
||||
await waitPromise;
|
||||
};
|
||||
</script>
|
||||
</html>
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
var big_array = [];
|
||||
var n = 0;
|
||||
|
||||
onmessage = function (e) {
|
||||
var sum = 0;
|
||||
if (n == 0) {
|
||||
for (let i = 0; i < 4 * 1024 * 1024; i++) {
|
||||
big_array[i] = i * i;
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < 4 * 1024 * 1024; i++) {
|
||||
sum += big_array[i];
|
||||
big_array[i] += 1;
|
||||
}
|
||||
}
|
||||
self.postMessage(`Iter: ${n}, sum: ${sum}`);
|
||||
n++;
|
||||
};
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
function fib(n) {
|
||||
if (n < 2) {
|
||||
return 1;
|
||||
}
|
||||
return fib(n - 1) + fib(n - 2);
|
||||
}
|
||||
|
||||
onmessage = function (e) {
|
||||
self.postMessage(fib(Number(e.data)));
|
||||
};
|
||||
|
|
@ -14,7 +14,6 @@ if CONFIG["MOZ_HAS_REMOTE"]:
|
|||
DIRS += [
|
||||
"aboutcheckerboard",
|
||||
"aboutmemory",
|
||||
"aboutperformance",
|
||||
"aboutprocesses",
|
||||
"alerts",
|
||||
"antitracking",
|
||||
|
|
|
|||
|
|
@ -1,67 +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/.
|
||||
|
||||
# Page title
|
||||
about-performance-title = Task Manager
|
||||
|
||||
## Column headers
|
||||
|
||||
column-name = Name
|
||||
column-type = Type
|
||||
column-energy-impact = Energy Impact
|
||||
column-memory = Memory
|
||||
|
||||
## Special values for the Name column
|
||||
|
||||
ghost-windows = Recently closed tabs
|
||||
# Variables:
|
||||
# $title (String) - the title of the preloaded page, typically 'New Tab'
|
||||
preloaded-tab = Preloaded: { $title }
|
||||
|
||||
## Values for the Type column
|
||||
|
||||
type-tab = Tab
|
||||
type-subframe = Subframe
|
||||
type-tracker = Tracker
|
||||
type-addon = Add-on
|
||||
type-browser = Browser
|
||||
type-worker = Worker
|
||||
type-other = Other
|
||||
|
||||
## Values for the Energy Impact column
|
||||
##
|
||||
## Variables:
|
||||
## $value (Number) - Value of the energy impact, eg. 0.25 (low),
|
||||
## 5.38 (medium), 105.38 (high)
|
||||
|
||||
energy-impact-high = High ({ $value })
|
||||
energy-impact-medium = Medium ({ $value })
|
||||
energy-impact-low = Low ({ $value })
|
||||
|
||||
## Values for the Memory column
|
||||
##
|
||||
## Variables:
|
||||
## $value (Number) - How much memory is used
|
||||
|
||||
size-KB = { $value } KB
|
||||
size-MB = { $value } MB
|
||||
size-GB = { $value } GB
|
||||
|
||||
## Tooltips for the action buttons
|
||||
|
||||
close-tab =
|
||||
.title = Close tab
|
||||
show-addon =
|
||||
.title = Show in Add-ons Manager
|
||||
|
||||
# Tooltip when hovering an item of the about:performance table
|
||||
# Variables:
|
||||
# $totalDispatches (Number) - how many dispatches occurred for this page since it loaded
|
||||
# $totalDuration (Number) - how much CPU time was used by this page since it loaded
|
||||
# $dispatchesSincePrevious (Number) - how many dispatches occurred in the last 2 seconds
|
||||
# $durationSincePrevious (Number) - how much CPU time was used in the last 2 seconds
|
||||
item =
|
||||
.title =
|
||||
Dispatches since load: { $totalDispatches } ({ $totalDuration }ms)
|
||||
Dispatches in the last seconds: { $dispatchesSincePrevious } ({ $durationSincePrevious }ms)
|
||||
|
|
@ -105,9 +105,7 @@
|
|||
skin/classic/global/icons/security-broken.svg (../../shared/icons/security-broken.svg)
|
||||
skin/classic/global/icons/security-warning.svg (../../shared/icons/security-warning.svg)
|
||||
skin/classic/global/icons/settings.svg (../../shared/icons/settings.svg)
|
||||
skin/classic/global/icons/shortcut.svg (../../shared/icons/shortcut.svg)
|
||||
skin/classic/global/icons/sort-arrow.svg (../../shared/icons/sort-arrow.svg)
|
||||
skin/classic/global/icons/trackers.svg (../../shared/icons/trackers.svg)
|
||||
skin/classic/global/icons/trending.svg (../../shared/icons/trending.svg)
|
||||
skin/classic/global/icons/update-icon.svg (../../shared/icons/update-icon.svg)
|
||||
skin/classic/global/icons/arrow-down-12.svg (../../shared/icons/arrow-down-12.svg)
|
||||
|
|
|
|||
|
|
@ -1,4 +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/. -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="context-fill" d="M11 2H5a1 1 0 0 0 0 2h3.59L6.05 6.54a7 7 0 0 0-2 5V13a1 1 0 0 0 2 0v-1.51A5 5 0 0 1 7.46 8L10 5.41V9a1 1 0 0 0 2 0V3a1 1 0 0 0-1-1z"/></svg>
|
||||
|
Before Width: | Height: | Size: 442 B |
|
|
@ -1,9 +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/. -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16" fill="context-fill" fill-opacity="context-fill-opacity">
|
||||
<path d="m6 10.5 0 .5c0 1.1-.9 2-2 2-1.1 0-2-.9-2-2l0-.5a.5.5 0 0 1 .5-.5l3 0a.5.5 0 0 1 .5.5z"/>
|
||||
<path d="m5.805 7.084-.257 1.671-3.503 0-.309-1.474a3.79 3.79 0 0 0-.237-.751c-.179-.409-.463-1.147-.49-1.77-.257-5.847 5.268-6.552 5.683-.75.046.643-.153 1.651-.52 2.181-.199.29-.318.577-.367.893z"/>
|
||||
<path d="m13.07 12.5 0 .5c0 1.1-.9 2-2 2-1.1 0-2-.9-2-2l0-.5a.5.5 0 0 1 .5-.5l3 0a.5.5 0 0 1 .5.5z"/>
|
||||
<path d="m9.679 8.669-.037 2.081 3.521 0 .49-1.18c.098-.245.217-.478.363-.698.247-.371.655-1.05.79-1.658C16.074 1.5 10.755-.153 9.339 5.488c-.157.625-.136 1.652.133 2.239.147.32.214.623.207.942z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 966 B |
|
|
@ -106,12 +106,6 @@ ID02:
|
|||
- find
|
||||
- new-tab
|
||||
- share
|
||||
# toolkit/locales/en-US/toolkit/about/aboutPerformance.ftl
|
||||
- type-tab
|
||||
- size-KB
|
||||
- size-MB
|
||||
- size-GB
|
||||
- item
|
||||
# toolkit/locales/en-US/toolkit/about/aboutPlugins.ftl
|
||||
- file-dd
|
||||
- path-dd
|
||||
|
|
|
|||
Loading…
Reference in a new issue