Commit Graph
364 Commits
Author SHA1 Message Date
Tim van der Lippe d0ed351152 Update TypeScript to 3.9.2
DISABLE_THIRD_PARTY_CHECK=TypeScript update
R=jacktfranklin@chromium.org

Bug: 1011811
Change-Id: I14c8201cf46b78b73afdc4cd7d68c8c87a2cf697
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2199124
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-05-14 10:14:34 +00:00
Yang Guo b8584478dd More specific OWNERS where appropriate
DISABLE_THIRD_PARTY_CHECK=no code change

Change-Id: I02f6ae91f7412c287ecf931e5681c1c882faa26c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2198956
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
Reviewed-by: Shane Clifford <shanejc@microsoft.com>
Reviewed-by: Leo Lee <leolee@microsoft.com>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2020-05-14 06:52:14 +00:00
Alex Rudenko 7bf4d03c58 Move overlay implementation to DevTools
This CL moves the implementation of inspect_tool_highlight.html to
DevTools, sets up a separate resource build target containing code
bundles produced by rollup. Also, it adds size checks and sets up
an example test. The future CLs will cover the rest of inspector tools
and better tests. A follow-up CL for Chromium to use the newly generated
resource is prepared[1].

[1] https://crrev.com/c/2194865

Bug: 1078267
Change-Id: I1c66e3c2aaec04c2f07fab8623d674ada95d8b24
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2192892
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
2020-05-14 06:05:14 +00:00
Jan Scheffler 68eefdc2c5 Enable TypeScript for PaintProfiler and add Protocol.binary to closure
Bug: chromium:1011811, chromium:1079233
Change-Id: If8f39e531002411524d3ee4ce6b94ca8843dbdc3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2196384
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Auto-Submit: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-13 10:24:21 +00:00
Tim van der Lippe 4833536c81 Fix return type for "void" CDP methods
Even though some CDP methods are typed as void, they can still
error and therefore `getError()` would return the error.

R=sigurds@chromium.org

Fixed: 1081724
Bug: 1011811
Change-Id: Id7b2712808745c30756e3ebb532a8d6ef38003a9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2196388
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-05-12 15:49:24 +00:00
Tim van der Lippe d1c8d6c721 Fix protocol dispatcher type generation
The dispatchers must be separate types, as they are implemented
in the SDK models. These models can't implement the *Api interface,
as these are auto-generated in the InspectorBackend.

A follow-up CL will change the Closure type generator to also
understand the new ProtocolProxyApi dispatcher interfaces, to
unblock further typescriptification of the SDK models.

R=jacktfranklin@chromium.org
CC=janscheffler@chromium.org,sigurds@chromium.org

Bug: 1081686, 1011811
Change-Id: Id193def28c426bdce17b9f72c65ccba21efd474e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2196386
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-05-12 15:10:34 +00:00
Yang Guo 08d6811df4 Use curl as fallback for downloading Chromium
R=tvanderlippe@chromium.org

Change-Id: Id6a26dca86dd33a9029630c788e78ab7e3a49514
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2194869
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-12 10:27:03 +00:00
Tim van der Lippe c606bf358e Fix invalid cross-namespace star import
Discovered in https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2193588/1/front_end/sdk/CSSMedia.js#5

R=jacktfranklin@chromium.org

Change-Id: I9a34975891256d40ca0df59647cc3a48df9d1caf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2193954
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-05-11 16:17:30 +00:00
Tim van der Lippe 03fe3e7b0f Fix ESLint rule for full relative URL
Discovered in https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2193578/1/front_end/sdk/CSSProperty.js#5

R=jacktfranklin@chromium.org

Change-Id: I40225afb5b6018dc99f1d0d7af53ee9016c86e66
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2193953
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-05-11 15:52:50 +00:00
Tim van der Lippe e8c1000fcd Update karma-mocha
Required for https://npmjs.com/advisories/1179

The breaking change in 2.0.0 is to drop Node 8 [1], which we don't use.

[1]: https://github.com/karma-runner/karma-mocha/releases/tag/v2.0.0

DISABLE_THIRD_PARTY_CHECK=NPM update
R=jacktfranklin@chromium.org

Change-Id: If4aa30d0db598fbd27e0d194271391f3b840dabd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2193576
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-05-11 15:05:14 +00:00
Tim van der Lippe 00174b46b7 Update yargs
Required for https://npmjs.com/advisories/1500

DISABLE_THIRD_PARTY_CHECK=NPM update
R=jacktfranklin@chromium.org

Change-Id: Ia051eb5fd1bda221ec58806e9218a99d77c19197
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2193575
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-11 12:51:20 +00:00
Tim van der Lippe c61473dabc Remove karma-typescript
We now use the Karma + Ninja setup and therefore we can remove the
karma-typescript package which is now unused.

R=jacktfranklin@chromium.org
DISABLE_THIRD_PARTY_CHECK=Npm update

Bug: 1061125
Change-Id: Idf9e4f3247f5db271a7b8a43f932bec5a8d099d2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2192896
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-05-11 09:43:59 +00:00
Tim van der Lippe 40875028ce Update Puppeteer to v3.0.3
DISABLE_THIRD_PARTY_CHECK=update Puppeteer

Also-By: tvanderlippe@chromium.org
Change-Id: I4ddb6a2b426bcde95f9b764790e88b560441225c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2187209
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-05-07 11:21:08 +00:00
Jack Franklin 0212512c42 Minor bug fixes to component bridges generator
* Support string|undefined function return types.
* Add trailing commas to the type definitions.

Change-Id: Ib3379b647ee5ceb404a7c941a850dbce44f2f656
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2183918
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-06 12:08:42 +00:00
Tim van der Lippe 1066bfdb3e Port cm_web_modes files to third_party/codemirror usages
This removes the cm_web_modes folder, as we now import from third_party
instead. We still double include the css.js and htmlmixed.js in the
formatter_worker and text_editor, but sadly we can't remove that until
the module.json files are removed.

roll CodeMirror

R=mathias@chromium.org

Bug: 1076825
Change-Id: I7b5a15bcc9db51b4a38be7db3d2da97aa9deb0f6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2179362
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-06 11:47:22 +00:00
Jack Franklin 8cfa168b01 Support object literals with interfaces in component bridges
This change updates the component bridge generation code to understand
object literals and interfaces within them, e.g:

```
set data(data: {x: MyInterface, y: SomeInterface | null})
```

The bridges code understands how to generate the correct `@param`
documentation for that setter, and is able to parse through the object
to find the use of the two interfaces to know that they are interfaces
we need to convert and output in Closure land.

Change-Id: I637309c73721b6a57cd5d06f09600d16bfd207aa
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2183912
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-06 10:56:42 +00:00
Tim van der Lippe 4b1e8293fd Use Acorn distribution in formatter_worker
R=aerotwist@chromium.org

Bug: 1011811
Change-Id: I564fd56105eb6c1ae484f556febc409796701f57
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2181217
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-06 10:14:52 +00:00
Jack Franklin 66f5c8bf96 Support getters and setters in component bridges generation
For our components we will use getters and setters to get/set properties
and re-render accordingly. The initial bridges generation work wasn't
built to support get/set methods so this CL adds them.

Change-Id: I1ea55bc0e0c05a8c261f612498c6b52a94d41e8f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2179907
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-05 14:11:26 +00:00
Tim van der Lippe a17f6d2107 Port cm_modes files to third_party/codemirror usages
roll CodeMirror

R=mathias@chromium.org

Bug: 1076825
Change-Id: I85c076a68770b6c4d710bca3b5d4b055ac0e78d3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2178589
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-04 13:09:51 +00:00
Tim van der Lippe 3cccb4f51b Complete typecheck of sdk/NetworkManager.js with TypeScript
What we learnt/changed:
- For invoke_* commands, allow the omission of the request object,
by adding an initializer in the generated code.

R=aerotwist@chromium.org

Bug: 1011811
Change-Id: I04ee0eec703bdcc0235bc5a4a41387af72f912a7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2173374
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-05-04 11:09:51 +00:00
Tim van der Lippe f40e0827f8 Remove checked in headlesscodemirror.js in favor of third_party source
The `headlesscodemirror.js` was actually a copy of
`addon/runmode/runmode-standalone.js`. Using the third_party source
allows to remove configuration for clang-format, ESLint and the
roll_codemirror.py files.

The cm_headless module is used in the formatter_worker. I verified that
the import is working as intended by building DevTools and formatting
a CSS file (which is one of the formatters that makes use of CodeMirror).

Then I found out that the runmode-standalone file expects `window` to
exist, which doesn't exist in workers. Therefore, locally patch that
to `globalThis.CodeMirror`.

R=mathias@chromium.org

Bug: 1011811, 1076825
Change-Id: Id8e5ed1d0ca81c3699def73a0eb63835ffc7a43f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2174418
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-05-04 10:25:16 +00:00
Jack Lynch f1f00fa32a Add VS Code shortcuts as an option
This CL adds the ability (hidden behind an experiment) for users to
select a set of shortcuts to use, the two options initially being the
default shortcuts and shortcuts that match those from VS Code. A new
`keybindSets` array is added to binding objects in module.jsons,
allowing shortcuts to be filtered on launch much like the existing
platform option. Also like platform, if the keybindSets array is
undefined for a shortcut then that shortcut will be considered common to
all keybindSets.

In general, I left keybindSets undefined for default DevTools shortcuts
that do not conflict with VS Code shortcuts so that they remain common
shortcuts. When both the DevTools and VS Code define the same shortcut,
I add both sets to keybindSets.

This should only affect users who have opted into the custom keyboard
shortcuts experiment. If a user with the experiment enabled selects VS
Code shortcuts and then turns the experiment off, ShortcutRegistry will
reset the shortcuts to the DevTools default on next launch.

Enumerating the differences between VS Code and the DevTools default
shortcuts uncovered some workflows that we'd like to add shortcuts for
that do not currently have actions in the DevTools, such as save as and
find/replace. I plan to add those in future CLs.

Due to problems with ListWidget's accessibility, I have to manually add
aria roles to the list and list items. This is a temporary state of
affairs until this tab is changed to use ListControl rather than
ListWidget for better accessibility. Since the ListWidget here contains
no editable items and is only marked as a list, there are no keyboard
navigation or focus management requirements to worry about yet.

I have put up a telemetry CL here so that we can evaluate the success of
the feature:
https://chromium-review.googlesource.com/c/chromium/src/+/2172132

Screenshots:
  https://i.imgur.com/ka0VEyM.png
  https://i.imgur.com/CG8hAro.png

Custom shortcuts design doc: https://docs.google.com/document/d/1oOPSWPxCHvMoBZ0Fw9jwFZt6gP4lrsrsl8DEAp-Hy7o/edit#

Bug: 174309
Change-Id: I0e3484eb2712c945121cc7b68e14a1a98f858bab
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2095859
Reviewed-by: John Emau <John.Emau@microsoft.com>
Reviewed-by: Songtao Xia <soxia@microsoft.com>
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
2020-05-01 23:48:06 +00:00
Philip Pfaffe a63b9e9d60 Land symbol server backend
Bug: chromium:1013513
Change-Id: I9dee892cc591081c51ed2a094dcfef63e4386c48
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2157027
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Reviewed-by: Eric Leese <leese@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
2020-04-30 17:56:46 +00:00
Sigurd Schneider ba81851dad [issues] Add IssueManager abstraction
This CL adds a central singleton that collects all issues from all
known targers. This singleton is then used by the issues view to
display issues.

This change enables correct handling of issues that arise from OOPIF
and worker sources.

Fixed: chromium:1073797
Change-Id: I75a8bb46d240f63df013c0b06506cad7fb2e5a8f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2168885
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-04-29 11:14:55 +00:00
Jack Franklin c6577bae1c Add support for Platform.UIString calls in GRDP parsing
Now UIString is defined in Platform [1] we need to update the GRDP
parsing code to look for calls to it rather than `Common.UIString`.

We still support `Common.UIString` so this CL extends the script to look
for:

1) Usage outside of Platform:

```
import * as Platform from '../platform/platform.js';

Platform.UIString.UIString('foobarbaz');
```

2) Usage inside of Platform:
```
import {UIString} from './UIString.js';

UIString('foobarbaz');
```

[1]: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165793

Change-Id: I8c0f97817709e936bdddce8f0b60d759e80fd1ba
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2170067
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2020-04-28 14:13:33 +00:00
Tim van der Lippe 96de606848 Start with typechecking sdk/NetworkManager.js
Throughout this process we learned the following:
- The magically generated agents need to be properly exposed
on the target, rather than setting them on the TargetBase prototype.
- We need to rename the protocol proxy api definitions to use
the invoke_ naming, such that we can use structured request bodies.
This will allow us to no longer rely on parameter ordering and
does not require additional changes to the underlying Closure
generated code.
- Instead of using a symbol as an index on a different class, use
a WeakMap to keep track of the link between the NetworkRequest
and the NetworkManager. This breaks the circular dependency and
allows us to remove the lookup with the symbol

R=aerotwist@chromium.org,jacktfranklin@chromium.org

Bug: 1011811
Change-Id: I6cf25533b32793636d970b0a6c108f739d4e757e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2167868
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-04-28 13:37:23 +00:00
Mathias Bynens 8555df09c4 Make scripts/deps/*.py executable
This patch makes `scripts/deps/*.py` executable so that they can be
invoked directly without the need to explicitly invoke Python.

TBR=mathias@chromium.org,changhaohan@chromium.org,alexrudenko@chromium.org

No-Presubmit: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165756
Change-Id: Ifeda6045b366a90bae5be1d43373e512e8c22197
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165796
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-04-27 14:43:36 +00:00
Tim van der Lippe fcf8179a6a Fix issues with SDK compilation
Even though we were using the SDK files in the unittests for SDK,
not all files were included. A CL which attempts to use sdk.js (e.g.
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165757)
would then fail on several generated .d.ts issues.

Issues fixed:
- Usage of `Object` instead of `Map` causing issues with a type
alias of `string`, since TypeScript object notation only allows
primitives to be used as indices.
- Missing return types for function types
- A reference to `Protocol.NetworkAgent` which does not exist on
the protocol. Instead, that is part of the protocol-proxy-api.
Therefore, we must include the declaration file in the ts_library.
This also showed that the `ProtocolApi` needs to be exported
instead of declared.

This means that for any future reference to any Protocol type
that is actually an agent, we should be using the
`ProtocolProxyApi` definitions instead. To make sure Closure
understands that type, I aliased it in the externs.

R=jacktfranklin@chromium.org
CC=​sigurds@chromium.org,szuend@chromium.org
DISABLE_THIRD_PARTY_CHECK=Typescript fixes

No-Presubmit: true
Bug: 1011811
Change-Id: I4f5a488edb2d5fa6c5ed12d33411efb5f7fb8133
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165795
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-04-27 14:22:46 +00:00
Jack Franklin 93f52244c5 Reland "Move UIString into Platform"
This is a reland of 992295e37d

Original change's description:
> Move `UIString` into `Platform`
>
> Platform is the "lowest" part of DevTools - e.g. it depends on nothing.
>
> We have code we want to move to Platform but cannot because it needs
> `ls` and therefore creates a circular dependency. So this CL moves
> UIString into Platform.
>
> To avoid rewriting a lot of imports we re-export it from `common.js`.
>
> Change-Id: I399bbe8593e043148c4c7e51f598cbd73a89f639
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165758
> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Paul Lewis <aerotwist@chromium.org>

Change-Id: I482323d1b35eb38066a571cb8630078b6cff6cde
TBR=aerotwist@chromium.org,tvanderlippe@chromium.org,jacktfranklin@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165793
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-04-27 13:59:26 +00:00
Mathias Bynens 6ac9100804 Revert "Move UIString into Platform"
This reverts commit 992295e37d.

Reason for revert: breaks tree

Original change's description:
> Move `UIString` into `Platform`
> 
> Platform is the "lowest" part of DevTools - e.g. it depends on nothing.
> 
> We have code we want to move to Platform but cannot because it needs
> `ls` and therefore creates a circular dependency. So this CL moves
> UIString into Platform.
> 
> To avoid rewriting a lot of imports we re-export it from `common.js`.
> 
> Change-Id: I399bbe8593e043148c4c7e51f598cbd73a89f639
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165758
> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Paul Lewis <aerotwist@chromium.org>

TBR=aerotwist@chromium.org,tvanderlippe@chromium.org,jacktfranklin@chromium.org

Change-Id: Ic75fa4dfd49a2c413eee37b03d4c1f54e70eee20
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165789
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-04-27 12:38:27 +00:00
Jack Franklin 992295e37d Move UIString into Platform
Platform is the "lowest" part of DevTools - e.g. it depends on nothing.

We have code we want to move to Platform but cannot because it needs
`ls` and therefore creates a circular dependency. So this CL moves
UIString into Platform.

To avoid rewriting a lot of imports we re-export it from `common.js`.

Change-Id: I399bbe8593e043148c4c7e51f598cbd73a89f639
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165758
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-04-27 11:57:16 +00:00
Mathias Bynens e231df478c Revert "Roll deps"
This reverts commit 99d87e940b.

Reason for revert: https://ci.chromium.org/p/devtools-frontend/builders/ci/Stand-alone%20Linux/1355?

Original change's description:
> Roll deps
> 
> This patch includes some manual changes to the MediaModel, in order
> to support the new playerMessagesLogged and playerErrorsRaised events
> which are added in the roll.
> 
> The patch also includes the result of:
> 
>     scripts/deps/roll_deps.py $CHROMIUM_SRC_DIR $DEVTOOLS_FRONTEND_DIR
> 
> As a drive-by, this patch also makes `scripts/deps/*.py` executable so
> that they can be invoked directly without the need to explicitly invoke
> Python.
> 
> DISABLE_THIRD_PARTY_CHECK=see above
> 
> No-Presubmit: true
> Bug: chromium:1075437
> Change-Id: I794006f5a2077c8929f7d28bdd3f7b308603b6d9
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165756
> Commit-Queue: Mathias Bynens <mathias@chromium.org>
> Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>

TBR=mathias@chromium.org,changhaohan@chromium.org,alexrudenko@chromium.org

Change-Id: If8c4886b61ef1200bdcd2e93604f7d67c57235ff
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1075437
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2167397
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-04-27 11:48:48 +00:00
Mathias Bynens 99d87e940b Roll deps
This patch includes some manual changes to the MediaModel, in order
to support the new playerMessagesLogged and playerErrorsRaised events
which are added in the roll.

The patch also includes the result of:

    scripts/deps/roll_deps.py $CHROMIUM_SRC_DIR $DEVTOOLS_FRONTEND_DIR

As a drive-by, this patch also makes `scripts/deps/*.py` executable so
that they can be invoked directly without the need to explicitly invoke
Python.

DISABLE_THIRD_PARTY_CHECK=see above

No-Presubmit: true
Bug: chromium:1075437
Change-Id: I794006f5a2077c8929f7d28bdd3f7b308603b6d9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165756
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2020-04-27 11:13:45 +00:00
Tim van der Lippe 0c197e5a9e Add extensions for implicit imports in named export declarations
R=jacktfranklin@chromium.org

Change-Id: I9886922dc14e0bc05248a1d1a7c3f85304ea7c9f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2167756
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-04-27 10:50:35 +00:00
Tim van der Lippe efb2a94cdc Run Karma unittests on the Ninja output directory
This significantly speeds up Karma execution times to about 12 seconds on an unchanged build folder.
It uses the Ninja build output to find the unittest files.

You can run the new script with:

npm run unittest
npm run unittest -- --target=Release

To make sure you perform a minimal build and run tests right after it, run:

npm run auto-unittest
npm run auto-unittest -- --target=Release

If no ninja-build-name is set, it assumes that `out/Default` exists.
The `auto-unittest` command will run autoninja for you on the output folder.

R=jacktfranklin@chromium.org,aerotwist@chromium.org

No-Presubmit: true
Bug: 1061125
Change-Id: I45edd11e422c5cdc8a4fc0bbb6bc43e386519aa9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2102717
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-04-27 10:16:15 +00:00
Mathias Bynens 51980699f7 Avoid unnecessary use of Object.entries
Previously, the script would output code of the form:

    new Map(Object.entries({
      'word-wrap': 'overflow-wrap'
    }));

This patch simplifies that down to:

    new Map([
      ['word-wrap', 'overflow-wrap']
    ]);

No-Presubmit: true
Bug: chromium:1039620, chromium:1075437
Change-Id: Ia102b46b70bdbb227c5ff41742fcb82940d48eb9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165787
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2020-04-27 09:32:55 +00:00
Jack Lynch 966040b2c0 Add chords to the DevTools
This CL adds the ability to bind actions to a sequence of two
keypresses, rather than just one (e.g. Ctrl+K Ctrl+O). VS Code refers to
these as chords [1]. As we move forward with custom keyboard shortcuts,
it's necessary to implement chords in the DevTools so that users
can match their shortcuts to editor shortcuts that use chords or assign
custom chords. This CL also adds a Ctrl+K Ctrl+S shortcut to open the
shortcuts settings for testing purposes, but I plan to remove that
shortcut before landing this change. It will return later as part of the
VS Code editor preset.

My implementation of chords here is focused on two-keypress
shortcuts, e.g. Ctrl+K Ctrl+Shift+Q would be a valid chord but Ctrl+K
Ctrl+K Ctrl+O would not be because it has three parts. Limiting chords
to two parts simplifies the implementation and matches a similar
restriction in VS Code. Although other editors like vim and Atom allow
shortcuts of arbitrary length, that's not really a feature that users
have asked for and it would introduce extra complexity into
ShortcutRegistry for questionable gain. However, the new structure of
ShortcutRegistry leaves open the possibility of enabling
arbitrary-length shortcuts in the future.

ShortcutRegistry's approach to handling a key has been changed as
follows:

If a keypress comprises only modifiers (e.g Ctrl+Shift), then it's
ignored. The DevTools already disallow modifier-only shortcuts, so this
change just prevents modifiers from clearing the chord timeout.

If the first half of a chord has been pressed within the timeout
(currently 1000ms), then clear the timeout and try to execute the
current key as the second half of a chord. If that isn't a valid chord,
then try to execute both keys as separate shortcuts in sequence.

If there isn't an active timeout and the keypress is potentially the
first part of a chord, then set _activePrefixKey and
_activePrefixTimeout. If the timeout expires without a second key being
pressed, attempt to handle the keypress as an individual shortcut.

If the keypress isn't potentialy the first part of a chord and there
isn't an active timeout, then it will be handled as normal.


There were a few shortcuts handled outside of ShortcutRegistry (e.g.
sources.rename, debugger.toggle-breakpoint) that made the assumption
that checking the key of a single event was enough to determine whether
it matched a shortcut, so that flow has been reworked to centralize all
shortcut-matching in
ShortcutRegistry.handleKey().


Custom shortcuts design doc: https://docs.google.com/document/d/1oOPSWPxCHvMoBZ0Fw9jwFZt6gP4lrsrsl8DEAp-Hy7o/edit
[1] https://code.visualstudio.com/docs/getstarted/keybindings#_keyboard-rules

Bug: 174309
Change-Id: I1b3f384d7c65e41d0dbc5e32854fb331e052823f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2125620
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
2020-04-23 22:01:51 +00:00
Jack Franklin 28447fd262 Add ESLint rule to ban assert.equal
`assert.equal` is a non-strict check - it uses `==`. In our tests we
should either use:

* `assert.strictEqual` which uses `===`
* `assert.deepEqual` which does
a comparison on objects.

Change-Id: I872f9be140dc4c60b199fce94f95d0c12ee2bbc0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2160929
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-04-23 12:41:30 +00:00
Benedikt Meurer 3244d968e1 [CodeMirror] roll CodeMirror to 5.53.2
Also fix instructions and roll_codemirror.py script, and add the
new `wast.js` web mode for WebAssembly disassembly (which is going
to be hooked up in a follow up CL).

Bug: chromium:1042721
Change-Id: I2f14934b48528439b707538a64dfff4c2ac846e1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2159505
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
2020-04-23 10:11:09 +00:00
Tim van der Lippe 80c102878f Add ESLint rule for skipped tests
This makes sure that every skipped test also has a corresponding
CRBug filed to track re-enabling that test. Additionally, every
skipped test must have an attached comment with an explanation
as to why it is skipped.

R=jacktfranklin@chromium.org

Change-Id: I006a66ab32e7c014ef2287cb79f50b77de559a20
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2159518
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-04-22 13:32:39 +00:00
Tim van der Lippe 08279933ef Use Mocha configuration file instead of commandline arguments
This has two benefits:
1. We can now "pre-process" the arguments. It therefore allows us
to specifically set the tests we want to run. Before this change,
we would incorrectly include JavaScript files that were outputs
from (since-removed) TypeScript tests. Since adding these as
arguments to the Mocha invocation causes issues on Windows bots
with "arguments too long" errors, we should be using the config
file.
2. We can add additional arguments here without the need
of passing all the arguments from `run_test_suite.py` in.

R=petermarshall@chromium.org
TBR=aerotwist@chromium.org

Bug: 1071369
Change-Id: Icab02b1117f4095081987b65c8151ddf04239e11
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2157044
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-04-22 12:35:19 +00:00
Tim van der Lippe 869374bcab Port shared test runner logic into separate package
The shared test runner logic was reimplementing parts of Mocha,
in particular the test logging and filtering. Moreover, it was
booting the hosted mode server and puppeteer outside of Mocha.

Mocha supports root level hooks [1]. These hooks allow us to
perform work before a test starts. Moreover, by using the
before and after hook, we can run logic before and after
all tests.

By using these hooks, we can extract the "boot the hosted mode
server and hookup puppeteer" part to these root hooks.
Additionally, we can reset the pages in the `beforeEach`, which
means that tests themselves don't have to reset the pages.

We also put the implementation code into third_party/conductor,
as we would like to reuse this logic for the Puppeteer tests.
The Puppeteer test suite now also uses Mocha and has very
similar requirements as to our DevTools tests. By extracting
from DevTools, we can look into expanding the test runner to
other usecases, but that is out of scope for now.

[1]: https://mochajs.org/#root-level-hooks

Bug: 1071369

Change-Id: Ie9f954359d9de84da564b74b6f5517dd535db008
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2150458
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-04-20 10:32:58 +00:00
Andrey Kosyakov be26c1703e Only declare trailing optional param names as {type=} in generated JSDoc
This fixes front-end compilation in case a parameter that was previously
non-optional is made optional in the protocol.

Change-Id: I86f02d3dbdccff5a65636a98edcfe81476c8455e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2150158
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
2020-04-16 00:14:59 +00:00
Tony Ross 9f64a3e168 Fix check-type-closure for serverless Java installs
I ran into this while trying to reproduce Closure failures locally for
a different CL. Python's built-in remove method on lists returns None
instead of the modified list, which was causing the resulting value in
exec_command to be incorrect when a Java install without a server JVM
was used.

Change-Id: Ib2629b513c2f6401c51654e68792509796366e61
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2150731
Reviewed-by: Leo Lee <leolee@microsoft.com>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tony Ross <tross@microsoft.com>
2020-04-15 18:23:48 +00:00
Tim van der Lippe b0f499fbae Fix eslint import rules to warn on test import extensions
Tests should also use imports that end with an extension, particularly
as it can silently fail in Karma.

We discovered this issue in
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2144163/4/test/e2e/application/cookies.ts#10

R=janscheffler@chromium.org

Change-Id: Ic379cb90b8e201b55a24010dc45565f6f45d910e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2150450
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-04-15 14:02:58 +00:00
Tim van der Lippe 650668eda9 Fix ES module import linter for module entrypoints
Module entrypoints need to be of the form:
import * as File from './File.js'

This makes sure that all usages of the symbols in a cross-namespace
module use the form Namespace.File.Symbol.

We discovered this issue in
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2120014/5/front_end/common/common.js#14

R=mathias@chromium.org

Change-Id: If550c3d11456c1ac31ad3230705439e58d226d11
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2150452
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-04-15 13:09:08 +00:00
Tim van der Lippe ef991621e0 Update Karma to 5.0.1
The breaking changes listed in
https://github.com/karma-runner/karma/releases/tag/v5.0.0 do not
apply to us.

This should also include support for Edgium per
https://github.com/karma-runner/karma/pull/3440

R=jacktfranklin@chromium.org
DISABLE_THIRD_PARTY_CHECK=Update karma

Bug: 1068145
Change-Id: I7567b2db14dbf59aaf9c091220157bf55d155810
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2144050
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-04-15 08:03:17 +00:00
Tim van der Lippe 9813224fa7 Port linter check to Node
We ignore some files for ESLint, as they are either generated or
third_party. However, when someone tries to change these files,
ESLint would emit a warning stating that the file in question is
ignored.

This issue was reported to ESLint in https://github.com/eslint/eslint/issues/9977
The suggested workaround is to use the CLIEngine to filter out
the problematic paths. However, since our script was written in
Python, that API is not accessible to us.

Therefore rewrite the script to Node and filter out the problematic
files. The calls to CLIEngine were mostly taken from eslint/lib/cli.js,
which was the previous file used by `node_modules/bin/eslint`.

R=jacktfranklin@chromium.org
CC=sigurds@chromium.org

Change-Id: Iee600f0e0d99fcb6eeeb203a952a50fe35f9aaf3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2149316
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-04-14 16:25:25 +00:00
Tim van der Lippe dfd18c4e75 Remove istanbul-diff from node_modules
The package is unused at the moment. It was originally added in
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2024871
to enable karma-coverage support. However, istanbul-diff itself
is not required for that process, as we still generate the
karma-coverage report without it.

R=liviurau@chromium.org
DISABLE_THIRD_PARTY_CHECK=Remove istanbul-diff

Bug: 1068145
Change-Id: I38df9ebdfeb5232f013ea45b4a596239bfd63d7b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2137391
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-04-14 11:21:15 +00:00
Tim van der Lippe c27927c22e Remove esprima
Esprima is an older parser that does not support modern JavaScript
features. Moreover, we are no longer this parser in either the
ESLint pipeline nor the localization pipeline. Therefore, we can
remove our mirror on GitHub and delete it from node_modules.

R=jacktfranklin@chromium.org
DISABLE_THIRD_PARTY_CHECK=Remove esprima

Change-Id: I372b66c973424752bcd487954504c20b2282d0d6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2140940
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-04-09 11:42:50 +00:00