Commit Graph

21907 Commits

Author SHA1 Message Date
Julian Descottes
3ad6fe2ca8 Bug 1676974 - [devtools] Remove unused protocol/utils.js method() helper r=ochameau
Current implementation
```lang=javascript
exports.method = function(fn, spec = {}) {
  fn._methodSpec = Object.freeze(spec);
  if (spec.request) {
    Object.freeze(spec.request);
  }
  if (spec.response) {
    Object.freeze(spec.response);
  }
  return fn;
};
```
https://searchfox.org/mozilla-central/rev/5a1a34953a26117f3be1a00db20c8bbdc03273d6/devtools/shared/protocol/utils.js#70-79

The helper method() in protocol/utils.js is only called from two methods:
- actorBridge (never used in the codebase)
- actorBridgeWithSpec (used by a few actors)

actorBridgeWithSpec doesn't pass the second argument, so in practice, this method could be reduced to:
```lang=javascript
exports.method = function(fn) {
  fn._methodSpec = Object.freeze({});
  return fn;
};
```

`_methodSpec` is only mentioned in one other spot: https://searchfox.org/mozilla-central/rev/5a1a34953a26117f3be1a00db20c8bbdc03273d6/devtools/shared/protocol/Actor/generateActorSpec.js#27-40

But based on our coverage tooling, we never actually have a `_methodSpec` when we run this code: https://coverage.moz.tools/#view=file&revision=latest&path=devtools/shared/protocol/Actor/generateActorSpec.js

To hit it, we would have to call `generateActorSpec` directly with an actor where we used `actorBridgeWithSpec`. But we never do that, we only use it with plain JS objects in the devtools/shared/specs folder.

Consequently, this helper can be removed.

Differential Revision: https://phabricator.services.mozilla.com/D96935
2020-11-13 09:49:53 +00:00
Bogdan Tara
3667467db8 Backed out 10 changesets (bug 1662254) for lint failure on generate_static_pref_list.py CLOSED TREE
Backed out changeset 972e63387191 (bug 1662254)
Backed out changeset 3a9d6f0aa380 (bug 1662254)
Backed out changeset 4b3ffe7fe1af (bug 1662254)
Backed out changeset 4834b1025611 (bug 1662254)
Backed out changeset ec1f7afe8a2d (bug 1662254)
Backed out changeset c7a6b927b1de (bug 1662254)
Backed out changeset 2427d85b2605 (bug 1662254)
Backed out changeset 979bf4ac97bb (bug 1662254)
Backed out changeset 3e443333c636 (bug 1662254)
Backed out changeset a5261578ebfc (bug 1662254)
2020-11-12 23:59:07 +02:00
Steve Fink
9ab0a6a530 Bug 1662254 - Rename CC_WAITING -> CC_FINISHED r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D94792
2020-11-12 19:05:32 +00:00
Julian Descottes
2a85b4f393 Bug 1650963 - [devtools] Set non-fission flag when opening DevTools window from a non-fission host tab r=Honza
We cannot use swapFrameLoaders between a fission and a non fission window. We should make sure to open non-fission windows if the current host is not a fission one.

Differential Revision: https://phabricator.services.mozilla.com/D96696
2020-11-12 15:18:43 +00:00
Cody Welsh
049cc3d149 Bug 1673932 - [devtools] - Combine register calls in highlighters. r=jdescottes
Combine the calls to the highlighter `register()` function in a loop.
One of several possible solutions here.

Differential Revision: https://phabricator.services.mozilla.com/D96302
2020-11-12 08:38:59 +00:00
Cody Welsh
efbcf065d3 Bug 1673932 - [devtools] - Use absolute paths in highlighters register helper. r=jdescottes
Change the logic in the devtools/server/actors/highlighters.js file to
use absolute paths instead of constructing them from an internal helper
function. Also modify the calls to `register` at the bottom of the file
according to this change.

Differential Revision: https://phabricator.services.mozilla.com/D96301
2020-11-10 10:12:53 +00:00
Tim Huang
7ec26df273 Bug 1641270 - Part 6: Pass CookieJarSettings to nsIWebBrowserPersist.saveURI() and nsIWebBrowserPersist.savePrivacyAwareURI(). r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D95616
2020-11-11 18:19:27 +00:00
Andreea Pavel
51f16bb9d2 Backed out changeset 62af829812bd (bug 1662736) for permafailing bug 1676641 and bug 1655183 on a CLOSED TREE 2020-11-11 19:53:14 +02:00
Hubert Boma Manilla
d4cec11d5a Bug 1662736 - [devtools] Simplify the network request payload r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D94457
2020-11-11 10:51:28 +00:00
Julian Descottes
2e535d26d6 Bug 1669666 - [devtools] Ignore custom pageshow/pagehide events in BrowsingContextTargetActor r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D96605
2020-11-11 09:51:11 +00:00
Dan Minor
57441aa8cc Bug 1673054 - Migrate uses of intl.uidirection to intl.l10n.pseudo; r=Gijs,zbraniecki
This also removes pref overrides from methods like LocaleService::IsLocaleRTL or
IntlService.getLocaleInfo, because it doesn't really make sense to override the
result of checking an arbitrary locale, the relevant use case is overriding the
result for the current app locale.

Removal of the intl.uidirection pref completely will be done in a separate bug.

Differential Revision: https://phabricator.services.mozilla.com/D96235
2020-11-09 15:33:39 +00:00
Kris Maglione
cfebcd3fd2 Bug 1669961: Return null from .contentWindow when inner window is inactive. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D93853
2020-11-10 20:35:04 +00:00
Kris Maglione
7ae9faa46f Bug 1651774: Update mozilla/use-services rule for native Services implementation. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D93858
2020-11-06 18:58:33 +00:00
Nicolas Chevobbe
6abc8ae401 Bug 1634208 - [devtools] Fix browser_jsterm_screenshot_command_warnings intermittent. r=ladybenko.
It looks like the test was hitting the timeout limit on slow hardware (e.g. on
linux ccov on TRY).
Requesting a longer timeout seems to fix the failure.

Differential Revision: https://phabricator.services.mozilla.com/D96405
2020-11-10 16:07:32 +00:00
Steven MacLeod
971103bdd5 Bug 1606061 - move TouchEventsOverride to BrowsingContext. r=farre,devtools-backward-compat-reviewers
This change removes docshell's `mTouchEventsOverride` and replaces it
with a new `BrowsingContext` field `TouchEventsOverrideInternal`.
All uses of the old field have been replaced and an override should
now work under fission when there are cross-origin descendent frames.

Differential Revision: https://phabricator.services.mozilla.com/D96414
2020-11-10 15:57:30 +00:00
Nicolas Chevobbe
56c8e9380a Bug 1667778 - [devtools] Remove mentions of launchpad in debugger. r=jdescottes.
This removes the few mentions of the launchpad that were
still existing in the debugger codebase.
We take this as an opportunity to use the #mount element
as the root of the React app (instead of creating a new
div for it).

Depends on D96384

Differential Revision: https://phabricator.services.mozilla.com/D96513
2020-11-10 13:05:24 +00:00
Nicolas Chevobbe
514b0ddad4 Bug 1675769 - [devtools] Move devtools-environment function into debugger/src. r=bomsy.
This moves the `isNode` and `isNodeTest` functions to the debugger/src/utils folder,
updates the callsites to those functions, generates the bundles, and finally,
removes the devtools-environment folder, as well as all mentions of it.

Differential Revision: https://phabricator.services.mozilla.com/D96384
2020-11-10 15:18:32 +00:00
Nicolas Chevobbe
6e6be10526 Bug 1675769 - [devtools] Remove usage of devtools-environment isTesting. r=bomsy.
When possible, we switch to the plain devtools/shared/flags module.
In some cases, the check was only done for jest test, so we use
isNodeTest instead.

Differential Revision: https://phabricator.services.mozilla.com/D96382
2020-11-10 15:14:07 +00:00
Nicolas Chevobbe
9725148bcb Bug 1675769 - [devtools] Clean-up devtools-environment usage. r=bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D96381
2020-11-10 15:07:57 +00:00
smolnar
ec58e559fc Backed out changeset 1780d41127e8 (bug 1662736) for causing devtools failure. CLOSED TREE 2020-11-10 15:07:27 +02:00
Andrey Bienkowski
e5944c6972 Bug 1674841 - [devtools] Clean up devtools/shared/protocol/tests/xpcshell/test_protocol_async.js r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D95553
2020-11-10 12:55:29 +00:00
Nicolas Chevobbe
858da426e6 Bug 1674400 - [devtools] Update pretty-fast to 0.2.4. r=bomsy.
This updates the pretty-fast module to bring the commits
that were done there the 3 last years (date of the last
version being published).

Differential Revision: https://phabricator.services.mozilla.com/D96176
2020-11-10 12:15:13 +00:00
Hubert Boma Manilla
5c91d1f55c Bug 1662736 - [devtools] Simplify the network request payload r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D94457
2020-11-10 12:44:23 +00:00
Yura Zenevich
21c81dd7e6 Bug 1675539 - add telemetry for tabbing order overlay activation. r=jdescottes,janerik
Differential Revision: https://phabricator.services.mozilla.com/D96091
2020-11-09 16:19:20 +00:00
Alexandre Poirot
efdfcfb399 Bug 1672826 - [devtools] Unmanage fronts when we purge a whole prefix. r=nchevobbe
Previous `purgeRequestForDestroy` method was only rejecting all pending requests.
The new `syncFrontDestroy` allows to fully destroy the front, including
unregistering it/unmanage it. So that if we receive a packet from a brand new
actor, with the same prefix and actor ID, DevToolsClient.getFront doesn't return
the old destroyed front.
This issue was making pending requests that were never resolved.

Differential Revision: https://phabricator.services.mozilla.com/D94718
2020-11-09 12:29:53 +00:00
Alexandre Poirot
8e2267f855 Bug 1672826 - [devtools] Close ChildDebuggerTransport in the parent process when we destroy content process targets. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D94485
2020-11-09 12:26:41 +00:00
Andrey Bienkowski
e86e7489c7 Bug 1674425 - [devtools] Remove defer usage in server/tests/browser/browser_perf-realtime-markers.js r=Honza
Differential Revision: https://phabricator.services.mozilla.com/D95337
2020-11-09 11:42:38 +00:00
Fabien CASTERS
a2ece0090c Bug 1664766 - [devtools] Remove defer usage in devtools\client\shared\test\test-actor.js. r=Honza
Differential Revision: https://phabricator.services.mozilla.com/D94966
2020-11-09 11:36:51 +00:00
Andrey Bienkowski
9a314848ae Bug 1673934 - [devtools] Remove defer usage in client/debugger/src/actions/tests/preview.spec.js r=Honza
Differential Revision: https://phabricator.services.mozilla.com/D95858
2020-11-09 11:31:42 +00:00
Ben Delevingne
6df2de2623 Bug 1674136 - [devtools] Remove defer usage in devtools/client/shared/test/shared-redux-head.js. r=Honza
Differential Revision: https://phabricator.services.mozilla.com/D95152
2020-11-09 10:21:26 +00:00
Nicolas Chevobbe
3da665e7b3 Bug 1674115 - [devtools] Fix crash caused by calling WorkerDebugger.setDebuggerReady. r=ochameau.
We were trying to resume the worker debugger in case we
couldn't connect to the worker. Since connectToWorker can
reject when the worker is closed, we might try to resume a
closed worker, which could cause a crash.
In this patch, we simply check if the worker debugger isn't closed
before resuming it.

Differential Revision: https://phabricator.services.mozilla.com/D95990
2020-11-09 10:03:41 +00:00
Nicolas Chevobbe
a76f5a8519 Bug 1675497 - [devtools] Remove unused duplicated object-inspector folder. r=bomsy.
Something probably went wrong in Bug 1671163 and we ended up
with this duplicated, unused folder.

Differential Revision: https://phabricator.services.mozilla.com/D96027
2020-11-09 09:57:12 +00:00
Nicolas Chevobbe
220bf52237 Bug 1675450 - [devtools] Remove unused ObjectActor.definitionSite. r=ochameau,devtools-backward-compat-reviewers.
The function wasn't used, except in a test that this patch removes.
Since it was also the only use of the getSourcesManager hook, we're able to
remove it as well.

Differential Revision: https://phabricator.services.mozilla.com/D95989
2020-11-09 09:50:26 +00:00
Alexandre Poirot
48133a28a8 Bug 1673627 - [devtools] Force showing iframe content instead of inline content for remote frames. r=jdescottes
For some reason we return an inlineTextChild when the iframe is remote, so only with fission turned on.
When the iframe isn't remote, WalkerFront.inlineTextChild returns undefined.

Differential Revision: https://phabricator.services.mozilla.com/D95868
2020-11-09 08:43:28 +00:00
Nick Alexander
b143efdd25 Bug 1675332 - Make --headless --jsdebugger launch a headed Browser Toolbox. r=emalysz
Before this commit, the `MOZ_HEADLESS` environment variable was set by
the `--headless` process and inherited by the launched Browser Toolbox
process, hiding the debugger UI.  This commit allows to launch the JS
debugger when running under `--headless` by explicitly removing the
`MOZ_HEADLESS` variable from the environment.  To do this, a small
tweak to `Subprocess.jsm` is used that allows `null` to signal
"removal", distinct from `undefined` for "ignored".

While here I prefixed the output from the launched Browser Toolbox
process, which helps visually distinguish warnings, etc; and I also
corrected a typo that I stumbled across.

Differential Revision: https://phabricator.services.mozilla.com/D95897
2020-11-06 04:53:24 +00:00
Belén Albeza
a6367adcc2 Bug 1673821 - [devtools] Fix error when closing storage panel r=jdescottes
Introduce a guard in the actor's destructor, so it does not fail if called more than once.

Differential Revision: https://phabricator.services.mozilla.com/D96068
2020-11-06 14:12:55 +00:00
Neil Deakin
c5eff66205 Bug 1649843, remove now unused legacy actor code, r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D95206
2020-11-06 15:46:11 +00:00
Nicolas Chevobbe
90fc707966 Bug 1673368 - [devtools] Remove unnecessary parts of debugger's webpack config. r=jdescottes
I inlined the two existing functions that were modifying the base config directly
back into the base webpack config, and then removed everything that wasn't hit
or used by the bundling script.
Thanks to this work, we're able to remove a few files that were previously only
used in Launchpad, or that are simple enough to be inlined into the webpack config.

Since postcss wasn't used, we can also remove the postcss.config.js file, as
well as some libraries from package.json.

Differential Revision: https://phabricator.services.mozilla.com/D96018
2020-11-06 14:49:16 +00:00
Nicolas Chevobbe
e783099865 Bug 1673368 - [devtools] Remove dependency on devtools-launchpad in webpack config. jdescottes. r=jdescottes
This patch is simply inlining what was in devtools-launchpad directly into the
debugger's webpack config.
In order for the bundling script to still work, we had to add the dependencies
that were used in devtools-launchpad.
For some reason, this shifted a lot of modules in the generated files (but files
have the same size before and after, so I guess nothing changed).

Next patch in the serie will cleanup this webpack config.

Differential Revision: https://phabricator.services.mozilla.com/D96017
2020-11-06 14:29:44 +00:00
Julian Descottes
d6d8ea296d Bug 1654763 - [devtools] Remove implementation, tests and documentation for actorHasMethod r=rcaliman,ochameau,devtools-backward-compat-reviewers
actorhasMethod had several technical limitations making it hard to use consistently. We now removed all the call sites for this method. This changeset removes the method and all its dependencies.

Differential Revision: https://phabricator.services.mozilla.com/D95861
2020-11-06 13:50:52 +00:00
Julian Descottes
7f05d92a6e Bug 1673605 - [devtools] Remove unused css variables from perf.css r=julienw
Depends on D94747

Differential Revision: https://phabricator.services.mozilla.com/D94828
2020-10-27 17:44:14 +00:00
Nicolas Chevobbe
2e2dfdc264 Bug 1673641 - [devtools] Fix browser_browser_toolbox_evaluation_context.js failure on beta simulation. r=ladybenko.
The test was failing on Beta because we weren't setting the devtools.webconsole.input.context
pref, which is true only on Nightly.
This patch flip this pref in the test, which seems to make the test pass.

Differential Revision: https://phabricator.services.mozilla.com/D96061
2020-11-05 17:04:10 +00:00
Andrew Halberstadt
331bc892dd Bug 1675319 - [manifestparser] Properly support multiline skip-if statements, r=jmaher,extension-reviewers,zombie
This supports one manifestparser expression per line in the 'skip-if',
'fail-if' and 'run-if' keys. As a side effect the:

    skip-if = foo ||
        bar

syntax is no longer supported. Instead it can be:

    skip-if =
        foo  # bug 123
        bar  # bug 456

Differential Revision: https://phabricator.services.mozilla.com/D95927
2020-11-05 19:55:08 +00:00
Razvan Caliman
ac7cf1d57c Bug 1675226 - [devtools] Remove leftover specific box model highlighter events r=jdescottes
Use the generic "highlighter-shown" / "highlighter-hidden" events and check for highlighter type.
Use generic helpers in tests.
Fix an unrelated leftover nit from D92802

Differential Revision: https://phabricator.services.mozilla.com/D95835
2020-11-05 14:43:46 +00:00
Oriol Brufau
d2199d3928 Bug 1674590 - Show reason of rejected promise in console, and allow it to be inspected. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D95450
2020-11-05 14:28:01 +00:00
Nerixyz
60cff423b5 Bug 1674577: Show icon corresponding to the source file if it's inside of an extension. r=jdescottes,bomsy
Differential Revision: https://phabricator.services.mozilla.com/D95446
2020-11-05 09:54:42 +00:00
Nicolas Chevobbe
4bad3995de Bug 1592584 - [devtools] Accept worker targets in console. r=ochameau.
The `dom.worker.console.dispatch_events_to_main_thread` pref is used by platform
code to check if console API messages in the worker thread should be dispatched
to the main thread. If so, the message parameters are cloned, or stringified if
they can't be. This is currently the default behavior.

The pref is checked on the server side and added as a trait to the root actor.
On the client, if the pref isn't true, then we accept messages coming from
worker targets in the console. We can't accept them without condition, otherwise
we would get duplicated message (from the main thread AND the worker thread).

The browser_webconsole_console_logging_workers_api.js test is repurposed for
worker logging since it was disabled on e10s anyway. We add a few test case
to check we can get cached and live message, and that non-clonable object, like
worker scope, are displayed like regular objects when the pref is false.

Differential Revision: https://phabricator.services.mozilla.com/D85397
2020-11-05 10:17:36 +00:00
Nicolas Chevobbe
4269e69069 Bug 1674417 - [devtools] Rename SourcesManager instances. r=ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D95333
2020-11-05 08:54:54 +00:00
Eitan Isaacson
f42d5e8b3d Bug 1672694 - P1: Query layout for selectable text state. r=morgan,Jamie,yzen
The SELECTABLE_TEXT state is currently under-utilized and probably wrong, since it simply relies on testing if a hypertext has any text. A more correct reflection of the state should be taken from layout's IsSelectable method.

Note, even if an element is styled `user-select: none`, the text will still be keyboard selectable if it is editable (eg. input or contenteditable), so we should consider that SELECTABLE_TEXT.

Differential Revision: https://phabricator.services.mozilla.com/D95783
2020-11-04 19:56:55 +00:00
Julian Descottes
d8f70bb25f Bug 1675020 - [devtools] Disable frequent intermittents / permafail DevTools tests on Fission platforms r=Honza
Temporarily add skip-if=fission in order to move devtools tests on Fission platforms to Tier1

Differential Revision: https://phabricator.services.mozilla.com/D95746
2020-11-04 18:39:57 +00:00