This should fix the intermittents
> TEST-UNEXPECTED-FAIL | devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_storage.js | undefined assertion name - Got +0, expected 2
Note that there are other existing intermittents (timeouts mostly) which I have not investigated
Differential Revision: https://phabricator.services.mozilla.com/D153325
We remove all messages from target destroy with `isModeSwitching`, as well as
prune unhandled resources in the WebconsoleWrapper queues.
Finally, we also cleanup the resource command pendingEvents so we don't receive
resources after the target was destroyed.
Differential Revision: https://phabricator.services.mozilla.com/D152031
We need to load the toolbox.ftl bundle and wrap the WebConsole App in a LocalizationProvider
when we're in the Browser Console.
Differential Revision: https://phabricator.services.mozilla.com/D150576
This adds an additional toolbar in the Browser Toolbox which will contain specific
tools and options.
At the moment we only display a couple input button to be able to switch from
Parent process only to multiprocess mode.
We remove the similar UI in the iframe picker and adapt the existing test.
A trait is added to not show the toolbar when debugging server where we wouldn't
get the `isSwitchingMode` property in `onTargetDestroyed`, as this can cause
misbehavior in various tool when switching between different modes.
Differential Revision: https://phabricator.services.mozilla.com/D150575
We remove all messages from target destroy with `isModeSwitching`, as well as
prune unhandled resources in the WebconsoleWrapper queues.
Finally, we also cleanup the resource command pendingEvents so we don't receive
resources after the target was destroyed.
Differential Revision: https://phabricator.services.mozilla.com/D152031
We need to load the toolbox.ftl bundle and wrap the WebConsole App in a LocalizationProvider
when we're in the Browser Console.
Differential Revision: https://phabricator.services.mozilla.com/D150576
This adds an additional toolbar in the Browser Toolbox which will contain specific
tools and options.
At the moment we only display a couple input button to be able to switch from
Parent process only to multiprocess mode.
We remove the similar UI in the iframe picker and adapt the existing test.
A trait is added to not show the toolbar when debugging server where we wouldn't
get the `isSwitchingMode` property in `onTargetDestroyed`, as this can cause
misbehavior in various tool when switching between different modes.
Differential Revision: https://phabricator.services.mozilla.com/D150575
Previously when closing the breakpoints panel in secondary panes,
if an unselected call stack frame was selected, the breakpoints
panel would unexpectedly open. This patch makes sure it remains
closed when a user has closed it and then clicks other elements
in the secondary panes. The same issue was happening when
clicking the event listener breakpoint log checkbox, and or step
in, step out, and step over. This patch should also fix
Bug 1755337.
Add mochitest.
Fix mochitest issues and move isFrameSelected to shared-head.js
Fix linting issues.
Merge new mochitests into browser_dbg-state-based-panels.js
Add condition to SecondaryPanes/index.js
Add PropTypes to index.js
Add logic to reducers/pause.js
Add selector to selectors/pause.js
Add breakpointsPane action to pause/actions
Update mochitests to test for edge case
Remove dbg_browser-breakpoints-secondary-pane.js
Fix linting
Make changes suggest by reviewer
Add additional mochitest for event breakoints log
Remove unnecessary parameters from action
Fix mozbuild order
Remove previewPausedLocation.js from mozbuild to fix conflict
Differential Revision: https://phabricator.services.mozilla.com/D149994
We pass `isModeSwitching` to `unwatchTargets` from the target command when the
pref is changed.
On the server, we then pass it to the various places which might call `notifyTargetDestroyed`,
so we can pass the flag in the `target-destroyed-form` event, which we can then
pass to TargetCommand#onDestroyed callbacks.`
Differential Revision: https://phabricator.services.mozilla.com/D152758
Changes in Bug 1754407 caused a performance regression as it now triggered
syntax highlighting of big files, which we avoided before.
This is because we don't call `isMinified` with the expected type of data, causing
the file to not be seen as minified, and thus highlighting it.
Differential Revision: https://phabricator.services.mozilla.com/D153140
There are potentially several sources for the recent netmonitor intermittent failures.
One of them is that we have several helpers to "wait" for requests, and they have a logic so that when they spot a request, they will wait for the request to be
completed.
However if a navigation occurs in the middle, the corresponding resource will be cleared and the updates will not be processed.
So here we emit a test-only event when the netmonitor attempts to clear resources, so that test helpers can update accordingly.
Differential Revision: https://phabricator.services.mozilla.com/D152726
This doesn't change anything. It actually complexify things a bit.
But this will be an helpful change we can do right away in order to help
create a unique Source object per URL (instead of per URL and target).
Differential Revision: https://phabricator.services.mozilla.com/D151553
This introduces a new reducer in order to maintain a Source Tree data structure.
A Source Tree is composed of:
* Thread Items
To designate targets/threads. These are the roots of the Tree if no project directory is selected.
* Group Items
To designates the different domains used in the website.
These are direct children of threads and may contain directory or source items.
* Directory Items
To designate all the folders. Note that each every folder has an items.
The Source Tree React component is doing the magic to coallesce folders made
of only one sub folder.
* Source Items
To designate sources. They are the leaves of the Tree.
(we should not have empty directories.)
See the creation methods in the reducer to see the various attributes available on each Item type.
Project root implementation has been simplified, but there is still subtantial complexity around it.
Also, there is a behavior change. Now the project root is thread specific,
whereas before it could be per domain/URL across threads.
The complexity of it is around preserving the `uniquePath` across reloads.
Because uniquePath starts with the thread actor ID, it can't be preserved across reload.
Instead, we replace the thread actor ID with "top-level" string.
This means that project root isn't preserved across reload for non-top-level targets.
About `uniquePath` attribute available on all items,
this will be the Path in ManagedTree and Key in Tree components.
i.e. a unique identifier for any item in the Tree.
The isWebExtension check is simplified to fetch it from the thread object,
instead of having to involve the "CONNECT" action.
Depends on D151467
Differential Revision: https://phabricator.services.mozilla.com/D150548
Update the test helper getRuleViewProperty to support an async version via a `wait` option.
When passed, the helper will keep polling until there is a valid ruleviewproperty which matches the arguments.
This can avoid race issues when the API is used too early.
In this changeset we also start using this API in all tests which either:
- used to manually poll getRuleViewProperty
- were disabled on linux for getRuleViewProperty issues
- are currently intermittent because of getRuleViewProperty
Differential Revision: https://phabricator.services.mozilla.com/D152286
This reverts clearing the async store when all breakpoints are removed.
So only the breakpoints the user expects to get removed actually gets removed.
Differential Revision: https://phabricator.services.mozilla.com/D151884
In a few places we were using the variable to have a different background than
the ones we have everywhere (blueish on light theme, dark-grey blue in dark mode).
In order to avoid any confusion, this patch adds a dedicated variable with a name
that should be more explicit.
Differential Revision: https://phabricator.services.mozilla.com/D150574
Unfortunately, we filter out sources *after* having formated them.
So we can avoid formatting all the sources here.
I haven't investigated, but it would be nice to be able to filter out the sources
before formating them.
Differential Revision: https://phabricator.services.mozilla.com/D152014
In a few places we were using the variable to have a different background than
the ones we have everywhere (blueish on light theme, dark-grey blue in dark mode).
In order to avoid any confusion, this patch adds a dedicated variable with a name
that should be more explicit.
Differential Revision: https://phabricator.services.mozilla.com/D150574
This was only _not_ rendering when `terminalEagerResult` was `null`, but with
Bug 1776376, we're getting `undefined` results in some case, which was crashing
the component.
While this should be fixed at an upper level, this patch makes the component a bit
more robust so we don't crash the whole console client.
A node test is added for basic rendering with various result values, and proper
mochitest will be added in follow-up patches in this queue.
Differential Revision: https://phabricator.services.mozilla.com/D152161
Each line of the edit and resend panel should no longer grow when resizing the panel
But when editing, we fallback to multiline
Differential Revision: https://phabricator.services.mozilla.com/D152006
This allows to pull out target management code out from toolbox back to TargetCommand.
And then allows to more easily share this store in the context of the browser console,
where there is no toolbox.
This is also an interesting example on how commands may populate redux store directly
so that we avoid having each panel translate commands's event into actions.
An alternative here, would be to introduce some generic layer between commands and redux.
Which would be the glue between a command and populating a store.
Differential Revision: https://phabricator.services.mozilla.com/D151493
We directly pass the editor stylesheet in the `location` parameter that is passed
to `jumpToLocation`.
`jumpToLocation` wasn't covered in any test, so we modify `browser_styleeditor_media_sidebar.js`
to add coverage for it.
This is also testing Bug 1779180 which is in the same stack.
Differential Revision: https://phabricator.services.mozilla.com/D151597
For <style> elements, `getRelativeRuleLine` gives us the position of the rule
inside a stylesheet, when `getRuleLine` gives the position of the rule relatively
to the whole HTML source.
The former is more accurate for us when we want to display such line number in
DevTools UI (for example in the StyleEditor media query sidebar).
Test will be added in next patch of this queue.
Differential Revision: https://phabricator.services.mozilla.com/D151596
Enable clearing of network resources on all layers(frontend, resource layer, server) when the
user click the clear button.
Differential Revision: https://phabricator.services.mozilla.com/D148694
We directly pass the editor stylesheet in the `location` parameter that is passed
to `jumpToLocation`.
`jumpToLocation` wasn't covered in any test, so we modify `browser_styleeditor_media_sidebar.js`
to add coverage for it.
This is also testing Bug 1779180 which is in the same stack.
Differential Revision: https://phabricator.services.mozilla.com/D151597
For <style> elements, `getRelativeRuleLine` gives us the position of the rule
inside a stylesheet, when `getRuleLine` gives the position of the rule relatively
to the whole HTML source.
The former is more accurate for us when we want to display such line number in
DevTools UI (for example in the StyleEditor media query sidebar).
Test will be added in next patch of this queue.
Differential Revision: https://phabricator.services.mozilla.com/D151596
There are some uses without `JS::` namespace in `devtools/`. The autofix adds `JS::` everywhere and this patch intentionally keeps that for consistency, given that most of the code uses `JS::`.
Differential Revision: https://phabricator.services.mozilla.com/D151792
This patch introduces animation-composition longhand but we don't
accept it in @keyframe rule for now. I will support this for @keyframe
in the patch series.
Besides, the shorthand of animation doesn't include animation-composition.
The spec issue is: https://github.com/w3c/csswg-drafts/issues/6946.
We could fix the shorthand once this spec issue gets updated.
Differential Revision: https://phabricator.services.mozilla.com/D150299
We are currently duplicated source's framework in symbols and tabs reducers.
This is uncessary and confusing. And this possibly lead to more state/component updates.
This is mostly used to computed the source icon.
I extented test coverage to better cover the behavior of SourceIcon,
while simplifying a few things around this component by unifying the various places
where we compute the final icon, so that now it is only done by getSourceClassnames
and modifier.
Differential Revision: https://phabricator.services.mozilla.com/D151358
While I'm around QuickOpen modal, I also cleanup a few things around formatSources
and avoid computing more formatting than what the modal will display.
Differential Revision: https://phabricator.services.mozilla.com/D151285
This allows to make the reducer Source object fully immutable.
`isBlackBoxed` was the last mutable attribute of it.
Doing this help pass along source object without having to care if it will ever update.
This should also help reduce the number of unecessary update to components
which manipulate sources but ignore their blackbox state.
Differential Revision: https://phabricator.services.mozilla.com/D151005
The first step of parsing custom formatters for objects is checking a website for a global array called `devtoolsFormatters`.
If this array exists, it is looped over to find a custom formatter that can handle the object.
In case there is one, its `header` and `hasBody` methods are executed using `makeSideeffectFreeDebugger()` to ensure to get a result without causing any negative side effects.
Those results are then returned together with the index of the custom formatter.
This index is used in case the custom formatter's body is expandedö. In that case the `body` property is also executed in a safe way and its value then returned.
A test covers basic support of custom formatting for objects. More advanced tests will be added in bug 1752759.
Differential Revision: https://phabricator.services.mozilla.com/D146389
Enable clearing of network resources on all layers(frontend, resource layer, server) when the
user click the clear button.
Differential Revision: https://phabricator.services.mozilla.com/D148694
No conclusive results on try. Waiting for the property container to be ready should at least help invsestigate if we get more failures
Differential Revision: https://phabricator.services.mozilla.com/D151425
The container is turned into a footer and moved outside of
its current parent so it always stick to the bottom.
CSS was tweaked to keep it nice.
Differential Revision: https://phabricator.services.mozilla.com/D151284
This is done by adding `color-mix` to `COLOR_TAKING_FUNCTIONS`.
Test case is added, alongside with cases for other functions in which we
should show color swatches.
Differential Revision: https://phabricator.services.mozilla.com/D151224
In the browser toolbox window, we include common.css, but we don't
apply the theme-dark/theme-light classes, so we end up overriding the
color-scheme to light.
Instead, only override color-scheme for theme-light/theme-dark, so that
context menus and so have the right appearance.
Differential Revision: https://phabricator.services.mozilla.com/D151131
In this patch
- Added remove all breakpoints button in the Breakpoints list header bar
- Start clearing `asyncStore.pendingBreakpoints` when we remove all the breakpoints
- Add jest tests
Differential Revision: https://phabricator.services.mozilla.com/D150350
The test seemed to fail because the browsers was firing requests we weren't expecting.
To fix this, we set a few preferences that should prevent such requests to be made.
Differential Revision: https://phabricator.services.mozilla.com/D150953
The "group" is defined by getDisplayURL method.
Instead of modifying late in the UI, we should rather set it to the right value upfront.
Also avoid computing `extensionName` from the actor when the URL isn't an extension one.
Differential Revision: https://phabricator.services.mozilla.com/D150745
The test seemed to fail because the browsers was firing requests we weren't expecting.
To fix this, we set a few preferences that should prevent such requests to be made.
Differential Revision: https://phabricator.services.mozilla.com/D150953
The compatibility panel tests should now work both with the current browser data and with the update from D150961
We will still need to find a reliable way to avoid breakage when a data dump occurs.
Differential Revision: https://phabricator.services.mozilla.com/D150981
This introduces functionality to support disabling weconsole messages.
Also introduces code to disable all network messages, which would be
used by the netmonitor.
You'll probably need the fullstack of patches to test easily
Will add mochitest in a followup
Differential Revision: https://phabricator.services.mozilla.com/D149753
`WebConsoleConnectionProxy` is now only used for:
- listening to `lastPrivateContextExited`, which can be done from the top-level
console front instead
- setting `NetworkMonitor.saveRequestAndResponseBodies` for toolbox we don't have
network resource support for, which would be better done in `startWatchingNetworkResources`.
This means we don't need to keep a Map of additional proxies.
The only impact is on `clearMessagesCache`, where we now fetch all fronts with
`getAllFronts` instead of looping through the Map of additional proxies.
This change highlighted some race condition in tests, as it's now slightly slower.
So we add a new `clearMessagesCacheAsync` function, which is doing the same thing
as `clearMessagesCache`, except it's not `oneway`, so we can know when the cache
was indeed cleared, and we emit an event to indicate when the cache was cleared.
We can't simply remove `oneway` from `clearMessagesCache` as it causes backward
compatibility issues we can't avoid.
This also highlighted an issue with the cache not being cleared on `console.clear`
when it is batched, so we fix this (a test was failing without it).
The next patch in the queue will completely remove `WebConsoleConnectionProxy`.
Differential Revision: https://phabricator.services.mozilla.com/D150085
I checked that skipping the test does not move the intermittent to the next test.
I am not sure what makes this test problematic, I suppose this has to do with initializing widgets in the inspector to handler filters.
Let's skip this on linux for now.
Differential Revision: https://phabricator.services.mozilla.com/D150859
In the following patches, this test started failing because of some
race condition between the test trying to expand the tree
and selectSource also trying to expand the tree.
We ended up we the tree being collapsed.
We no longer have to manually expand the tree as selectSource will now do it.
Differential Revision: https://phabricator.services.mozilla.com/D150547
This was causing infinite look in my following patches.
I don't get why this wasn't an issue before, but it sounds good doing
to avoid unecessary component updates.
Differential Revision: https://phabricator.services.mozilla.com/D150546
This css rules comes from ancient time and couldn't find the reason why this was added.
This is actually the immediate children of the project root which are misaligned.
That get an extra padding that make them look like they are in a sub folder.
I do not see the value of adding an extra padding. We still have some margin even after removing it.
Differential Revision: https://phabricator.services.mozilla.com/D150545
By moving the computation of displayURL from the SourceTree selector to the sources reducer,
we ensure computing it only once. We could also get rid of all the redundant getURL usages.
Note that we were never defaulting to mainThreadHost in getDisplayURL,
nor were we having any source with a false "group".
So we could simplify the logic a bit.
Differential Revision: https://phabricator.services.mozilla.com/D150608
Note that I'm not sure the bug is so common.
The test involved here use a very old deprecated codepath, where we spawn a toolbox
for a given worker. Nowadays we only support that for service workers.
I had to tweak a couple of tests in order to acknowledge that the worker url
could be absolute URL now (instead of only a file name).
Differential Revision: https://phabricator.services.mozilla.com/D150543
The test doesn't really cover this fix as mochitest head files will force loading gDevTools...
To properly cover that we would have to have this test in another file and folder without any head.
This will make it hard to reuse Debugger test helpers. Let's assume we cover the modified feature
while not covering the very precise regression I fix here.
Differential Revision: https://phabricator.services.mozilla.com/D150155
That, when the target is destroyed for any reason other than the process destruction or
when we stop watching for content process targets.
In these two cases, we will notify about the target destruction.
AFAIK, this is actually the only two reasons when a content process target is destroyed.
But it would be safer to assume that the target might be destroyed for some other reason
and have the client to be notified.
Depends on D148529
Differential Revision: https://phabricator.services.mozilla.com/D148137
Not entirely clear why using the body fails sometimes on linux, but adding a first step of selecting a node is more inline with what other tests do, and
fixes the intermittent for me
Differential Revision: https://phabricator.services.mozilla.com/D150532
This preference drives the "Show user agent" feature accessible from the RDM options.
Flipping it to true will make the User agent input visible on all channels by default, but the feature itself was already available everywhere.
You just had to first select "Show user agent" in devedition/beta/release to show the input. I think the feature is useful enough to enable it by default.
Also we run all our tests with the preference forced to true.
Differential Revision: https://phabricator.services.mozilla.com/D150455
We get some intermediate state update when sourceTextContent is loading.
The goal is to reduce the calls to any CodeMirror API.
Differential Revision: https://phabricator.services.mozilla.com/D149896
Also stop passing `frame` to DebugLine which wasn't using this attribute.
This might prevent unnecessary component updates.
Differential Revision: https://phabricator.services.mozilla.com/D149895
We typically dispatch a PAUSED actions, with only the first frames,
and later dispatch FETCHED_FRAMES, with the full list of frames.
Avoid modifying the first one, which is typically the selected one
in order to avoid uncessary state changes.
Differential Revision: https://phabricator.services.mozilla.com/D149879
Now that we no longer have the intermediate "loading" object,
we can simplify the code checking for loading symbols by checking
if symbols are defined.
Differential Revision: https://phabricator.services.mozilla.com/D149856
This helps reduce the number of state changes and the number of renders.
We now switch from null symbols which means they are loading,
to an object with the loaded symbols.
Differential Revision: https://phabricator.services.mozilla.com/D149855
There is many props that are only relevant to the children components,
and we were calling expensive CodeMirror method on any prop change.
Differential Revision: https://phabricator.services.mozilla.com/D149853
browser_console_enable_network_monitoring.js is failing on beta because MBT is not enabled by default
so the the leagcy-listener copepath is used. This adds `chromeContext` to the network resource and fixes
the issue.
Differential Revision: https://phabricator.services.mozilla.com/D150328
When the last visible message was an evaluation result
but the last message in the store was something else,
the console would trigger the pin-to-bottom behavior.
This is fixed by checking if the last message in the
store (and not the last visible message) is a result.
A test case is added to make sure we don't regress.
Differential Revision: https://phabricator.services.mozilla.com/D150225
That, when the target is destroyed for any reason other than the process destruction or
when we stop watching for content process targets.
In these two cases, we will notify about the target destruction.
AFAIK, this is actually the only two reasons when a content process target is destroyed.
But it would be safer to assume that the target might be destroyed for some other reason
and have the client to be notified.
Depends on D148529
Differential Revision: https://phabricator.services.mozilla.com/D148137
persistTabs should only be used when we want to clear the tabs list
and have the persisted tab to be re-created (made visible, with a sourceId) when a new source matching the same url is created.
Also cleanup a few things and avoid returning new state objects unless we really changed something.
Differential Revision: https://phabricator.services.mozilla.com/D149523
Add an implementation of CSS `contain: style`. This introduces two new
data structures, the ContainStyleScope and ContainStyleScopeManager.
ContainStyleScope manages one `contain: style` "world" which has its own
counter and quote lists. The contents of these lists depend on their
parent scopes, but are not affected by their children.
ContainStyleScopeManager manages a tree of scopes starting at a root
scope which is outside of any `contain: style` element.
Scopes are stored in a hash table that is keyed off of the nsIContent
which establishes the `contain: style` scope. When modifying quote or
content lists, the ContainStyleScopeManager is responsible for finding
the appropriate `contain: style` scope to modify.
Perhaps the most complex part of this is that counters and quotes have
read access to the state of counters and quotes that are in ancestor
`contain: style` scopes. In the case of counters, USE nodes that are at
the beginning of counter lists might have a counter scope that starts in
an ancestor `contain: style` scope. When nsCounterNode::SetScope() is
called, the code may look upward in the `contain: style` scope tree to
find the start of the counter scope. In the case of quotes, the first
node in the quote list must look for the state of quotes in ancestor
`contain: style` scopes.
Differential Revision: https://phabricator.services.mozilla.com/D149508
The link was missing an event listener, that we add in this patch.
A test case is added to make sure the link does work.
Differential Revision: https://phabricator.services.mozilla.com/D149953