[new profiler] Active Tab view isn't triggers from the Web Developer preset when using the Devtools panel
Categories
(DevTools :: Performance Tools (Profiler/Timeline), defect, P2)
Tracking
(Not tracked)
People
(Reporter: julienw, Unassigned)
Details
STR1:
- Open the devtools performance panel. (make sure the new tool is selected in the devtools settings).
- Select the "Web Developer" preset.
- Start and capture a profile.
=> The profiler UI should be in active tab mode (it should have one track, with a button at the top right reading "Full View")
STR2:
Setup:
- run firefox with
--start-debugger-server
- connect to this firefox from about:debugging, with the endpoint
localhost:6000
.
Then same thing than STR1
Reporter | ||
Comment 1•3 years ago
|
||
When using the toolbar button, we use this path:
https://searchfox.org/mozilla-central/rev/294f10eff7398d6b05beac6aa256d86ac3cb7113/devtools/client/performance-new/popup/background.jsm.js#260-264
This properly gets the value for profilerViewMode
.
On the other hand, when using the devtools interface, we use this path:
https://searchfox.org/mozilla-central/rev/294f10eff7398d6b05beac6aa256d86ac3cb7113/devtools/client/performance-new/store/actions.js#214-216
The problem is that selectors.getProfilerViewMode
returns undefined, because it simply returns the state profilerViewMode
but there's no reducer for this state! So it's undefined.
I think that instead of implementing a reducer, we could remove this selector, and use getProfilerViewModeForCurrentPreset
directly from https://searchfox.org/mozilla-central/rev/294f10eff7398d6b05beac6aa256d86ac3cb7113/devtools/client/performance-new/popup/background.jsm.js#215. But I'm not sure that we can access it from actions.js
(?). (we do have the page context available from a selector though).
Or we can implement this selector to use getProfilerViewModeForCurrentPreset
but the same question is present: we need to access background.jsm.js
from selectors.js
.
Or we can reimplement getProfilerViewModeForCurrentPreset
using the states presets
and presetName
(as a selector). (probably the easiest if we can't access the functions in background.jsm.js).
As a last resort we can implement this reducer by mimicing the reducer for the presetName (action.preset.profilerViewMode
should have the value).
As a side note, I think that currently pageContext
is always aboutprofiling
when calling getProfilerViewModeForCurrentPreset
so we could possibly simplify all this if we don't use it in this case.
Reporter | ||
Comment 3•3 years ago
|
||
I believe so, thanks!
Description
•