Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit bbce1a7

Browse files
committed
Bug 1734738 - [aboutprofiling] Disable all threads checkboxes when the 'all threads' checkbox is checked r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D128100
1 parent 0fa293c commit bbce1a7

File tree

4 files changed

+14
-17
lines changed

4 files changed

+14
-17
lines changed

devtools/client/performance-new/components/Settings.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ const {
6666
h3,
6767
section,
6868
p,
69+
span,
6970
} = require("devtools/client/shared/vendor/react-dom-factories");
7071
const Range = createFactory(
7172
require("devtools/client/performance-new/components/Range")
@@ -264,6 +265,7 @@ class Settings extends PureComponent {
264265
*/
265266
_renderThreadsColumns(threadDisplay, index) {
266267
const { threads } = this.props;
268+
const areAllThreadsIncluded = threads.includes("*");
267269
return div(
268270
{ className: "perf-settings-thread-column", key: index },
269271
threadDisplay.map(({ name, id, l10nId }) =>
@@ -272,8 +274,11 @@ class Settings extends PureComponent {
272274
{ id: l10nId, attrs: { title: true }, key: name },
273275
label(
274276
{
275-
className:
276-
"perf-settings-checkbox-label perf-settings-thread-label toggle-container-with-text",
277+
className: `perf-settings-checkbox-label perf-settings-thread-label toggle-container-with-text ${
278+
areAllThreadsIncluded
279+
? "perf-settings-checkbox-label-disabled"
280+
: ""
281+
}`,
277282
},
278283
input({
279284
className: "perf-settings-checkbox",
@@ -282,9 +287,10 @@ class Settings extends PureComponent {
282287
// Do not localize the value, this is used internally by the profiler.
283288
value: name,
284289
checked: threads.includes(name),
290+
disabled: areAllThreadsIncluded,
285291
onChange: this._handleThreadCheckboxChange,
286292
}),
287-
name
293+
span(null, name)
288294
)
289295
)
290296
)

devtools/client/performance-new/test/browser/browser_aboutprofiling-threads-behavior.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ add_task(async function test() {
103103
"Asterisk was in the thread text input"
104104
);
105105

106+
is(styleThreadCheckbox.disabled, true, "The Style Thread is now disabled.");
107+
106108
// Remove the asterisk
107109
setReactFriendlyInputValue(
108110
threadTextEl,
@@ -111,6 +113,7 @@ add_task(async function test() {
111113
threadTextEl.dispatchEvent(new Event("blur", { bubbles: true }));
112114

113115
ok(!allThreadsCheckbox.checked, "The all threads checkbox is not checked.");
116+
is(styleThreadCheckbox.disabled, false, "The Style Thread is now enabled.");
114117
});
115118
});
116119

devtools/client/performance-new/test/browser/browser_aboutprofiling-threads.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,7 @@ add_task(async function test() {
77
info("Test that about:profiling can be loaded, and the threads changed.");
88

99
await withAboutProfiling(async document => {
10-
const geckoMainLabel = await getElementFromDocumentByText(
11-
document,
12-
"GeckoMain"
13-
);
14-
const geckoMainInput = geckoMainLabel.querySelector("input");
15-
if (!geckoMainInput) {
16-
throw new Error("Unable to find the input from the GeckoMain label.");
17-
}
10+
const geckoMainInput = await getNearestInputFromText(document, "GeckoMain");
1811

1912
ok(
2013
geckoMainInput.checked,

devtools/client/performance-new/test/browser/browser_interaction-between-interfaces.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,10 @@ add_task(async function test_change_in_about_profiling() {
230230
// Let's check some thread as well
231231
info("Change the threads values using the checkboxes");
232232

233-
const styleThreadLabel = await getElementFromDocumentByText(
233+
const styleThreadInput = await getNearestInputFromText(
234234
aboutProfilingDocument,
235235
"StyleThread"
236236
);
237-
const styleThreadInput = styleThreadLabel.querySelector("input");
238-
if (!styleThreadInput) {
239-
throw new Error("Unable to find the input from the StyleThread label.");
240-
}
241-
242237
ok(
243238
!styleThreadInput.checked,
244239
"The StyleThread thread isn't checked by default."

0 commit comments

Comments
 (0)