There was this unique check against non-breakable lines.
browser_dbg-breakable-lines.js now test this much more in depth.
This old unique assertion is not worth keeping.
Differential Revision: https://phabricator.services.mozilla.com/D139481
This test does a bunch of assertions for a series of events which
is complex and not reliable. It also becomes overly complicated when
Fission is enabled. Looks like this test isn't really needed, so
we are removing it.
Differential Revision: https://phabricator.services.mozilla.com/D139604
After this patch, we only need to remove the ignore from /.eslintignore.
My goal originaly was to simply add `import-globals-from` comments in helpers.js
But because of cross dependencies between head.js and helpers.js, it wasn't so trivial.
I first tried to merge them into a unique head.js, but the EXAMPLE_URL symbol
should not be imported by tests external to the debugger.
So I aligned debugger to the common practice of naming the shared head file... shared-head.js!
Like the inspector is doing.
I also merged helpers/context.js into shared-head.js to simplify things a bit.
Because of that I had to tweak many tests outside of the debugger.
Differential Revision: https://phabricator.services.mozilla.com/D139099
This new script pulls the browsers data from the MDN npm package and create, update
and delete records on the `devtools-compatibility-browsers` collection.
A new record is created when a browser in MDN data is not retired, and is not
already in the collection.
A record is updated when the browser + version already exist in the collection,
but its status or name changed in MDN data.
A record is removed when its status on MDN is changed to "retired", or when it's
not in the MDN data anymore.
For running the script, you need to be connected to the Mozilla Corporate VPN,
and fill-in the `authHeaderValue` variable with the one that can be retrieved
from the Remote Settings collection UI.
Ultimately, this script should be executed automatically (see https://remote-settings.readthedocs.io/en/latest/support.html#how-do-i-automate-the-publication-of-records-forever)
And in such case, we could even have a call to the API that would ask for review
on the modified records, so member of the teams can check if everything is okay
with the automatic update.
Differential Revision: https://phabricator.services.mozilla.com/D138532
We also remove the doc-loading event that isn't
consumed anywhere and seemd to be a relic of the
past when we had a timeline actor.
Differential Revision: https://phabricator.services.mozilla.com/D139132
Some profile were showing property access, so let's see if putting target[eventListeners]
in a variable is making things better.
Also, don't call logEvent when there's no need to. Even if the function has an
early exit when it won't do anything, there's still a cost to the function call.
In this patch, we're also shifting a few things around so we can bail out as
early as we can without doing anything we wouldn't need.
Differential Revision: https://phabricator.services.mozilla.com/D139112
It was only creating a Map and putting it in a property of the instance,
but the same Map can be created later, in `on`, when we really need it.
Differential Revision: https://phabricator.services.mozilla.com/D139016
I'm using a new dedicated bundle here so that we ensure that the bundle lines don't change and stay "breakable".
Otherwise the breakpoint wouldn't be hit on reload if the breakpoint become an empty line.
My goal here is to see what happens if the new bundle still hit the breakpoint even if the original source
was removed.
We might later revisit this behavior to remove this breakpoint.
It might be challenging to avoid hitting the breakpoint once on the first load.
It would require the server to know about sourcemap in order to ignore the breakpoint on early page load sequence.
Differential Revision: https://phabricator.services.mozilla.com/D138920
This helps stop doing a loose search and avoid bugs where
findSource("original.js") would match both original.js and replace-original.js.
I had to keep full URL support in order to match a source without any filename.
It might only be browser_markup_shadowdom_open_debugger.js and lots of sourcemap tests
using webpack:// URL and many source files with the same filename.
We could also have a distinct helper for these tests.
I tried to remove all cases where we were doing findSource(dbg, source.url)
and instead fo findSource(dbg, source).
Differential Revision: https://phabricator.services.mozilla.com/D138934
The formatReps function was iterating twice on all the parameters,
first with a map call, and then a reduce call, in which we were
recreating a new array for each parameter.
We turn this into a simple for loop so we'll iterate only once.
We also simplify the getObjectInspector function so it doesn't
create new objects when there's no need to.
Differential Revision: https://phabricator.services.mozilla.com/D138885
This test doesn't ensure we correctly hit the column breakpoints, but rather focus on
asserting that we display and update the column breakpoints options correctly.
That, especially when the source content change across reloads.
Differential Revision: https://phabricator.services.mozilla.com/D138832
When both the current and the earlier props for a given property name are inherited, the current prop should not be marked as overridden if the earlier prop was marked as !important.
!important should only come into play if the property where it was set is not inherited.
Regardless of this, properties are considered in descending order of specificity, so the earlier rule should take precedence.
Differential Revision: https://phabricator.services.mozilla.com/D138895
Also the test skipped checking iframe messages in the Browser Console, but it's
been a while since we fixed the issue mentionned there, so we can safely also
test the Browser Console.
Differential Revision: https://phabricator.services.mozilla.com/D138781
The property is renamed, prefixed with `mutable` to better highlight that it is
special; the associated selector is renamed as well.
The only change necessary was adding a `messageCount` prop to the `ConsoleOutput`
component so its lifecycle method could check if the number of messages changed.
Differential Revision: https://phabricator.services.mozilla.com/D138293
In order to store the matching elements of a CSS warnings, we were having a quite
generic `MESSAGE_UPDATE_PAYLOAD` action and `messagesPayloadById` property in the store.
This was used at some point to also store console.table data (which was retrieved
asynchronously), but is no longer true.
In this patch, we rename the action, property, selector, props and variable that
were using this to make it more specific to the CSS warning matching elements.
We also, directly pass message to messageGetMatchingElements as the component
calling the action already had access to it.
Tests that were using the action are updated so they're about CSS warnings (and
not console.table).
Differential Revision: https://phabricator.services.mozilla.com/D138412
This probably had many side effects in the browser toolbox when debugging content processes.
But the main one was about not properly unregistering breakpoints when removing/disabling it.
This is only specific to content process targets, so this is only impacting the browser toolbox.
Differential Revision: https://phabricator.services.mozilla.com/D138325
Opening and closing toolbox allocate lots of objects
and the GC pauses between each task takes some time.
In addition to that, there is some leaked memory, which slow things down.
So that the test takes too much time to run on DEBUG builds.
Differential Revision: https://phabricator.services.mozilla.com/D138298
We were trying to process style actor that did not relate to any stylesheet.
This ended up trying to create stylesheet resources with no stylesheet object,
and various exception because of that.
Differential Revision: https://phabricator.services.mozilla.com/D138328
This history middleware is bad as it forces leaking all action until firefox is closed.
This doesn't seem to be enough to reduce the runtime of browser_toolbox_hosts.js,
but this may help free more objects in test and reduce intermittent and timeouts.
I suspect that there is some other leaks happening in this toolbox host test.
Differential Revision: https://phabricator.services.mozilla.com/D138297
If the message isn't a warning or an info, it can't
be in a warningGroup, so we can exit the function
earlier and avoid useless checks.
Differential Revision: https://phabricator.services.mozilla.com/D138299
This repurposes browser_dbg-reload.js which tested breakpoints resync after reload when the source
content changes.
This renamed test (browser_dbg-breakpoints-reloading-with-source-changes.js) covers the expected behaviour after breakpoint shifting is removed.
The sceanarios covered are :-
- When new content is added and the breakpoint points to a different source code
- When the content changes and the breakpoint is on a non-breakable line
- When the content changes and the line for the breakpoint has been removed.
Currently we use IS_BREAKPOINT_SHIFTING_ENABLED to make the test pass with all the issues.
Also removing old example files that are no longer used.
Differential Revision: https://phabricator.services.mozilla.com/D136720
Opening and closing toolbox allocate lots of objects
and the GC pauses between each task takes some time.
In addition to that, there is some leaked memory, which slow things down.
So that the test takes too much time to run on DEBUG builds.
Differential Revision: https://phabricator.services.mozilla.com/D138298
We were trying to process style actor that did not relate to any stylesheet.
This ended up trying to create stylesheet resources with no stylesheet object,
and various exception because of that.
Differential Revision: https://phabricator.services.mozilla.com/D138328
This history middleware is bad as it forces leaking all action until firefox is closed.
This doesn't seem to be enough to reduce the runtime of browser_toolbox_hosts.js,
but this may help free more objects in test and reduce intermittent and timeouts.
I suspect that there is some other leaks happening in this toolbox host test.
Differential Revision: https://phabricator.services.mozilla.com/D138297
After fixing the initial failing test by both waiting for DevTools reload propertly and closing all debug tabs, the following test started failing.
Waiting for DevTools to properly update in this test seems to fix the intermittent(s?).
Differential Revision: https://phabricator.services.mozilla.com/D138010
We're checking if the last message is the result of an evaluation in `ConsoleOutput`
so we can scroll to the bottom.
But in order to do that, we're turning the messages map into an array, only to get
its last element, which was showing up in profiles.
We can retrieve the last added message id through `visibleMessages` as evaluation
and their results are never filtered.
Differential Revision: https://phabricator.services.mozilla.com/D137987
This `_setBreakpointPositions` method is called from `setBreakpointPositions`, which is already memoized.
`ADD_BREAKPOINT_POSITIONS` will store in sources.js reducer the final breakable columns per source instead of per source actor,
and `getBreakpointPositionsForSource` is there to retrieve this cached data.
No other code rely to per source actor breakable columns.
Differential Revision: https://phabricator.services.mozilla.com/D137285
The function was returning true as long as the passed element
was an iframe and EFT was enabled.
But if the passed iframe was blocked by a CSP rule, it would
still return true, although we wouldn't actually have a dedicated
document, nor a target, for that iframe, which would lead to
issues in the inspector when trying to fetch the iframe children.
We fix this by adding a new `isFrameBlockedByCSP` util, which uses
`nsIContentPolicy#shouldLoad` with the iframe url so we can check if the iframe
is blocked by CSP, and in such case, return false.
We're also using this new function in the `NodeActor#form` method to set a `numChildren`
of `0` when the iframe is blocked (so in the inspector, the expand icon will be
hidden for the element), as well as in `WalkerActor#_getChildren` to return an
empty array when called with an iframe blocked by CSP.
A new test is added to check the iframe nodeFront properties and usage of
`WalkerFront#children` with those. We allow to set a specific pref to bypass
the guard in the children method in order to properly check that the root issue
of a given bug was fixed.
Differential Revision: https://phabricator.services.mozilla.com/D137667
This can be seen as a hot fix for Bug 1752342. Here we're not fixing the
root cause of the issue, but rather adding a protection mecanism so we don't
completely crash/freeze the inspector/the browser.
A follow-up bug will take care of Bug 1752342.
Differential Revision: https://phabricator.services.mozilla.com/D137450
Check if ownerRule.layerName is null, rather than checking
the property exists.
A test case is added in browser_rules_layer.js.
Differential Revision: https://phabricator.services.mozilla.com/D137447
In order to make it more clear what the browser icons mean in the compatibility
panel, we move the title attribute that was set on individual browser icon to
the browser icon list instead, in which we put the full list of unsupported
browser (with their name and version), prefixed with a "Compatibility issues in:"
label.
Differential Revision: https://phabricator.services.mozilla.com/D137004
About:debugging seems to be the only consumer of the tabListChanged event at this point.
One of the internal events used by about:debugging was not properly handled. Added a minor fix to change that and added a new mochitest for about:debugging.
Differential Revision: https://phabricator.services.mozilla.com/D137293
This link has not been working for a while, switching to an MDN example page.
We should still come up with example pages hosted on a domain owned by devtools team if possible
(and not on the personal github account of a team member :) )
Depends on D137141
Differential Revision: https://phabricator.services.mozilla.com/D137282
Guard `Toolbox#updateFrameButton` with `isDestroying` so the call to `this.target`
later in `_commandIsVisible` doesn't throw because `this.commands` is null.
Differential Revision: https://phabricator.services.mozilla.com/D136713
This patch introduce a new test helper to more easily test a page that reloads with an updated content.
This especially take care of source map support.
Differential Revision: https://phabricator.services.mozilla.com/D137162
As we are already filtering the JS Globals via _shouldAddNewGlobalAsDebuggee,
there is no need to filter out the JS Sources.
We do want all the sources for all the WebExtension globals.
Differential Revision: https://phabricator.services.mozilla.com/D136507
This ensures @media and @layer information can be searched for and properly highlighted
in the rule view.
A test is added to check various cases.
Differential Revision: https://phabricator.services.mozilla.com/D137107
We are fixing mochitests that fail when network.cookie.cookieBehavior = 5, i.e. when we enable Total Cookie Protection.
This is most often due to the test assuming that an origin will always have access to its storage state when embedded as
a third party.
My approach: Add third-party storage permission for the net domain when included on the com domain.
This allows the cache for the net domain to be shared in the way that this test is expecting.
Differential Revision: https://phabricator.services.mozilla.com/D136601
We don't need to have specific check for dom0 event listeners as the debugger
button should be show as long as we managed to create a source actor.
We can remove usage of `script.source.element` alltogether as we don't need
it for not showing the line number in the location (the line is 0 in such case,
and we already discriminate for such value).
A test case is added to ensure that the debugger can be opened from the
event tooltip on a dom0 event.
Differential Revision: https://phabricator.services.mozilla.com/D136461
This is only an issue when devtools.popups.debug is false,
when it is true, the toolbox is move and a warning message is printed
if we request to open a new toolbox.
Differential Revision: https://phabricator.services.mozilla.com/D136498
We were missing cached image request and probably CSP blocked request
from the parent process because of this.
We are spawning a NetworkEventContentWatcher for the parent process target.
That's semi-intentional. This might better be done via a parent process resource type,
like NETWORK_EVENT. But the current Resource framework doesn't allow to do that easily.
So that we currently spawn the NetworkEventContentWatcher (and NetworkEventStackTraceWatcher)
against the parent process target actor as a "FRAME" resource type.
This is handy as we need at least one of these two watchers for the parent process.
Differential Revision: https://phabricator.services.mozilla.com/D136325
It was only used in storeExpressions, where we can replace it by storing only the input property
instead of removing the value property from the object we store.
Differential Revision: https://phabricator.services.mozilla.com/D136164