Граф коммитов

20386 Коммитов

Автор SHA1 Сообщение Дата
Nicolas Chevobbe 340ae169e9 Bug 1776262 - [devtools] Fix stuck to bottom console output. r=jdescottes.
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
2022-06-24 14:38:53 +00:00
Florian Quèze 9f58ad4f5c Bug 1746197 - replace the PaintWorker thread with the Timer thread in about:profiling, r=julienw,fluent-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D150045
2022-06-23 21:13:21 +00:00
Joel Maher 5bf232d7af Bug 1776212 - cleanup e10s in manifest conditions for bc/dt. r=aryx,necko-reviewers,extension-reviewers,preferences-reviewers,dragana,zombie
Differential Revision: https://phabricator.services.mozilla.com/D150127
2022-06-23 17:49:07 +00:00
Nicolas Chevobbe 519e1966cf Bug 1776144 - [devtools] Remove unused TARGET_AVAILABLE action in WebConsole. r=ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D150084
2022-06-23 08:29:44 +00:00
Michael Ratcliffe 8976ddfab0 Bug 1774687 - Stop debouncing with DeferredTask in DevTools r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D149575
2022-06-22 21:15:12 +00:00
Alexandre Poirot 055b54a0ca Bug 1774583 - [devtools] Prevent clearing tab list when a target is destroyed. r=bomsy
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
2022-06-22 20:12:43 +00:00
Alexandre Poirot 09d0d54069 Bug 1767702 - [devtools] Split browser_dbg-features-source-tree.js and re-enable it. r=bomsy
Let move Browser Toolbox checks in a distinct file as it can get flaky.

Differential Revision: https://phabricator.services.mozilla.com/D149417
2022-06-22 16:54:29 +00:00
Nicolas Chevobbe 3c8d1a8b26 Bug 1775411 - [devtools] Fix append new stylesheet link. r=ochameau.
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
2022-06-22 09:30:05 +00:00
Julian Descottes 2c8736a218 Bug 1767787 - [devtools] Wait until default editor has focus in browser_styleeditor_bug_851132_middle_click.js r=nchevobbe
I could reproduce the intermittent locally and when it occurs, the initial editor actually didn't have focus.
I think that what happens is that we hit a race condition where the focus is stolen by the initial editor after we clicked on a new stylesheet
and switched to a new editor.

Differential Revision: https://phabricator.services.mozilla.com/D149952
2022-06-22 07:20:06 +00:00
Alexandre Poirot 5de1d5d3d8 Bug 1774601 - [devtools] Remove plain url computation. r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D149533
2022-06-22 07:08:12 +00:00
Alexandre Poirot 46e415c5f2 Bug 1774601 - [devtools] Stop hiding query parameters in Tab components. r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D149532
2022-06-22 07:08:12 +00:00
Alexandre Poirot 278649831b Bug 1774601 - [devtools] Stop hiding query parameters in the SourceTree. r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D149531
2022-06-22 07:08:11 +00:00
manekenpix d5efa9c119 Bug 1771095 - Remove size property from SearchBar component r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D149348
2022-06-22 07:04:09 +00:00
Nick Alexander 4c6dedd925 Bug 1768494 - Preserve devtools profile outside of ephemeral background profile. r=devtools-reviewers,nchevobbe
For `--backgroundtask ... --jsdebugger` invocations, the devtools
profile is kept inside the ephemeral background profile.  This means
that breakpoints, etc are not preserved across repeated debugging
invocations.  This change eases the debugging process.

Differential Revision: https://phabricator.services.mozilla.com/D145893
2022-06-22 04:05:26 +00:00
Emilio Cobos Álvarez 7829e5aab5 Bug 1774378 - Make select code harder to mess up. r=Gijs
Right now we rely on the menulist to be injected by hand in all the
relevant windows. Instead create it lazily, making the select code more
standalone.

The DevTools window was missing it, for example.

Differential Revision: https://phabricator.services.mozilla.com/D149620
2022-06-21 21:42:58 +00:00
Mark Banner c6c1957341 Bug 1771173 - Remove unused imports. r=geckoview-reviewers,arai,owlish
Differential Revision: https://phabricator.services.mozilla.com/D149786
2022-06-21 20:42:16 +00:00
Hubert Boma Manilla 58c7b8d171 Bug 1583179 - [devtools] Remove the reload and analyze performance buttons in the browser toolbox r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D149610
2022-06-21 15:15:49 +00:00
Nicolas Chevobbe 1c4b4d8d2c Bug 1764346 - [devtools] Add Network Monitor Browser Toolbox test. r=bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D149513
2022-06-21 11:45:52 +00:00
Nicolas Chevobbe 6d089546e6 Bug 1774809 - [devtools] Fix intermittent in browser_zoom.js , r=jdescottes.
Wait for the devices to be loaded to prevent issue when closing RDM

Differential Revision: https://phabricator.services.mozilla.com/D149724
2022-06-21 05:11:17 +00:00
Nicolas Chevobbe ff453f26f7 Bug 1775078 - [devtools] Don't await in for loop in NodePicker.#stop. r=ochameau.
Instead, populate an array of Promise we can await on outside
of the loop.

Differential Revision: https://phabricator.services.mozilla.com/D149751
2022-06-20 14:55:21 +00:00
Nicolas Chevobbe c607e6cac4 Bug 1744240 - [devtools] Set navigation message source to CONSOLE_FRONTEND. r=ochameau.
This fixes an intermittent on browser_webconsole_warn_about_replaced_api.js where
an assertion was failing because the navigation message had the `console-api` class.
We take this as an opportunity to add a navigation marker specific component instead
of reusing the ConsoleApiCall one.

Differential Revision: https://phabricator.services.mozilla.com/D149739
2022-06-20 14:03:18 +00:00
Hubert Boma Manilla f81d41b82a Bug 1771249 - [devtools] Fix priviledged requests showing as content messages r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D147684
2022-06-20 13:48:26 +00:00
Nicolas Chevobbe dc5c403567 Bug 1774735 - [devtools] Fix intermittent in browser_telemetry_button_responsive.js. r=jdescottes.
When opening RDM, wait until the device list is loaded to
prevent Promise rejection when closing.

Differential Revision: https://phabricator.services.mozilla.com/D149726
2022-06-20 11:39:13 +00:00
Iulian Moraru 64c0820aef Backed out changeset 91b52e450816 (bug 1774913) for causing dt failures on browser_rules_search-filter_context-menu.js. CLOSED TREE 2022-06-20 14:39:03 +03:00
Alexandre Poirot 506ba8eeb7 Bug 1770363 - [devtools] Fix iframe dropdown on target destruction from the MBT r=nchevobbe
This only fail on MBT because it still uses non-EFT
and the top level document is displayed in the iframe dropdown
via the old "listFrames/frameUpdate" codepath.
So that its frameData's id isn't related to a target actor
but rather to a frame of the parent-process/window-global target actor...

I'm adding test coverage for the regular web toolbox,
but the fix only reproduce in the context of the browser toolbox.

Depends on D149257

Differential Revision: https://phabricator.services.mozilla.com/D148793
2022-06-20 10:12:32 +00:00
Alexandre Poirot 8b8875909a Bug 1770363 - [devtools] Cover browser toolbox scope feature with a test around the iframe dropdown. r=nchevobbe
This add some minimal test coverage for the UI bits.

But more detailed test should rather be done around the TargetCommand API (browser_target_command_scope_flag.js).

Depends on D149256

Differential Revision: https://phabricator.services.mozilla.com/D149257
2022-06-20 10:12:32 +00:00
Alexandre Poirot 919272ebda Bug 1770363 - [devtools] Allow to pass any JSON value to ToolboxTask.spawn. r=nchevobbe
When passing an array, only booleans and number were accepted.
Also arrays were stringified to list of value coma separated,
as if arrays were refering to list of arguments.
That while passing a primitive value would be passed as a unique argument.

Clarify this by explicitely accepting arrays refering as list of argument,
or a primitive value being a unique argument.

I'm also fixing an issue with exceptions not being correctly reported.

Depends on D148527

Differential Revision: https://phabricator.services.mozilla.com/D149256
2022-06-20 10:12:31 +00:00
Alexandre Poirot d9d5317e43 Bug 1770363 - [devtools] Introduce on-demand multiprocess browser toolbox. r=nchevobbe
This introduces a checkbox in the iframe dropdown to enable/disable multiprocess debugging live.
Switching between:
 - debugging only the main process (all documents, workers and priviledged JS)
 - debugging all the processes (same, for each process, we will debug documents, workers, JS, ...)

This helps significantly speed up the browser toolbox when debugging only parent process resources,
while still allowing to switch to debug everything when required.

Depends on D146891

Differential Revision: https://phabricator.services.mozilla.com/D148527
2022-06-20 10:12:31 +00:00
Zoltán Szatmáry 99952418e8 Bug 1766821 - Only copy the value of a field. r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D145832
2022-06-20 06:58:31 +00:00
Julian Descottes 04713f06d1 Bug 1774913 - [devtools] Enable devtools tests depending on emptyClipboard r=nchevobbe
After Bug 666254 was fixed, we should be able to run those checks on all platforms

Differential Revision: https://phabricator.services.mozilla.com/D149689
2022-06-20 06:03:37 +00:00
Nicolas Chevobbe c1cdea85c9 Bug 1773879 - [devtools] Fix Copy all Message context menu action in Browser Console. r=jdescottes.
We don't have a toolbox in the Browser Console, so we don't
need to have a Provider for its store.
A simple test is added, just checking that the action was
triggered.

Differential Revision: https://phabricator.services.mozilla.com/D149593
2022-06-20 05:21:36 +00:00
Julian Descottes 651d651049 Bug 1590031 - [devtools] Compute CSS changes based on actual values applied by the engine r=nchevobbe
Delay computing the CSS changes until the declarations have been updated to reflect the values understood by the engine.
This avoids trusting authored values for CSS changes, and fixes all scenarios where users typed an opening character (single quote, double quote etc...) or an escape
character.

Differential Revision: https://phabricator.services.mozilla.com/D149603
2022-06-17 17:21:22 +00:00
Michael Ratcliffe a139eedb97 Bug 1713316 - IndexedDB DevTools does not load more than 50 items r=devtools-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D148338
2022-06-17 16:04:07 +00:00
Nicolas Chevobbe ba7decb9ac Bug 1774622 - [devtools] Return Map from getDevices. r=jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D149595
2022-06-17 09:56:47 +00:00
Nicolas Chevobbe d0ec19672d Bug 1770899 - [devtools] Use RemoteSettings devtools-devices collection. r=jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D149405
2022-06-17 06:44:18 +00:00
Mark Banner 8ca4d49d65 Bug 1766228 - Add an ESLint rule to ensure that member property accesses of Services are valid. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D149393
2022-06-16 21:11:24 +00:00
Michael Ratcliffe 7860244360 Bug 1772718 - Reduce mozilla/reject-scriptableunicodeconverter eslint warnings in DevTools code r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D148346
2022-06-16 18:24:17 +00:00
criss a3c52529a8 Backed out 5 changesets (bug 1770363) for causing mochitest failures on browser_ext_addon_debugging_netmonitor.js
Backed out changeset d29f5041fd98 (bug 1770363)
Backed out changeset a91879be9b4a (bug 1770363)
Backed out changeset 27e78762006f (bug 1770363)
Backed out changeset 18a6433fd24a (bug 1770363)
Backed out changeset 5cdcd2318a9f (bug 1770363)
2022-06-16 21:57:46 +03:00
Alexandre Poirot f66447e8f4 Bug 1770363 - [devtools] Fix iframe dropdown on target destruction from the MBT r=nchevobbe
This only fail on MBT because it still uses non-EFT
and the top level document is displayed in the iframe dropdown
via the old "listFrames/frameUpdate" codepath.
So that its frameData's id isn't related to a target actor
but rather to a frame of the parent-process/window-global target actor...

I'm adding test coverage for the regular web toolbox,
but the fix only reproduce in the context of the browser toolbox.

Differential Revision: https://phabricator.services.mozilla.com/D148793
2022-06-16 17:19:07 +00:00
Alexandre Poirot b1e9c1549c Bug 1770363 - [devtools] Cover browser toolbox scope feature with a test around the iframe dropdown. r=nchevobbe
This add some minimal test coverage for the UI bits.

But more detailed test should rather be done around the TargetCommand API (browser_target_command_scope_flag.js).

Differential Revision: https://phabricator.services.mozilla.com/D149257
2022-06-16 17:19:06 +00:00
Alexandre Poirot ccce618e97 Bug 1770363 - [devtools] Allow to pass any JSON value to ToolboxTask.spawn. r=nchevobbe
When passing an array, only booleans and number were accepted.
Also arrays were stringified to list of value coma separated,
as if arrays were refering to list of arguments.
That while passing a primitive value would be passed as a unique argument.

Clarify this by explicitely accepting arrays refering as list of argument,
or a primitive value being a unique argument.

I'm also fixing an issue with exceptions not being correctly reported.

Differential Revision: https://phabricator.services.mozilla.com/D149256
2022-06-16 17:19:06 +00:00
Alexandre Poirot bc48a30433 Bug 1770363 - [devtools] Introduce on-demand multiprocess browser toolbox. r=nchevobbe
This introduces a checkbox in the iframe dropdown to enable/disable multiprocess debugging live.
Switching between:
 - debugging only the main process (all documents, workers and priviledged JS)
 - debugging all the processes (same, for each process, we will debug documents, workers, JS, ...)

This helps significantly speed up the browser toolbox when debugging only parent process resources,
while still allowing to switch to debug everything when required.

Differential Revision: https://phabricator.services.mozilla.com/D148527
2022-06-16 17:19:06 +00:00
Alexandre Poirot b74044da3c Bug 1773258 - [devtools] Avoid modifying sourcesWithUrls when sources without a URL is removed. r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D149235
2022-06-16 16:34:39 +00:00
Alexandre Poirot 428d2014ae Bug 1773258 - [devtools] Merge getDisplayedSources selectors into a unique one and ensure it is memoized. r=bomsy
At the end getDisplayedSources wasn't correctly memoized and generates new array instances
even if the content of the source tree doesn't change.
That's because internaly, it crafts an array which is always a new array instance.

Let's merge the two intermediate selectors into a single one so that we can more easily memoize it.

This should also help try to followup and attempt at generating the data structure needed for ManagedTree.
That, instead of generated the data for addToTree/updateTree which then feeds ManagedTree.

Differential Revision: https://phabricator.services.mozilla.com/D148526
2022-06-16 16:34:39 +00:00
Norisz Fay 7cd43cc697 Backed out 5 changesets (bug 1766228) for causing lint failures on test_restrequest.js CLOSED TREE
Backed out changeset 5ff1634cfe18 (bug 1766228)
Backed out changeset 01642c97e7a5 (bug 1766228)
Backed out changeset cbba28151712 (bug 1766228)
Backed out changeset 76a32127865d (bug 1766228)
Backed out changeset 2c7ef1ad380a (bug 1766228)
2022-06-16 16:36:44 +03:00
Mark Banner 1383258437 Bug 1766228 - Add an ESLint rule to ensure that member property accesses of Services are valid. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D149393
2022-06-16 12:09:28 +00:00
Tetsuharu Ohzeki 07b3d58207 Bug 1508688 - Add `UNSAFE_` prefix to React deprecated lifecycle methods in devtools/client/webconsole/. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D149484
2022-06-16 10:03:11 +00:00
Tetsuharu Ohzeki 9348f8ae5e Bug 1508688 - Add `UNSAFE_` prefix to React deprecated lifecycle methods in devtools/client/shared/. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D149483
2022-06-16 10:03:11 +00:00
Tetsuharu Ohzeki bb8e1695cc Bug 1508688 - Add `UNSAFE_` prefix to React deprecated lifecycle methods in devtools/client/responsive/. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D149482
2022-06-16 10:03:11 +00:00
Tetsuharu Ohzeki 6c38c84016 Bug 1508688 - Add `UNSAFE_` prefix to React deprecated lifecycle methods in devtools/client/netmonitor/. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D149481
2022-06-16 10:03:10 +00:00
Tetsuharu Ohzeki f6fa9f6c18 Bug 1508688 - Add `UNSAFE_` prefix to React deprecated lifecycle methods in devtools/client/inspector/. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D149480
2022-06-16 10:03:10 +00:00
Tetsuharu Ohzeki 4af14e7f3f Bug 1508688 - Add `UNSAFE_` prefix to React deprecated lifecycle methods in devtools/client/framework/. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D149479
2022-06-16 10:03:09 +00:00
Tetsuharu Ohzeki 0a05c81cf4 Bug 1508688 - Add `UNSAFE_` prefix to React deprecated lifecycle methods in devtools/client/debugger/. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D149478
2022-06-16 10:03:09 +00:00
Tetsuharu Ohzeki 49983d16b8 Bug 1508688 - Add `UNSAFE_` prefix to React deprecated lifecycle methods in devtools/client/accessibility/. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D149477
2022-06-16 10:03:09 +00:00
Tetsuharu Ohzeki 3bad49f709 Bug 1508688 - Add `UNSAFE_` prefix to React deprecated lifecycle methods in devtools/client/aboutdebugging/. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D149476
2022-06-16 10:03:08 +00:00
Alexandre Poirot e366854094 Bug 1767708 - [devtools] Fix intermittent with browser_dbg-content-script-sources.js. r=bomsy
The source tree seems to be updated asynchronously after the source selection.

Also, the SourcesTree component wasn't correctly selecting and expanding the tree
when the selected source was immediately selected as it gets created in the source tree.

Differential Revision: https://phabricator.services.mozilla.com/D148838
2022-06-15 17:10:16 +00:00
Alexandre Poirot 716e6a68c2 Bug 1761975 - [devtools] Hide ExtensionContent.jsm when debugging page with WebExt content scripts. r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D148837
2022-06-15 17:10:16 +00:00
Nicolas Chevobbe 5309cb5c0d Bug 1773994 - [devtools] Remove unnecessary code for network messages in MESSAGE_OPEN. r=ochameau.
With the changes from Bug 1686440, there's no benefit keeping this code around.

Differential Revision: https://phabricator.services.mozilla.com/D149139
2022-06-15 12:57:08 +00:00
Nicolas Chevobbe 63765889d4 Bug 1773993 - [devtools] Remove unused removeIds variable in addMessage. r=ochameau.
Nothing was added to the array, so we can remove it.

Differential Revision: https://phabricator.services.mozilla.com/D149138
2022-06-15 12:57:08 +00:00
Nicolas Chevobbe 0e20c6b7c9 Bug 1764501 - [devtools] Speedup adding messages out of order. r=ochameau.
In the console we might receive messages that need to be inserted at a specific
position in the output to respect the chronological order.
This is very visible when evaluating an expression in the console while we are
fetching cached messages, or when the expression is logging lots of messages, since
the evaluation result doesn't go through the ResourceCommand itself.
Since we were relying on the order of insertion in `mutableMessagesById` for the
order of messages in the output, we had no choice but clone the Map to insert
the new message at the specific position.
With lots of messages, this can be utterly slow, and is something people are experiencing.

To fix this, we're adding a new state property, `mutableMessagesOrder`, which holds
message ids in the chronological order. It's then used to compute `visibleMessages`.
As we don't have to clone the Map anymore, it makes reordering as fast as looking
for an index in the array and splicing it (which is fast).

We also take this opportunity to switch away from our `findIndex` usage; most often
than not, the messages will be reinserted at the end of the array, so we can loop
through it backward to find the index faster.

We still keep `mutableMessagesById` as a Map so lookup are fast, and we don't have
to deal with impacts we'd have if we'd switch to an object.

The existing node test helper to get a message at a specific index are migrated
to make use of `mutableMessagesOrder`, and a few test cases and assertions are
added to check that the new property is handled correctly.

Differential Revision: https://phabricator.services.mozilla.com/D148658
2022-06-15 12:57:07 +00:00
criss 85072ad6a8 Backed out 2 changesets (bug 1761975, bug 1767708) for causing Xpcshell failures on test_blackboxing-02.js. CLOSED TREE
Backed out changeset d2fc50df9355 (bug 1767708)
Backed out changeset bdb40c0a7307 (bug 1761975)
2022-06-15 15:50:17 +03:00
Alexandre Poirot 638166ba96 Bug 1767708 - [devtools] Fix intermittent with browser_dbg-content-script-sources.js. r=bomsy
The source tree seems to be updated asynchronously after the source selection.

Also, the SourcesTree component wasn't correctly selecting and expanding the tree
when the selected source was immediately selected as it gets created in the source tree.

Differential Revision: https://phabricator.services.mozilla.com/D148838
2022-06-15 10:10:14 +00:00
Alexandre Poirot 54c38d1475 Bug 1761975 - [devtools] Hide ExtensionContent.jsm when debugging page with WebExt content scripts. r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D148837
2022-06-15 10:10:13 +00:00
Alexandre Poirot 70ceb24d7e Bug 1676208 - [devtools] Force keepAlive on browser toolbox test server. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D149354
2022-06-15 09:20:06 +00:00
Tooru Fujisawa c1313ef8d6 Bug 1773882 - Part 2: Add more testcase. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D149213
2022-06-15 05:36:10 +00:00
Tooru Fujisawa 71da016478 Bug 1773882 - Show getter/setter in array element. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D149042
2022-06-15 05:36:10 +00:00
Tooru Fujisawa 371b3c1d97 Bug 1607331 - Part 3: Reject global this usage in JSM. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D148551
2022-06-14 21:56:55 +00:00
Luca Greco facdcdeaab Bug 1772905 - Update DevTools DOM panel tests that fails if InstallTrigger is not listed anymore as a window global. r=nchevobbe
These two DevTools DOM panel tests are expecting the elements being inspected to be at a certain row index
which depends (likely due to alphabetic order) that InstallTrigger is listed as a global in the window
being inspected (it doesn't matter what the value is, the failure is triggered because when InstallTrigger
is completely hidden the elements expected by the tests are shift by one row position).

And so these two tests would be currently permafailing when "extensions.InstallTrigger.enabled" is set to `false`
(but they are completely uneffected when "extensions.InstallTriggerImpl.enabled" is set to `false`, because the
InstallTrigger global is still defined, just set to null instead of providing the API defined by the
InstallTriggerImpl interface).

This patch changes name of the global properties to which they are set to "A" and "B", to make sure those properties
 are going to be in rows listed in the DOM panel before the two non-standard globals `InstallTrigger` and `SpecialPowers`
 and so that the visibility of the InstallTrigger global (either disabled or still visible) doesn't affect the test case.

Differential Revision: https://phabricator.services.mozilla.com/D148975
2022-06-14 19:29:06 +00:00
Hubert Boma Manilla 8708b3ac9e Bug 1772363 - [devtools] Ensure actually watching resources before pause/resume UI is updated r=ochameau
Changing the pattern for toggling recording to ensure that pause/resumes actually
start or stops watching resources before the ui states gets updated.

Differential Revision: https://phabricator.services.mozilla.com/D148953
2022-06-14 15:38:07 +00:00
Nicolas Chevobbe e779b145d6 Bug 1774205 - [devtools] Remove unnecessary numFixProps property. r=jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D149255
2022-06-14 15:00:36 +00:00
Hubert Boma Manilla 363afe7760 Bug 1767702 - disable browser_dbg-features-source-tree.js on win10_2004 temporarily r=intermittent-reviewers,MasterWayZ
Differential Revision: https://phabricator.services.mozilla.com/D149248
2022-06-14 13:10:13 +00:00
Julian Descottes c322679a51 Bug 1753048 - [devtools] Include the fallback window to the docShells array for webextension targets r=ochameau
Depends on D148489

This allows to properly set the cssErrorReportingEnabled flag on its docShell.
While we are not interested in css errors for this fallback window, the windowglobal target actor
will automatically set the flag on new root browsing contexts only if the previous one had the flag
set. This way when we switch to a valid webextension document (eg a popup), the flag will be set
and CSS errors will be reported.

Differential Revision: https://phabricator.services.mozilla.com/D148836
2022-06-14 06:52:49 +00:00
Julian Descottes 7dfa0bab07 Bug 1753048 - [devtools] Append the addonId to the DevTools fallback window URL r=ochameau
This window does not share the regular extension principal so we cannot fetch
the addonId from the principal in the same way as we do for other documents.

Instead we append the addonId to the URL and provide a new helper in browser-context-helpers
to extract the addonId from a browsingContext.
This helper should work transparently from the parent process and the content process, and
should support browsing context for regular extension documents as well as browsing contexts
for fallback windows.

Differential Revision: https://phabricator.services.mozilla.com/D148489
2022-06-14 06:52:49 +00:00
Nicolas Chevobbe bddac8be66 Bug 1773627 - [devtools] Fix mapAwaitExpression on expression with for..of/in loops. r=bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D148920
2022-06-13 10:13:16 +00:00
Nicolas Chevobbe fe472aae2e Bug 1771428 - [devtools] Remove last statement AwaitExpression in mapTopLevelAwait. r=bomsy.
We use to transform expression like `await obj` into
```
(async () => {
  return await obj;
})()
``

So we were basically returning the expression, wrapped in an async iife, adding
a `return` statement before the last statement.
But in the case the last statement is an `AwaitExpression`, we can simply return
the argument, stripping the `await` keyword.
This fixes an issue when awaiting for an object with a `then` getter would execute
the getter twice.
A test case is added in mochitest, and unit test are updated to reflect the new
output.

Differential Revision: https://phabricator.services.mozilla.com/D148806
2022-06-10 15:55:07 +00:00
Michael Ratcliffe 622e16558f Bug 1603831 - Fix cookie sorting by date in storage panel r=devtools-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D58074
2022-06-09 21:41:50 +00:00
Hubert Boma Manilla c89f87a6d2 Bug 1685949 - [devtools] Fix perma fail on browser_console_context_menu_entries.js r=nchevobbe
Since Network monitoring is switched of by default in the browser console, we need to
switch it on  explicitly for the browser_console_context_menu_entries.js test.

Differential Revision: https://phabricator.services.mozilla.com/D148776
2022-06-09 13:54:14 +00:00
Hubert Boma Manilla 2b8049bcf5 Bug 1772363 - [devtools] Fix intermittent on browser_net_pause.js r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D148674
2022-06-09 09:34:31 +00:00
Julian Descottes 9fe4287523 Bug 1604562 - [devtools] Add mochitest for CORS request issue from DevTools style update r=emilio,nchevobbe
Depends on D148396

Differential Revision: https://phabricator.services.mozilla.com/D148657
2022-06-08 21:36:09 +00:00
Alexandre Poirot 70d1047c51 Bug 1771939 - [devtools] Compute SourceTree data "parts" from sources selectors instead of updateTree layer. r=bomsy
This helps compute it only once per source and help simplify the updateTree layer.
We no longer have to path thread/mainThreadHost everywhere.

Differential Revision: https://phabricator.services.mozilla.com/D147780
2022-06-08 15:27:33 +00:00
Alexandre Poirot 52aed0bdf8 Bug 1771939 - [devtools] Move `formatTree` from production to test helpers. r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D147779
2022-06-08 15:27:33 +00:00
Alexandre Poirot ff7508e4e5 Bug 1771939 - [devtools] Only pass source instead of source *and* source.displayURL. r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D147778
2022-06-08 15:27:33 +00:00
Alexandre Poirot a8f3a916ec Bug 1771939 - [devtools] Ignore sources early in the selector instead of from updateTree API. r=bomsy
We were using `isInvalidUrl` late in the process of updateTree layer to ignore sources
and prevent displaying them in the SourceTree.
But getDisplayedSources is dedicated to the SourceTree and can eagerly filter out the right sources
right away.
Also getDisplayedSourceIDs is already accepting only source with a URL,
so we don't have to recheck if the source is having a URL.

I extended mochitest test coverage to replace the removed jest tests.

Differential Revision: https://phabricator.services.mozilla.com/D147777
2022-06-08 15:27:32 +00:00
Alexandre Poirot d3c1a381fc Bug 1771939 - [devtools] Compute the displayURL from the selector once. r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D147764
2022-06-08 15:27:32 +00:00
Alexandre Poirot 14ffc9fff6 Bug 1771939 - [devtools] Remove unused defaultDomain argument from getURL. r=bomsy
This argument is only used in getDisplayURL.

Differential Revision: https://phabricator.services.mozilla.com/D147763
2022-06-08 15:27:31 +00:00
Alexandre Poirot 4cd02f933c Bug 1771939 - [devtools] Migrate from debuggeeUrl/debuggeeHost to mainThreadHost. r=bomsy
At the end, we weren't using the url but only the host.
And "debuggee" is pretty vague, let's clarify with "main thread".

Differential Revision: https://phabricator.services.mozilla.com/D147762
2022-06-08 15:27:31 +00:00
Alexandre Poirot 39957a91c9 Bug 1771939 - [devtools] Remove unused debuggee classname and debuggeeUrl prop from SourceTreeItem. r=bomsy
The classname looks useless and so is the debugeeUrl prop.

Differential Revision: https://phabricator.services.mozilla.com/D147761
2022-06-08 15:27:31 +00:00
Alexandre Poirot 7e32d7ca8c Bug 1771939 - [devtools] Remove unused sortTree module from debugger. r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D147760
2022-06-08 15:27:30 +00:00
Alexandre Poirot 10a5e28c1f Bug 1771939 - [devtools] Remove shown source and show source in tree when source is selected. r=bomsy
Before, only "shown source" would really expand the tree to show the source in tree,
whereas "highlight" would only highlight the folder that is opened
(in case the source isn't visible and folder isn't expanded).

But when we select a new shown source, we also update the selected location,
which also changes the highlight items.

It is significantly clearer to only have "selected source" and have the SourceTree
to automatically expand the tree and show the selected source.

(Also a sneaky call to .reverse() was mutating the `highlightedItems` props...)

Differential Revision: https://phabricator.services.mozilla.com/D147759
2022-06-08 15:27:30 +00:00
Alexandre Poirot a49f0276c4 Bug 1773037 - [devtools] Disable safe mode and session restore in the browser toolbox. r=nchevobbe
The safe mode dialog will be displayed instead of the browser toolbox when the previous browser
toolbox has been closed too brutaly. This happens every now and then.

Also, when you opened a URL from the browser toolbox, this will then trigger a transient
browser window that appears and immediately disappear when opening the browser toolbox
all next time you start it. It might be related to session restore, but it looks like it is not enough
to get rid of this blinking window.

Differential Revision: https://phabricator.services.mozilla.com/D148515
2022-06-08 08:25:27 +00:00
Julian Descottes edc9af2bff Bug 1773203 - [devtools] Improve failure message and documentation for devtools-bundle job r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D148607
2022-06-08 07:47:25 +00:00
colin_czb c3a1dc4ad3 Bug 1765631 - [devtools] Copy Request Headers hardcodes HTTP version r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D147580
2022-06-08 06:34:54 +00:00
Emilio Cobos Álvarez 255763ef57 Bug 1773070 - Unify Gecko and Servo EventState/ElementState bits. r=smaug
Add a dom/base/rust crate called just "dom" where we can share these.

Most of the changes are automatic:

  s/mozilla::EventStates/mozilla::dom::ElementState/
  s/EventStates/ElementState/
  s/NS_EVENT_STATE_/ElementState::/
  s/NS_DOCUMENT_STATE_/DocumentState::/

And so on. This requires a new cbindgen version to avoid ugly casts for
large shifts.

Differential Revision: https://phabricator.services.mozilla.com/D148537
2022-06-07 23:09:52 +00:00
Hubert Boma Manilla 27106e41bc Bug 1771277 - [devtools] Remove the websocket and server sent events prefs r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D147413
2022-06-07 12:18:49 +00:00
Hubert Boma Manilla 8acd16def6 Bug 1764348 - Pause / Resume should toggle listening to network resources r=ochameau
With this patch Pause and Resume, now stop and start listening to network requests.

Differential Revision: https://phabricator.services.mozilla.com/D148488
2022-06-07 12:18:49 +00:00
Julian Descottes d2b00c2027 Bug 1767764 - [devtools] Add logs to browser_layoutHelpers_getBoxQuads2.js r=Honza
Just adding some logs for now to help with the investigation

Differential Revision: https://phabricator.services.mozilla.com/D148401
2022-06-07 07:53:13 +00:00
Hubert Boma Manilla 1ef847a862 Bug 1771659 - [devtools] Fix perma failure in BETA r=ochameau
The multiprocess browser toolbox is on by default in BETA, so we
need to switch it on explicitly for the addon extensions to be listed.

Differential Revision: https://phabricator.services.mozilla.com/D148392
2022-06-07 07:39:42 +00:00
Andrew McCreight be6bd6a9b2 Bug 1772851 - Fix devtools tests to not rely on ambient XUL. r=devtools-reviewers,nchevobbe
Instead, explicitly add permissions for the domain that needs it.

Also browser_bug331772_xul_tooltiptext_in_html.js.

Differential Revision: https://phabricator.services.mozilla.com/D148406
2022-06-06 16:33:35 +00:00
Hubert Boma Manilla 96c5408eef Bug 1764348 - Enable browser console / browser toolbox console users turn on network monitoring manually r=nchevobbe
Highlights
- Network monitoring is turned off by default in browser console/ browser toolbox console on initial load.
- A new "Enable Network Monitoring" setting is added to enable users toggle on an off as they desire.
- The user setting is persisted across toolbox reopens.

Differential Revision: https://phabricator.services.mozilla.com/D145234
2022-06-06 13:56:05 +00:00
Hubert Boma Manilla 463affeaf5 Bug 1764348 - Cleanup hidePersistLogsCheckbox and hideShowContentMessagesCheckbox property r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D145550
2022-06-06 13:56:05 +00:00
Tooru Fujisawa 198cb49870 Bug 1772093 - Part 10: Use plain object for lazy getter in devtools/client/performance-new/symbolication.jsm.js. r=julienw,mstange
Differential Revision: https://phabricator.services.mozilla.com/D147907
2022-06-06 07:09:55 +00:00
Tooru Fujisawa 725309d478 Bug 1772093 - Part 5: Use plain object for lazy getter in devtools/client/styleeditor/. r=devtools-reviewers,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D147901
2022-06-06 07:09:53 +00:00
Tooru Fujisawa 9f4d6c53aa Bug 1772093 - Part 4: Use plain object for lazy getter in devtools/client/storage/. r=devtools-reviewers,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D147900
2022-06-06 07:09:53 +00:00
Tooru Fujisawa f28017dac7 Bug 1772093 - Part 3: Use plain object for lazy getter in devtools/client/shared/. r=devtools-reviewers,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D147899
2022-06-06 07:09:53 +00:00
Tooru Fujisawa 177eb08f33 Bug 1772093 - Part 2: Use plain object for lazy getter in devtools/client/jsonview/. r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D147898
2022-06-06 07:09:52 +00:00
Tooru Fujisawa a767536cca Bug 1772093 - Part 1: Use plain object for lazy getter in devtools/client/framework/. r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D147897
2022-06-06 07:09:52 +00:00
Tooru Fujisawa 7fe9e3ef7e Bug 1772093 - Part 0: Eagerly import some modules in devtools/. r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D148178
2022-06-06 07:09:51 +00:00
Tooru Fujisawa 823c668f50 Bug 1772351 - Part 1: Stop calling ChromeUtils.defineModuleGetter for AppConstants. r=florian
Differential Revision: https://phabricator.services.mozilla.com/D148164
2022-06-06 04:42:08 +00:00
Molnar Sandor 77402a5caa Backed out 15 changesets (bug 1772313, bug 1772351, bug 1772360) for causing xpc failures in telemetry/tests/unit/test_SocketScalars.js CLOSED TREE
Backed out changeset c8b0a2ed239e (bug 1772360)
Backed out changeset 1922adad6abe (bug 1772351)
Backed out changeset 6d3634cce489 (bug 1772351)
Backed out changeset f03968a9d053 (bug 1772351)
Backed out changeset e7a38ef90fe4 (bug 1772351)
Backed out changeset b389e7654771 (bug 1772313)
Backed out changeset 59a33598ff51 (bug 1772313)
Backed out changeset ab60885a8a93 (bug 1772313)
Backed out changeset aad8efac9d05 (bug 1772313)
Backed out changeset 4378e519a8e7 (bug 1772313)
Backed out changeset 302ac54741f8 (bug 1772313)
Backed out changeset 74c59f9fd51c (bug 1772313)
Backed out changeset 575fb877c56c (bug 1772313)
Backed out changeset 2eaa68f10b19 (bug 1772313)
Backed out changeset 4a8b3ba193dc (bug 1772313)
2022-06-06 07:04:25 +03:00
Tooru Fujisawa 5ff7b51845 Bug 1772351 - Part 1: Stop calling ChromeUtils.defineModuleGetter for AppConstants. r=florian
Differential Revision: https://phabricator.services.mozilla.com/D148164
2022-06-06 02:49:12 +00:00
Julian Descottes b4b1231f7f Bug 1772239 - [devtools] Stop reading client preference devtools.browsertoolbox.fission in the devtools server r=ochameau,devtools-backward-compat-reviewers,bomsy
The devtools.browsertoolbox.fission should not be read on the server but should instead be provided to the server by the client.
The breakage can be reproduced if you try to debug a Firefox desktop with devtools.browsertoolbox.fission = false from a Firefox with devtools.browsertoolbox.fission
= true.

Differential Revision: https://phabricator.services.mozilla.com/D148129
2022-06-03 16:51:51 +00:00
Michael Ratcliffe b607b4b44f Bug 1771998 - Eliminate mozilla/reject-osfile eslint warning in PerfTools code r=julienw
Try is green:
https://treeherder.mozilla.org/jobs?repo=try&revision=9fe09c79953c516ffaaca3efada1fbe53cb9c97c

Differential Revision: https://phabricator.services.mozilla.com/D148068
2022-06-03 15:40:58 +00:00
Molnar Sandor 4d1529da83 Bug 1772211 - Fix typo. a=fix. 2022-06-03 12:34:06 +03:00
Michael Ratcliffe 010e0b9179 Bug 1759914 - Clean up downloads after browser_screenshot_button.js r=devtools-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D148151
2022-06-03 09:14:26 +00:00
Butkovits Atila d03eb2b6c1 Bug 1772211 - disable browser_net_truncate-post-data.js with socket process networking for permanent failures
These started after the changes in bug 1772074.

Differential Revision: https://phabricator.services.mozilla.com/D148069
2022-06-03 08:40:32 +00:00
Michael Ratcliffe 3133e874e5 Bug 1771608 - Eliminate mozilla/reject-osfile eslint warning in devTools code r=devtools-reviewers,perftest-reviewers,jdescottes,sparky
## Removed Some Osfile.jsm and ChromeUtils Dependencies

```diff
-  const { OS } = require("resource://gre/modules/osfile.jsm");

And / Or

-  const ChromeUtils = require("ChromeUtils");
```

- devtools/client/memory/actions/io.js
- devtools/client/memory/utils.js
- devtools/client/netmonitor/src/har/har-menu-utils.js
- devtools/client/responsive/test/browser/browser_screenshot_button.js
- devtools/client/shared/remote-debugging/adb/adb-binary.js
- devtools/client/shared/screenshot.js
- devtools/client/styleeditor/StyleEditorUI.jsm
- devtools/client/styleeditor/StyleSheetEditor.jsm
- devtools/client/webconsole/components/Input/JSTerm.js
- devtools/client/webconsole/test/browser/stub-generator-helpers.js
- devtools/server/actors/heap-snapshot-file.js
- devtools/server/actors/storage.js
- devtools/server/tests/xpcshell/test_MemoryActor_saveHeapSnapshot_01.js
- devtools/server/tests/xpcshell/test_MemoryActor_saveHeapSnapshot_02.js
- devtools/server/tests/xpcshell/test_MemoryActor_saveHeapSnapshot_03.js
- devtools/shared/DevToolsUtils.js
- devtools/shared/heapsnapshot/HeapSnapshotFileUtils.js
- devtools/shared/tests/xpcshell/test_fetch-file.js
- testing/talos/talos/tests/devtools/addon/content/tests/toolbox/screenshot.js

## IOUtils.read()

```diff
-  OS.File.read(path);
+  IOUtils.read(path);
```

- devtools/client/aboutdebugging/test/browser/helper-real-usb.js
- devtools/client/netmonitor/src/har/har-menu-utils.js
- devtools/client/shared/remote-debugging/adb/adb-binary.js
- devtools/client/styleeditor/StyleSheetEditor.jsm
- devtools/client/webconsole/components/Input/JSTerm.js
- devtools/client/webconsole/test/browser/browser_jsterm_file_load_save_keyboard_shortcut.js
- devtools/client/webconsole/test/browser/browser_webconsole_context_menu_export_console_output.js
- devtools/shared/DevToolsUtils.js

## IOUtils.write()

```diff
-  OS.File.writeAtomic(filePath, fileContent);
+  IOUtils.write(filePath, fileContent);
```

- devtools/client/webconsole/test/browser/stub-generator-helpers.js
- devtools/shared/DevToolsUtils.js
- devtools/shared/tests/xpcshell/test_fetch-file.js

## PathUtils.split()

```diff
-  OS.Path.split(path);
+  PathUtils.split(path);
```

- devtools/client/styleeditor/StyleSheetEditor.jsm

## PathUtils.join()

```diff
-  OS.Path.join(path, filename);
+  PathUtils.join(path, filename);
```

NOTE: If `filename` is an absolute path then `OS.Path` will ignore `path` and use `filename` but `PathUtils` will try to concatenate both paths. If filename can be an absolute path we need to use `PathUtils.isAbsolute()` and `PathUtils.joinRelative()` to make our desired behaviour explicit.

- devtools/client/debugger/test/mochitest/browser_dbg-chrome-create.js
- devtools/client/shared/remote-debugging/adb/adb-binary.js
- devtools/client/styleeditor/StyleSheetEditor.jsm
- devtools/shared/heapsnapshot/HeapSnapshotFileUtils.js

## PathUtils.isAbsolute() and PathUtils.joinRelative()

```diff
-  filename = OS.Path.join(path, filename);
+  filename = PathUtils.isAbsolute(filename)
+    ? filename
+    : PathUtils.joinRelative(path, filename);
```

- devtools/client/shared/screenshot.js

## IOUtils.remove()

```diff
-  OS.File.remove(filePath);
+  IOUtils.remove(filePath);
```

- devtools/client/framework/test/browser_toolbox_screenshot_tool.js
- devtools/client/responsive/test/browser/browser_screenshot_button.js
- devtools/client/responsive/test/browser/browser_screenshot_button_warning.js
- devtools/client/shared/test/shared-head.js
- devtools/client/webconsole/test/browser/browser_console_screenshot.js
- devtools/client/webconsole/test/browser/browser_jsterm_screenshot_command_file.js
- devtools/client/webconsole/test/browser/browser_jsterm_screenshot_command_fixed_header.js
- devtools/client/webconsole/test/browser/browser_jsterm_screenshot_command_selector.js
- testing/talos/talos/tests/devtools/addon/content/tests/toolbox/screenshot.js

## PathUtils.toFileURI()

```diff
-  OS.Path.toFileURI(filePath);
+  PathUtils.toFileURI(filePath);
```

- devtools/client/framework/test/browser_toolbox_screenshot_tool.js
- devtools/client/responsive/test/browser/browser_screenshot_button.js
- devtools/client/shared/test/shared-head.js
- devtools/client/webconsole/test/browser/browser_console_screenshot.js
- devtools/client/webconsole/test/browser/browser_jsterm_screenshot_command_file.js
- devtools/client/webconsole/test/browser/browser_jsterm_screenshot_command_fixed_header.js
- devtools/client/webconsole/test/browser/browser_jsterm_screenshot_command_selector.js

## PathUtils.filename()

```diff
-  OS.Path.basename(path),
+  PathUtils.filename(path),
```

- devtools/client/memory/actions/io.js
- devtools/client/memory/utils.js
- devtools/client/styleeditor/StyleEditorUI.jsm
- devtools/client/styleeditor/StyleSheetEditor.jsm

## IOUtils.copy()

```diff
-  OS.File.copy(path, dest);
+  IOUtils.copy(path, dest);
```

- devtools/client/memory/actions/io.js

## IOUtils.stat()

```diff
-  OS.File.stat(filePath);
+  IOUtils.stat(filePath);
```

The objects that these `stat()` versions return differ from one another. This hasn't made much difference to the codebase but our changed usage is included here for completeness:

```diff
-      this._fileModDate = info.lastModificationDate.getTime();
+      this._fileModDate = info.lastModified;
```

- devtools/client/memory/test/browser/browser_memory_transferHeapSnapshot_e10s_01.js
- devtools/client/memory/test/xpcshell/head.js
- devtools/client/memory/test/xpcshell/test_action-export-snapshot.js
- devtools/client/styleeditor/StyleSheetEditor.jsm
- devtools/server/actors/heap-snapshot-file.js
- devtools/server/tests/xpcshell/test_MemoryActor_saveHeapSnapshot_01.js
- devtools/server/tests/xpcshell/test_MemoryActor_saveHeapSnapshot_02.js
- devtools/server/tests/xpcshell/test_MemoryActor_saveHeapSnapshot_03.js
- devtools/shared/heapsnapshot/HeapSnapshotFileUtils.js

## IOUtils.setPermissions

```diff
-  OS.File.setPermissions(filePath, { unixMode: 0o744 });
+  IOUtils.setPermissions(filePath, 0o744);
```

- devtools/client/shared/remote-debugging/adb/adb-binary.js

## IOUtils.makeDirectory

```diff
-  OS.File.makeDir(path);
+  IOUtils.makeDirectory(path);
```

- devtools/client/shared/remote-debugging/adb/adb-binary.js

## IOUtils.exists

```diff
-  OS.File.exists(path);
+  IOUtils.exists(path);
```

- devtools/client/shared/remote-debugging/adb/adb-binary.js
- devtools/client/shared/screenshot.js
- devtools/client/webconsole/test/browser/browser_jsterm_file_load_save_keyboard_shortcut.js
- devtools/client/webconsole/test/browser/browser_webconsole_context_menu_export_console_output.js

## PathUtils.profileDir, PathUtils.localProfileDir and PathUtils.tempDir

```diff
-    const profileDir = OS.Constants.Path.profileDir;
+    const profileDir = PathUtils.profileDir;
```

We can reduce reliance on `Osfile.jsm` in another bug bug this is a small step in that direction.

- devtools/client/shared/remote-debugging/adb/adb-binary.js
- devtools/server/actors/storage.js
- devtools/shared/heapsnapshot/HeapSnapshotFileUtils.js

## IOUtils.getChildren(storagePath)

`IOUtils` does not have a direct equivalent of `OS.File.DirectoryIterator()` so we need to iterate more explicitely using `IOUtils.getChildren()`.

```diff
- async findStorageTypePaths(storagePath) {
-   const iterator = new OS.File.DirectoryIterator(storagePath);
-   const typePaths = [];
-
-   await iterator.forEach(entry => {
-     if (entry.isDir) {
-       typePaths.push(entry.path);
-     }
-   });
-
-   iterator.close();
-   return typePaths;
- }

+ async findStorageTypePaths(storagePath) {
+   const children = await IOUtils.getChildren(storagePath);
+   const typePaths = [];
+
+   for (const path of children) {
+     const exists = await IOUtils.exists(path);
+     if (!exists) {
+       continue;
+     }
+
+     const stats = await IOUtils.stat(path);
+     if (stats.type === "directory") {
+       typePaths.push(path);
+     }
+   }
+
+   return typePaths;
+ }

```

- devtools/server/actors/storage.js

## Misc

Made `IOUtils` and `PathUtils` available to DevTools modules.

```diff
   HeapSnapshot,
+  IOUtils,
   L10nRegistry,
   Localization,
   NamedNodeMap,
   NodeFilter,
+  PathUtils,
   StructuredCloneHolder,
   TelemetryStopwatch,
```

- devtools/shared/loader/builtin-modules.js

Differential Revision: https://phabricator.services.mozilla.com/D147589
2022-06-02 21:13:56 +00:00
Alexandre Poirot 782ca9d04e Bug 1770527 - [devtools] Fix and ensure that browser toolbox close when closing Firefox. r=jdescottes
Either of the two changes fixes the reported issue.

On the frontend side, we weren't listening to DevToolsClient/connection close.
So that there was no guarantee that the Browser Toolbox would close if the remote connection is lost.
We were actually depending on Launcher.close to be called (it is called correctly)
and complete `dbgProcess.kill()`, which apparently doesn't always work during shutdown.

It looks like `SubProcess.kill` was made slower and didn't always had time to complete
because on the server side, the Parent Process Target actor was trying
to switch from browser.xhtml to chrome://extensions/content/dummy.xhtml.
But this document is being destroyed and the target as well as all children
actors and watchers were still trying to debug stuff and were all throwing.

Correctly destroying the parent process target actor when browser.xhtml is closed
seems to allow SubProcess.kill to complete...
And thanks to client's closed listener, even if we stop killing the process,
the browser toolbox process will close by itself.

Differential Revision: https://phabricator.services.mozilla.com/D148128
2022-06-02 20:26:43 +00:00
Iulian Moraru 43e6873145 Backed out 4 changesets (bug 1764348, bug 1771277) for causing multiple dt failures. CLOSED TREE
Backed out changeset 21c03813c9d0 (bug 1771277)
Backed out changeset 0ee89f81d7da (bug 1764348)
Backed out changeset 47658c248d9e (bug 1764348)
Backed out changeset 712947c3a514 (bug 1764348)
2022-06-02 23:13:28 +03:00
Michael Ratcliffe 8b939608d8 Bug 1771675 - Eliminate jest/expect-expect eslint warning in devTools code r=devtools-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D147590
2022-06-02 14:38:57 +00:00
Hubert Boma Manilla f1cdd9a344 Bug 1771277 - [devtools] Remove the websocket and server sent events prefs r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D147413
2022-06-02 14:35:25 +00:00
Hubert Boma Manilla 61afb77264 Bug 1764348 - Pause / Resume should toggle listening to network resources r=ochameau
With this patch Pause and Resume, now stop and start listening to network requests

Differential Revision: https://phabricator.services.mozilla.com/D146445
2022-06-02 14:35:24 +00:00
Hubert Boma Manilla 4cf961c731 Bug 1764348 - Enable browser console / browser toolbox console users turn on network monitoring manually r=nchevobbe
Highlights
- Network monitoring is turned off by default in browser console/ browser toolbox console on initial load.
- A new "Enable Network Monitoring" setting is added to enable users toggle on an off as they desire.
- The user setting is persisted across toolbox reopens.

Differential Revision: https://phabricator.services.mozilla.com/D145234
2022-06-02 14:35:24 +00:00
Hubert Boma Manilla cd2e5e5def Bug 1764348 - Cleanup hidePersistLogsCheckbox and hideShowContentMessagesCheckbox property r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D145550
2022-06-02 14:35:24 +00:00
Alexandre Poirot 2c2ef59588 Bug 1771088 - [devtools] Ensure instantiating only one Loader when debugging the system principal. r=jdescottes
We were instantiating one new Loader per DevToolsFrameChild instance.
This patch tries to share this loader with all the instances as well as share it
with the one used to load DevToolsServer when we are running in the parent process.

Differential Revision: https://phabricator.services.mozilla.com/D147257
2022-06-01 14:38:36 +00:00
Gabriele Svelto fd3fc54c5d Bug 1771875 - Add BrowserTestUtils.reloadTab() and use it everywhere r=mconley,webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D147732
2022-06-01 09:34:05 +00:00
Andreea Pavel 2f656a0bc7 Bug 1767702 - disable browser_dbg-features-source-tree.js on win10_2004 r=intermittent-reviewers,gbrown DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D147455
2022-05-30 17:58:02 +00:00
Tooru Fujisawa 288f7cc11f Bug 1610653 - Part 23: Stop using global this to define variable in devtools/. r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D146556
2022-05-30 15:19:43 +00:00
Alexandre Poirot 9d20fea826 Bug 1764179 - [devtools] Ensure that TargetFront is fully initialized when processing resources sent via the Watcher. r=jdescottes
When resources related to a given Target are notified via the Watcher actor,
we have to ensure waiting for the TargetFront to be fully initialized.
That's because code watching for resources expect the target front to be attached
and have its thread front already available.

Differential Revision: https://phabricator.services.mozilla.com/D143408
2022-05-30 11:07:22 +00:00
Michael Ratcliffe 39a7b6d134 Bug 1771387 - Fix DevTools eslint react/prop-types errors batch 4 r=devtools-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D147467
2022-05-27 16:17:28 +00:00
Michael Ratcliffe c2c0851427 Bug 1771210 - Fix DevTools eslint react/prop-types errors batch 3 r=devtools-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D147358
2022-05-27 16:16:11 +00:00
Nicolas Chevobbe 61de9e873b Bug 1770572 - [devtools] Fix browser_webconsole_location_styleeditor_link.js intermittent failure. r=jdescottes.
Wait for the cursor to be set.
We take this opportunity to inline the functions that were only called once,
as well as refactor a few things to make the test easier to read.

Differential Revision: https://phabricator.services.mozilla.com/D147259
2022-05-27 05:51:07 +00:00
colin_czb b32bbdb0ff Bug 1354054 - [devtools] Network panel could display request priority r=Honza
Differential Revision: https://phabricator.services.mozilla.com/D144524
2022-05-26 11:40:27 +00:00
Hubert Boma Manilla 4e71c54c7c Bug 1770204 - [devtools] Simplify breakpoint list selectors r=nchevobbe
The selector is already sorting the breakpoints,
so there is no need to re-sort them in the component.

Also Array.sort(stringA-stringB) was misbehaving.

Then I'm using getSourcesMap in order to avoid calling getBreakpointList many times.
Otherwise getSourcesForBreakpoints has to receive the state object
in order to retrieve the source objects.

Differential Revision: https://phabricator.services.mozilla.com/D146426
2022-05-26 01:51:41 +00:00
Alexandre Poirot 0ef5894a15 Bug 1770961 - [devtools] Fix breakableLines selectors to be correctly memoized. r=bomsy
breakableLines wasn't correctly memoized for sources other than the original ones.
This patch at least fix this for regular JS files sources, but the issue still
happens for HTML sources having more than one source actor.

Differential Revision: https://phabricator.services.mozilla.com/D147195
2022-05-25 18:34:18 +00:00
Alexandre Poirot 215ceb2657 Bug 1770959 - [devtools] Use standard URL constructor instead of whatwg-url module. r=nchevobbe
And remove this module which is no longer used.

Differential Revision: https://phabricator.services.mozilla.com/D147194
2022-05-25 16:56:44 +00:00
Michael Ratcliffe 301e954586 Bug 1770257 - Fix DevTools eslint react/prop-types errors batch 1 r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147017
2022-05-25 11:53:29 +00:00
Michael Ratcliffe e32688c098 Bug 1770941 - Fix DevTools eslint react/prop-types errors batch 2 r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147184
2022-05-25 09:35:03 +00:00
Tooru Fujisawa d132ced6f5 Bug 1770926 - Reset mixed content protection state after the test in browser_webconsole_block_mixedcontent_securityerrors.js. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147207
2022-05-25 06:00:33 +00:00
Alexandre Poirot 075deaa670 Bug 1770205 - [devtools] Flag SOURCE resources for inline sources and flag debugger frontend sources for HTML sources. r=nchevobbe
In the frontend we end up having special sources, related to many source actors.
These are the sources for HTML pages, which have one unique source object.
But each inline <script> tag will have its own source actor.
All these sources actors will be bound to this unique source for the HTML page.

Differential Revision: https://phabricator.services.mozilla.com/D144412
2022-05-24 16:07:09 +00:00
Tooru Fujisawa 9e419509c8 Bug 1770956 - Fix comment for findMessagePartByType. r=nchevobbe DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D147193
2022-05-24 15:31:51 +00:00
Julian Descottes 0f4eade0f1 Bug 1770882 - [devtools] Add a tooltip to the throttling menu button to show profile details r=nchevobbe,flod
The characteristics of the throttling profile are not really accessible anywhere.
At least having them in the button title can help.

I started reorganizing throttling profiles as instances of a ThrottlingProfile base class, because
that should be useful when we implement custom profiles

Differential Revision: https://phabricator.services.mozilla.com/D147131
2022-05-24 13:10:01 +00:00
Cosmin Sabou 9b3b068007 Backed out 2 changesets (bug 1770204, bug 1770205) for devtools faolires on browser_dbg-html-breakpoints.js. CLOSED TREE
Backed out changeset ad44d2e50491 (bug 1770205)
Backed out changeset a1459819402b (bug 1770204)
2022-05-24 14:22:55 +03:00
Alexandre Poirot 16b34baf43 Bug 1770205 - [devtools] Flag SOURCE resources for inline sources and flag debugger frontend sources for HTML sources. r=nchevobbe
In the frontend we end up having special sources, related to many source actors.
These are the sources for HTML pages, which have one unique source object.
But each inline <script> tag will have its own source actor.
All these sources actors will be bound to this unique source for the HTML page.

Differential Revision: https://phabricator.services.mozilla.com/D144412
2022-05-24 10:31:25 +00:00
Hubert Boma Manilla 118d06dbf1 Bug 1770204 - [devtools] Simplify breakpoint list selectors r=nchevobbe
The selector is already sorting the breakpoints,
so there is no need to re-sort them in the component.

Also Array.sort(stringA-stringB) was misbehaving.

Then I'm using getSourcesMap in order to avoid calling getBreakpointList many times.
Otherwise getSourcesForBreakpoints has to receive the state object
in order to retrieve the source objects.

Differential Revision: https://phabricator.services.mozilla.com/D146426
2022-05-24 10:31:25 +00:00
Tooru Fujisawa 8dfedc9ddb Bug 1764717 - Part 27: Convert remaining findMessageVirtualized to findMessageVirtualizedById. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147047
2022-05-24 10:06:08 +00:00
Tooru Fujisawa d41ab8c282 Bug 1764717 - Part 26: Remove waitForMessage and waitForMessages. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147046
2022-05-24 10:06:08 +00:00
Tooru Fujisawa 6c60f75a7c Bug 1764717 - Part 25: Change keyboardExecuteAndWaitForMessage to keyboardExecuteAndWaitForMessageByType. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147045
2022-05-24 10:06:07 +00:00
Tooru Fujisawa 8dd0b19d88 Bug 1764717 - Part 24: Remove executeAndWaitForMessage. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147044
2022-05-24 10:06:07 +00:00
Tooru Fujisawa 76e4652526 Bug 1764717 - Part 23: Use executeAndWaitForMessageByType. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147043
2022-05-24 10:06:06 +00:00
Tooru Fujisawa 4d0c94f0bd Bug 1764717 - Part 22: Add executeAndWaitForMessageByType. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147042
2022-05-24 10:06:06 +00:00
Tooru Fujisawa 1f49720f29 Bug 1764717 - Part 21: Use waitForMessageByType and waitForMessagesByType. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147041
2022-05-24 10:06:06 +00:00
Tooru Fujisawa 28e7c3072f Bug 1764717 - Part 20: Add waitForMessageByType and waitForMessagesByType. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147040
2022-05-24 10:06:05 +00:00
Tooru Fujisawa f4e0a88160 Bug 1764717 - Part 19: Use findMessageByType and findMessagesByType tests in other directories. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147039
2022-05-24 10:06:05 +00:00
Tooru Fujisawa 4330e3ea2a Bug 1764717 - Part 18: Use findMessagesVirtualizedByType in checkUniqueMessageExists. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147038
2022-05-24 10:06:04 +00:00
Tooru Fujisawa c0b4d71d4f Bug 1764717 - Part 17: Use findMessageVirtualizedByType and findMessagesVirtualizedByType in tests. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147037
2022-05-24 10:06:04 +00:00
Tooru Fujisawa 27de3cf43f Bug 1764717 - Part 16: Add findMessageVirtualizedByType and findMessagesVirtualizedByType. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147036
2022-05-24 10:06:04 +00:00
Tooru Fujisawa 73fa2223ee Bug 1764717 - Part 15: Remove findMessage and findMessages from devtools/client/webconsole/test/browser/head.js. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147035
2022-05-24 10:06:03 +00:00
Tooru Fujisawa 6b71ed8c44 Bug 1764717 - Part 14: Use findErrorMessage in checkMessageStack. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147034
2022-05-24 10:06:03 +00:00
Tooru Fujisawa d015a45575 Bug 1764717 - Part 13: Use findMessageByType in openMessageInNetmonitor. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147033
2022-05-24 10:06:03 +00:00
Tooru Fujisawa dca246be3f Bug 1764717 - Part 12: Use findMessageByType in testOpenInDebugger. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147032
2022-05-24 10:06:02 +00:00
Tooru Fujisawa 13a1b61667 Bug 1764717 - Part 11: Add waitForRepeatedMessageByType. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147031
2022-05-24 10:06:02 +00:00
Tooru Fujisawa a287d936ce Bug 1764717 - Part 10: Use findMessagePart(s)ByType in devtools/client/webconsole/test/browser/. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147030
2022-05-24 10:06:01 +00:00
Tooru Fujisawa 0192380a06 Bug 1764717 - Part 9: Define findMessagePartByType and findMessagePartsByType. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147029
2022-05-24 10:06:01 +00:00
Tooru Fujisawa 6e6f58927e Bug 1764717 - Part 8: Use findAllMessages in devtools/client/webconsole/test/browser/. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147028
2022-05-24 10:06:00 +00:00
Tooru Fujisawa 6bbce4386c Bug 1764717 - Part 7: Define findAllMessages. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147027
2022-05-24 10:06:00 +00:00
Tooru Fujisawa 40f9a2dd0b Bug 1764717 - Part 6: Use type-specific findMessage(s) in devtools/client/webconsole/test/browser/browser_webconsole_*. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147026
2022-05-24 10:05:59 +00:00
Tooru Fujisawa 9ef63471c0 Bug 1764717 - Part 5: Use type-specific findMessage(s) in devtools/client/webconsole/test/browser/browser_jsterm_*. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147025
2022-05-24 10:05:59 +00:00
Tooru Fujisawa 1a8bd8c676 Bug 1764717 - Part 4: Use type-specific findMessage(s) in devtools/client/webconsole/test/browser/browser_console_*. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147024
2022-05-24 10:05:59 +00:00
Tooru Fujisawa 0ca8c52ae8 Bug 1764717 - Part 3: Define type-specific wrappers for findMessageByType and findMessagesByType. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147023
2022-05-24 10:05:58 +00:00
Tooru Fujisawa bd694eb9e3 Bug 1764717 - Part 2: Define findMessageByType and findMessagesByType. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147022
2022-05-24 10:05:58 +00:00
Tooru Fujisawa fd93af6976 Bug 1764717 - Part 1: Add shared-head.js in devtools/client/webconsole/test/browser/_browser_console.ini. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D147021
2022-05-24 10:05:58 +00:00
Alexandre Poirot 0eb74c5c7f Bug 1770360 - [devtools] Remove the stylesheets of destroyed targets. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D146889
2022-05-23 20:09:33 +00:00
Tom Schuster 78d2f34bf1 Bug 1763367 - Filter out unexpected messages. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D146901
2022-05-23 13:51:58 +00:00
Cristian Tuns 828f93231b Backed out 2 changesets (bug 1763367) as requested by evilpie on element. CLOSED TREE
Backed out changeset 9b27117a24c8 (bug 1763367)
Backed out changeset cd28d8497f99 (bug 1763367)
2022-05-23 06:53:28 -04:00
Tom Schuster e88688c34c Bug 1763367 - Filter out unexpected messages. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D146901
2022-05-23 09:07:51 +00:00
Julian Descottes 228c49e017 Bug 1764148 - [devtools] Add deadzone to drag to update feature r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D146667
2022-05-23 09:03:15 +00:00
Alexandre Poirot b2f1ef9241 Bug 1770130 - [devtools] Get rid of WorkerDescriptorActor.attach. r=nchevobbe,devtools-backward-compat-reviewers
We can immediately "attach" the descriptor as it gets instantiated.
So that the frontend no longer need to call this before doing anything around the worker.

I also renamed the descriptor front method "attach" method,
in order to better highlight how special it is.
Hopefully we can drop this once the worker targets are created by the server.
i.e. when we enable service side worker targets for the browser toolbox,
which includes supporting service workers.

Differential Revision: https://phabricator.services.mozilla.com/D146787
2022-05-23 08:38:01 +00:00
Julian Descottes 2f70942796 Bug 1768161 - [devtools] Use localName instead of nodeName in inactive-property-helper.js r=nchevobbe
Depends on D146898
nodeName can include the namespace prefix eg html:img, failing some of our string comparisons

Differential Revision: https://phabricator.services.mozilla.com/D146899
2022-05-20 15:13:55 +00:00
Nicolas Chevobbe 165ce5b39e Bug 1770238 - [devtools] Remove global.MessageChannel in webconsole mocha tests to avoid hangs. r=jdescottes.
There's an issue in React 16 that only occurs when MessageChannel is available
which prevents the nodeJS process to exit.
MessageChannel support was added in Node 15, so when we try to update to Node 16,
it caused a problem in CI.

Differential Revision: https://phabricator.services.mozilla.com/D146906
2022-05-20 12:58:17 +00:00
Nicolas Chevobbe 285ff88a80 Bug 1769973 - [devtools] Localize Device headers in Settings modal. r=bomsy.
We already have translation strings in `device.properties`, so we can use them.
String for `custom` type was missing, so we add it.
Assertions are added in test to check that we do have the expected labels in the UI.

Differential Revision: https://phabricator.services.mozilla.com/D146784
2022-05-20 12:54:38 +00:00
Benjamin VanderSloot bd52a7aac3 Bug 1765309, part 2 - Convert requestStorageAccess to use new helper functions before async portion, r=anti-tracking-reviewers,timhuang
Two tests had to be changed.
The first test had to be changed because I removed redundant error message logging from requestStorageAccess and its network of helpers.
The second is because we were acting out-of-specification and stopping nested iframes from using the storage access API. I could have done this in a second bug, but I felt like doing it here made sense enough.

Depends on D146343

Differential Revision: https://phabricator.services.mozilla.com/D146344
2022-05-20 11:46:04 +00:00
Nicolas Chevobbe 2fde15757f Bug 1766602 - [devtools] Speedup jump to styleeditor from inspector. r=jdescottes.
In `viewSourceInStyleEditor`, we used to first load the styleeditor, and then
select the stylesheet and show the panel. This mean that when clicking on a location
from the rule view, there would be some delays before we show any feedback to the user.
Since the load promise for the panel only settles once we watched for all existing
stylesheets and loaded their content for each of them, it could take a while in
cases where we have lots of stylesheets, like in the BrowserToolbox.

So here we modify `viewSourceInStyleEditor` to directly select the styleeditor and
passing it a stylesheet that can be added right away, in case the panel wasn't
loaded yet, without waiting for the stylesheets to be watched.

We take this as an opportunity add a test when `viewSourceInStyleEditor` is called
with a stylesheet not used on the page, and check that it does open a view-source tab.

Differential Revision: https://phabricator.services.mozilla.com/D146540
2022-05-20 06:24:37 +00:00
Nicolas Chevobbe 1e61e4307b Bug 1770160 - [devtools] Don't filter out platform-specific errors in Browser Console/Browser Toolbox. r=ochameau.
This is as simple as checking the session context type.

Differential Revision: https://phabricator.services.mozilla.com/D146818
2022-05-20 05:47:23 +00:00
Emilio Cobos Álvarez 9bf4df31fd Bug 1769771 - Basic constructable stylesheets + devtools tests. r=nchevobbe
Just testing that the editor and the new label work as expected since
these are the things that I could find broken in my reduced examples.

Differential Revision: https://phabricator.services.mozilla.com/D146688
2022-05-19 22:32:29 +00:00
Emilio Cobos Álvarez 05a8fc5ff9 Bug 1769771 - Differentiate inline from constructed stylesheets in rule view. r=nchevobbe
I think this is worth it, but needs localization changes so splitting
it out.

Differential Revision: https://phabricator.services.mozilla.com/D146683
2022-05-19 22:32:28 +00:00
Hubert Boma Manilla 4d189564be Bug 1769572 - [devtools] The CONNECT method should no longer be sent on request resend r=nchevobbe
The CONNECT method sent on Edit & Resend of certain requests crashes firefox
based on https://bugzilla.mozilla.org/show_bug.cgi?id=1769572#c2, Necko uses CONNECT in a special way, so lets restrict
the devtools from selecting and sending it.

The crash happens with both the current and new edit and resend panels, so this patch
needs to be tested for both.

Use the devtools.netmonitor.features.newEditAndResend and set it to true to enable the new edit and resend panel.

Note: The new edit and resend panel is enabled by default in Nightly.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1769572#c0 for the STR for the current Edit and Resend panel
See https://bugzilla.mozilla.org/show_bug.cgi?id=1769572#c7 for the STR for the new Edit and Resend

Differential Revision: https://phabricator.services.mozilla.com/D146820
2022-05-19 18:26:43 +00:00
Doug Thayer ac86b09b87 Bug 1761554 - Use a Map-based cache for ResourceCommand r=ochameau
This just intends to alleviate the more noticeable problem when the cache grows
too large by avoiding iterating through the array every time something changes.
There still remains the work of limiting the size of this based on what the UI
is capped at, but that can come later.

Differential Revision: https://phabricator.services.mozilla.com/D142279
2022-05-19 16:39:14 +00:00
Alexandre Poirot fe91c0f518 Bug 1769795 - [devtools] Avoid updating empty lines too frequently in the debugger. r=bomsy
We were calling the costly disableEmptyLines very frequently, about once for each new incoming source or so.

Differential Revision: https://phabricator.services.mozilla.com/D146665
2022-05-19 16:30:17 +00:00
Nicolas Chevobbe 17d1efcc34 Bug 1764347 - [devtools] Add Browser Toolbox test for the Style Editor. r=jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D146539
2022-05-19 05:24:55 +00:00
Michael Comella 396647cde1 Bug 1766516 - add about:profiling thread checkboxes for java. r=canaltinova,fluent-reviewers,flod
I tried to pick thread groups that are part of GeckoView (Gecko), might be
common to GeckoView products (Nimbus), and the Android ecosystem (Kotlin
coroutines) instead of threads that are fenix-specific.

Differential Revision: https://phabricator.services.mozilla.com/D144753
2022-05-18 17:24:39 +00:00
Hubert Boma Manilla ffb083dccd Bug 1766237 - [devtools] Get the WebExtensionPolicy from the ExtensionProcessScript global r=jdescottes,rpl,ochameau
The issue here is it seems like WebExtensionPolicy is not always available on the Cu global,
therefore failing when trying to get the extension policy name.
in this example when adding sources from the browser toolbox (i'm still not completely sure why)

The solution here is changing to using the ExtensionProcessScript which works for the web and browser
toolbox.
Also added a `console.warn` so we get some notification when this fails.

Differential Revision: https://phabricator.services.mozilla.com/D144787
2022-05-18 08:56:13 +00:00
Mark Banner 3924c8914b Bug 1769569 - Automatically replace Components.* with C* in sjs files. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D146451
2022-05-18 08:13:19 +00:00
Mark Banner b0725e2037 Bug 1769569 - Disable reject-importGlobalProperties for sjs files via the ESLint rule. r=Gijs
Depends on D146450

Differential Revision: https://phabricator.services.mozilla.com/D146598
2022-05-18 08:13:18 +00:00
Mark Banner 3b0258336e Bug 1769569 - Enable ESLint rule no-define-cc-etc for devtools sjs files. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D146449
2022-05-18 08:13:18 +00:00
Sebastian Hengst c552340e0c Backed out 5 changesets (bug 1769569) for causing devtools' browser/browser_page_redirection.js to fail. CLOSED TREE
Backed out changeset 66a42eb3a366 (bug 1769569)
Backed out changeset d3cc9629cd9a (bug 1769569)
Backed out changeset edcd3dade079 (bug 1769569)
Backed out changeset 29d8dd058b7a (bug 1769569)
Backed out changeset 1aed34fdf2d3 (bug 1769569)
2022-05-17 19:49:17 +02:00
Mark Banner 4acbb4ff59 Bug 1769569 - Automatically replace Components.* with C* in sjs files. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D146451
2022-05-17 16:50:33 +00:00
Mark Banner 5b82552956 Bug 1769569 - Disable reject-importGlobalProperties for sjs files via the ESLint rule. r=Gijs
Depends on D146450

Differential Revision: https://phabricator.services.mozilla.com/D146598
2022-05-17 16:50:32 +00:00
Mark Banner 55789cb268 Bug 1769569 - Enable ESLint rule no-define-cc-etc for devtools sjs files. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D146449
2022-05-17 16:50:31 +00:00
Alexandre Poirot b798b2e643 Bug 1529621 - [devtools] Make all panel's destroy method be synchronous. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D146533
2022-05-17 16:45:13 +00:00
Nicolas Chevobbe 547c9df37d Bug 1767788 - [devtools] Fix browser_styleeditor_sv_keynav.js intermittent failure. r=jdescottes.
Wait for the proper editor-selected event.

Differential Revision: https://phabricator.services.mozilla.com/D146577
2022-05-17 15:21:50 +00:00
Julian Descottes 2c889a3c67 Bug 1769701 - [devtools] Use a blocking promise instead of an arbitrary delay in browser_inspector_inspect_loading_document.js r=nchevobbe
Depends on D146464

Differential Revision: https://phabricator.services.mozilla.com/D146544
2022-05-17 11:46:36 +00:00
Hubert Boma Manilla 9743602245 Bug 1765817 - [devtools] Add getLocationSource selector to fetch source for a location r=nchevobbe
This cleanup helps support the subsequent work for breakpoints per url.

Depends on D146426

Differential Revision: https://phabricator.services.mozilla.com/D146427
2022-05-17 11:10:21 +00:00
Julian Descottes e91cbfb2f4 Bug 1767759 - [devtools] Wait for toolbox-ready in browser_about-devtools-toolbox_reload.js r=devtools-reviewers,nchevobbe
The test was only waiting for addTab to resolve, waiting for the proper toolbox-ready event could reduce intermittent issues.

Differential Revision: https://phabricator.services.mozilla.com/D146530
2022-05-17 07:01:10 +00:00
Julian Descottes e4e4e73bb9 Bug 1768475 - [devtools] WalkerActor watchRootNode should not check isDocumentReady r=devtools-reviewers,nchevobbe
If the walker actor was initialized, we assume the document is ready enough and a root node can be returned if available.

A new test was added for a slow loading document.

Differential Revision: https://phabricator.services.mozilla.com/D146464
2022-05-17 06:04:47 +00:00
Tooru Fujisawa 11c6b37c5f Bug 1765319 - Part 2: Do not use global this in symbolication.jsm.js. r=canaltinova
This `global` variable is used for accessing Error prototypes, and they're
properties of the shared global (`globalThis`), not per-JSM global (`this`).

Differential Revision: https://phabricator.services.mozilla.com/D144131
2022-05-13 20:12:26 +00:00
Luke Swiderski 60d6bfde93 Bug 1695896 - Add/edit log on breakpoint in sidebar scroll line into view. r=bomsy
This patch scrolls the editor to the log input when adding or editing a log
from the breakpoint context menu.

Differential Revision: https://phabricator.services.mozilla.com/D146202
2022-05-13 16:22:01 +00:00
Hubert Boma Manilla 8418e968f1 Bug 1755197 - [devtools] Remove breakpoint shifting on breakpoint syncing r=ochameau
This patch focuses on removing breakpoint shifting which is mostly used in
non-sourcemapping scenarios.

Differential Revision: https://phabricator.services.mozilla.com/D138625
2022-05-13 03:35:18 +00:00
Hubert Boma Manilla c7c3e45ec6 Bug 1767188 - [devtools] Make sure the source is in redux before selecting during a pause r=nchevobbe
This tries to fix a race issue where, on reload, the pause event fires way before the
related source is available. This is an issue the had the potential on happening at some point.
This fix is not super perfect but with the trottling of sources there is no guurantee that sources will
always be available before pause event fires.
This pattern is also used for source actors. waitForSourceActorToBeRegisteredInStore.

Differential Revision: https://phabricator.services.mozilla.com/D145925
2022-05-11 05:45:58 +00:00
Cristian Tuns 23517e3d2b Backed out 3 changesets (bug 1758745, bug 1758740, bug 1762462) for causing mochitest failures on test_storagePermissionsAccept.html CLOSED TREE
Backed out changeset fa222c0a9a26 (bug 1762462)
Backed out changeset 9daa04b239f9 (bug 1758745)
Backed out changeset c18aecb431c0 (bug 1758740)
2022-05-10 20:12:45 -04:00
Benjamin VanderSloot 7560dc381a Bug 1762462 - Tests do not reflect Always Partitioning Storage, r=twisniewski
Depends on D143627

Differential Revision: https://phabricator.services.mozilla.com/D144731
2022-05-10 21:49:42 +00:00
Mark Banner 6da9b0cbbf Bug 1766533 - Fix devtools HSplitBox for ESLint rule no-constant-binary-expression. r=nchevobbe
Depends on D145653

Differential Revision: https://phabricator.services.mozilla.com/D145654
2022-05-10 20:04:03 +00:00
Nicolas Chevobbe 088b5c3f34 Bug 1688231 - [devtools] Remove backward command for :block command. r=bomsy.
The command requires having network resource command support,
which is still not enabled everywhere (e.g. non-multiprocess browser toolbox).
We simply remove the backward compat comment but leave the check on network
resource command support.

Differential Revision: https://phabricator.services.mozilla.com/D145890
2022-05-10 11:48:45 +00:00
Nicolas Chevobbe 4363c73f4a Bug 1688231 - [devtools] Delete noPauseOnThreadActorAttach trait. r=bomsy.
This was used for pre-86 servers, and we can now assume that all servers
threads don't pause on attach.

Differential Revision: https://phabricator.services.mozilla.com/D145888
2022-05-10 11:48:45 +00:00
Nicolas Chevobbe e7198c20ea Bug 1688231 - [devtools] Remove unnecessary StyleSheetEditor#_isUpdating. r=bomsy.
This was used for pre-86 servers, so we can remove it now.

Differential Revision: https://phabricator.services.mozilla.com/D145884
2022-05-10 11:48:44 +00:00
Nicolas Chevobbe 82b8cee903 Bug 1651428 - [devtools] Group context selector frame targets by their PIDs in Browser Toolbox console. r=Honza.
Depends on D145880

Differential Revision: https://phabricator.services.mozilla.com/D145942
2022-05-10 11:40:21 +00:00
Nicolas Chevobbe 2186a61def Bug 1768461 - [devtools] Fix content process and worker frame icons in context selector. r=Honza.
Adding the proper attribute on the SVG files is enough.

Differential Revision: https://phabricator.services.mozilla.com/D145880
2022-05-10 11:40:20 +00:00
Nicolas Chevobbe 03d2974d89 Bug 1768150 - [devtools] Turn StyleEditorUI methods private. r=bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D145856
2022-05-10 09:17:50 +00:00
Nicolas Chevobbe bb8c2ad43f Bug 1768150 - [devtools] Turn StyleEditorUI properties into private fields. r=bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D145855
2022-05-10 09:17:49 +00:00
Nicolas Chevobbe 8784696806 Bug 1768150 - [devtools] Don't use ui._* properties from styleeditor tests. r=bomsy.
This is some prep work to make those loosely private properties
actually be private fields.

Differential Revision: https://phabricator.services.mozilla.com/D145854
2022-05-10 09:17:49 +00:00
Nicolas Chevobbe 968874d5ce Bug 1767970 - [devtools] Merge SplitView into StyleEditorUI. r=jdescottes.
This allows to simplify what was done in SplitView and have
direct calls to functions instead of registering callbacks.

Differential Revision: https://phabricator.services.mozilla.com/D145607
2022-05-09 09:09:57 +00:00
Nicolas Chevobbe bf6abde59f Bug 1767970 - [devtools] Turn StyleEditorUI into a class. r=jdescottes.
This is some prep work for the next patch in the stack.

Differential Revision: https://phabricator.services.mozilla.com/D145606
2022-05-09 09:09:56 +00:00
Cosmin Sabou 57c5a2f155 Backed out changeset 3cdc612207bf (bug 1767070) for not having a real failure rate to be disabled. 2022-05-09 09:18:23 +03:00
Norisz Fay b938eef69c Bug 1767070 - disable uncompressed-sourcemaps.js for frequent failures. r=intermittent-reviewers,MasterWayZ
Differential Revision: https://phabricator.services.mozilla.com/D145836
2022-05-08 20:01:10 +00:00
Nicolas Chevobbe 2dae975b96 Bug 1668219 - [devtools] Remove prefs used in old perf panel. r=bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D145536
2022-05-06 17:16:30 +00:00
Nicolas Chevobbe 290ab0bcb4 Bug 1668219 - [devtools] Remove unused devtools/client/shared/options-view.js. r=bomsy.
It was only used in the old perf panel.

Differential Revision: https://phabricator.services.mozilla.com/D145535
2022-05-06 17:16:30 +00:00
Nicolas Chevobbe 55d79ae066 Bug 1668219 - [devtools] Remove unused devtools/client/shared/demangle.js. r=bomsy.
It was only used in the old perf panel.

Differential Revision: https://phabricator.services.mozilla.com/D145534
2022-05-06 17:16:30 +00:00
Nicolas Chevobbe 000b84abfd Bug 1668219 - [devtools] Remove now unused devtools/shared/performance folder. r=julienw.
Differential Revision: https://phabricator.services.mozilla.com/D145466
2022-05-06 17:16:29 +00:00
Nicolas Chevobbe 073b56709e Bug 1668219 - [devtools] Remove now unused performance-recording actor and front. r=julienw,devtools-backward-compat-reviewers.
Remove files that were only used by this actor as well.

Differential Revision: https://phabricator.services.mozilla.com/D145464
2022-05-06 17:16:29 +00:00
Nicolas Chevobbe eab2a86cbe Bug 1668219 - [devtools] Remove now unused performance actor and front. r=julienw,devtools-backward-compat-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D145463
2022-05-06 17:16:28 +00:00
Nicolas Chevobbe b5a99726eb Bug 1668219 - [devtools] Remove widgets only used on old perf panel. r=bomsy.
This removes FlameGraph.js, Graphs.js, GraphsWorker.js, LineGraphWidget.js, MountainGraphWidget.js
and their related tests.
DevToolsWorker tests that were relying on GraphsWorker.js are updated to use a test-specific blob worker.

Differential Revision: https://phabricator.services.mozilla.com/D145462
2022-05-06 17:16:27 +00:00
Nicolas Chevobbe 30db855c84 Bug 1668219 - [devtools] Remove devtools/client/performance. r=julienw.
Differential Revision: https://phabricator.services.mozilla.com/D145461
2022-05-06 17:16:27 +00:00
Nicolas Chevobbe e1f5f32c3a Bug 1668219 - [devtools] Remove isNewPerfPanelEnabled target configuration. r=bomsy,devtools-backward-compat-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D145460
2022-05-06 17:16:26 +00:00
Nicolas Chevobbe faee16015f Bug 1668219 - [devtools] Remove devtools.performance.new-panel-enabled preference. r=julienw.
Remove occurences of the pref (except in devtools/client/performance, which
will be removed further in the stack).

Differential Revision: https://phabricator.services.mozilla.com/D145459
2022-05-06 17:16:26 +00:00
Nicolas Chevobbe f7ae125a11 Bug 1668219 - [devtools] Remove new perf panel setting in DevTools Settings panel. r=julienw.
Differential Revision: https://phabricator.services.mozilla.com/D145458
2022-05-06 17:16:26 +00:00
Greg Tatum c8a4b709d5 Bug 1767537 - Update pseudolocalization docs; r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D145374
2022-05-05 16:25:32 +00:00
Nicolas Chevobbe ab57d9eaba Bug 1576907 - [devtools] Don't add expressions from private window console in history. r=bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D145200
2022-05-04 12:27:05 +00:00
Nicolas Chevobbe fea6e021bf Bug 1766975 - [devtools] Add keyboard shortcut to focus StyleEditor filter input. r=jdescottes.
We using Ctrl|Cmd+P as Ctrl|Cmd+F is used for a in-file search in
the CodeMirror instance.
We're tesing the keyboard shortcut in browser_style_editor_filter.js
by using it instead of manually calling input.focus and clearing it
programatically.

Differential Revision: https://phabricator.services.mozilla.com/D145057
2022-05-04 06:01:31 +00:00
Nicolas Chevobbe 0f4a927bab Bug 1766603 - [devtools] Lazy load modules in StyleEditor. r=bomsy.
Those modules are only needed on specific user actions, so we might save a few
cycles not loading them upfront.

Differential Revision: https://phabricator.services.mozilla.com/D144796
2022-05-04 06:01:31 +00:00
Nicolas Chevobbe 267bff5ff9 Bug 1766811 - [devtools] Remove StyleEditor list item animation. r=jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D144930
2022-05-04 06:01:31 +00:00
Nicolas Chevobbe c02657bc0c Bug 1470781 - [devtools] Make check in browser_styleeditor_private_perwindowpb.js more specific. r=jdescottes.
For some reason, the new test added in the previous patch has an impact on this test:
when checking the disk cache, there's a `mochi.test:8888/tests.json` entry, and
since the test was only checking if there was an entry with the `mochi.test:8888` entry,
it was failing.
I wasn't able to understand why we have this entry in the cache, but it reveals
that the test check is a bit too broad, since what we cares about is simply to
know if the fetched stylesheet was added in the disk cache.
So here we're doing just that, checking that the fetched stylesheet wasn't added
to the disk cache.

Depends on D144723

Differential Revision: https://phabricator.services.mozilla.com/D145344
2022-05-04 06:01:30 +00:00
Nicolas Chevobbe 677b15d13b Bug 1470781 - [devtools] Add filter input for stylesheets list. r=jdescottes,fluent-reviewers.
The patch adds a filter input in the xhtml file, which will filter the list
of stylesheets displayed on the left side, based on the stylesheet name.
If the active stylesheet is filtered-out, the first visible one gets selected.
If all the stylesheet are filtered-out, a label is displayed indicating that
the search doesn't match any stylesheet.

The splitview CSS already had rules for this behaviour, so we're reusing what's
already there, re-adding the placeholder for the "all filtered" message.

This had an impact on keyboard navigation; the list is sorted by `ordinal` property,
which drives a `MozBoxOrdinalGroup` style property (similar to `order` on a flex item).
The navigation used to simply get the active ordinal, and move to the next one.
Now, the "next" ordinal could be hidden, so we change the behavior to move the focus
to the next (or previous), visible item in the list.

A test is added to check that everything works as intended.

Differential Revision: https://phabricator.services.mozilla.com/D144723
2022-05-04 06:01:30 +00:00
Doug Thayer 04d1c8fd1e Bug 1756823 - Replace ConsoleAPIStorage observer calls with js array r=nchevobbe,webdriver-reviewers,geckoview-reviewers,agi,jdescottes
See the comment in the file explaining it. For a case of logging 100k numbers,
this dropped the time per number from 15 microseconds to 9 with the console
closed, and 55 microseconds to 38 with the console open. I think we could shave
off more with a native approach, but I don't know that it's worth it and it's
much more likely for that to introduce bugs.

Differential Revision: https://phabricator.services.mozilla.com/D143782
2022-05-03 17:21:59 +00:00
Tooru Fujisawa 8c9eb71d74 Bug 1765167 - Part 2: Stop using Cu.import in devtools/. r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D144095
2022-05-03 06:32:29 +00:00
Tooru Fujisawa 8412ce7da9 Bug 1766984 - Do not remove 3rd and remaining parameters when falling back to log from console.table. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D145138
2022-05-02 11:45:18 +00:00
Feng Yu 2b6e661c17 Bug 1554887 - [devtools] Remove eslint-disable complexity in devtools/client/shared/components/Frame.js. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D144802
2022-05-02 11:42:03 +00:00
criss 31c0885034 Backed out 3 changesets (bug 1766603, bug 1470781, bug 1766811) for causing devtools failures. CLOSED TREE
Backed out changeset 9a28a5613dbd (bug 1766811)
Backed out changeset d1fd983ac8ae (bug 1766603)
Backed out changeset f52a98377722 (bug 1470781)
2022-05-02 09:44:15 +03:00
Nicolas Chevobbe 2034ad0073 Bug 1766811 - [devtools] Remove StyleEditor list item animation. r=jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D144930
2022-05-02 05:44:20 +00:00
Nicolas Chevobbe 5f5ea908d8 Bug 1766603 - [devtools] Lazy load modules in StyleEditor. r=bomsy.
Those modules are only needed on specific user actions, so we might save a few
cycles not loading them upfront.

Differential Revision: https://phabricator.services.mozilla.com/D144796
2022-05-02 05:44:20 +00:00
Nicolas Chevobbe ca25b31905 Bug 1470781 - [devtools] Add filter input for stylesheets list. r=jdescottes,fluent-reviewers.
The patch adds a filter input in the xhtml file, which will filter the list
of stylesheets displayed on the left side, based on the stylesheet name.
If the active stylesheet is filtered-out, the first visible one gets selected.
If all the stylesheet are filtered-out, a label is displayed indicating that
the search doesn't match any stylesheet.

The splitview CSS already had rules for this behaviour, so we're reusing what's
already there, re-adding the placeholder for the "all filtered" message.

This had an impact on keyboard navigation; the list is sorted by `ordinal` property,
which drives a `MozBoxOrdinalGroup` style property (similar to `order` on a flex item).
The navigation used to simply get the active ordinal, and move to the next one.
Now, the "next" ordinal could be hidden, so we change the behavior to move the focus
to the next (or previous), visible item in the list.

A test is added to check that everything works as intended.

Differential Revision: https://phabricator.services.mozilla.com/D144723
2022-05-02 05:44:19 +00:00
Nicolas Chevobbe 8be10dc59d Bug 1766630 - [devtools] Update MDN compat data (2022 April). r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D144810
2022-04-29 14:50:56 +00:00