gecko-dev/devtools/client/styleeditor
Julian Descottes 982c525960 Bug 1694140 - [devtools] Stop using TargetFactory forTab in devtools browser mochitests r=nchevobbe
Depends on D105999

This patch is mostly a mechanical rewrite of:
```lang=javascript
const target = await TargetFactory.forTab(tab);
const toolbox = await gDevTools.showToolbox(target, "inspector");
```
to
```lang=javascript
const toolbox = await gDevTools.showToolboxForTab(tab, { toolId: "inspector" });
```

The main changes are:
- if the target was actually used in the test, it is now retrieved from toolbox.target
- the arguments for showToolboxForTab are using an option argument, to avoid the occasional showToolbox("inspector", null, null, null, startTime, null, reason);

I suspect that any signature rewrite mistake would have been caught on try.
There a few less mechanical changes:
- devtools/client/framework/test/browser_toolbox_screenshot_tool.js the toolId "console" was omitted because this id doesn't match any tool (author probably meant "webconsole")
- a few tests were: 1/ first creating a target, 2/ looping on tool definitions to get supported tools 3/ opening the toolbox with each supported tool. To support this I extracted a helper called `getSupportedToolIds` which opens a temporary toolbox to list all supported tool ids
- all the tests under storage/ use a single helper to start the test, which can open toolboxes for both tab targets and other targets. This made it more complicated to refactor. We could also drop this part and just refactor each test when we actually modify forTab/showToolbox to only work with descriptors

All in all the goal of this stack is to pave the way to stop handling targets when using forTab/showToolbox, and behind the scenes stop replying on targets to cache open toolboxes. We don't aim to kill all the call sites, just get them to a smaller number so that the next refactors will be easier.

Differential Revision: https://phabricator.services.mozilla.com/D106000
2021-02-25 12:58:14 +00:00
..
test Bug 1694140 - [devtools] Stop using TargetFactory forTab in devtools browser mochitests r=nchevobbe 2021-02-25 12:58:14 +00:00
index.xhtml Bug 1691314 - Use DOM hidden property instead of attribute methods in devtools/client. r=nchevobbe 2021-02-09 17:32:07 +00:00
moz.build Bug 1654103: Standardize on Black for Python code in mozilla-central. 2020-10-26 18:34:53 +00:00
original-source.js Bug 1644193: Implement basic server-side stylesheets watcher. r=ochameau 2020-09-14 21:29:47 +00:00
panel.js Bug 1643180 - Part 5: Centralize viewSourceInStyleEditor's actor ID and sourcemap processing. r=jlast 2020-06-05 22:19:46 +00:00
StyleEditorUI.jsm Bug 1692874 - [devtools] Read isLocalTab from descriptor instead of target front. r=rpl,jdescottes 2021-02-18 18:36:48 +00:00
StyleEditorUtil.jsm
StyleSheetEditor.jsm Bug 1679043 - [devtools] Fix race condition in StyleEditor when editing style sheet. r=daisuke,ochameau,devtools-backward-compat-reviewers,bomsy. 2020-12-18 06:07:32 +00:00