Commit Graph
122 Commits
Author SHA1 Message Date
Simon Zünd 52be96d1fd [l10n] Only bake strings currently present in the source
This CL modifies the "npm run bake-strings" command to only include
UI strings in the baked *.json files that are also present in the
TS files.

It does this by first reading the en-US.ctc.json file and memorizing
all the keys present there. While converting the various
<locale>.ctc.json to <locale>.json we only write those messages
that were also present in en-US.ctc.json.

This means we need to run "npm run collect-strings" to get an
accurate en-US.ctc.json before we can bake the <locale>.json files.

DISABLE_THIRD_PARTY_CHECK=Also update package.json

Bug: 1185727
Change-Id: I2b9c099a12a49b53b8613c6a962a776db7d609b6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4061306
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-11-28 09:35:25 +00:00
Simon Zünd d2a9bdd735 [l10n] Add new bake-strings.js script
bake-strings.js extracts the part of collect-strings.js that turns
*.ctc.json files into the LightHouse i18n JSON format. We no longer
need to run this step as part of presubmit to generate en-US.json.

This way, we have a separate script that we can call independently when
importing translations into DevTools.

DISABLE_THIRD_PARTY_CHECK=Also add 'npm run' short hand
R=alexrudenko@chromium.org

Bug: 1185727
Change-Id: I3a5bce0a909533bcf57f4b582c7356b8c2dda200
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4047720
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2022-11-22 12:48:25 +00:00
Al Muthanna Athamina 44409e051c [unittest] Cover WorkspaceImpl with isolated unit tests
Also refactor the ProjectStore unit tests as a drive by because it was failing when
ran individually.

Bug: chromium:1322039
Change-Id: I93dc9cdf7081bb8e85ca4df325431510bc5f37f3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3876147
Commit-Queue: Almothana Athamneh <almuthanna@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2022-09-08 12:49:25 +00:00
Thiago Perrotta de62a03a98 add gn gen out/Default prebuild as a pre-req of npm run build
Running `npm run build` (autoninja) before running `gn gen` yields an
error message as `out/Default` doesn't exist.

Ensure `gn gen out/Default` always runs prior to `npm run build` by
adding it as a prebuild script.

Furthermore refactor manual autoninja invocations to use `npm run
build` for consistency and also to take advantage of the newly added
prebuild script.

Before: `npm run build` fails in a fresh clone
After: `npm run build` succeeds in a fresh clone
Bug: None
Change-Id: I9dceaab3b1ee4cd8ec16f10ddd604a38e64420aa
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3792926
Auto-Submit: Thiago Perrotta <tperrotta@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Thiago Perrotta <tperrotta@chromium.org>
2022-08-02 05:01:11 +00:00
Jack Franklin 38391d47f5 Land --no-fix flag to ESLint runner
This is useful sometimes if debugging a new ESLint rule - I've found
myself manually updating the script to disable fixing whilst I figure
something out.

Adding this flag and a separate `lint-check-js` script will make this
easier.

Bug: none
Change-Id: I929b13b09ece40690d630620da162986ed01e790
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3605263
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-04-25 13:00:57 +00:00
Alex Rudenko 82bff60065 Invoke python scripts using vpython
Calling the .py scripts direcrtly does not work
on Windows.

Bug: none
Change-Id: I1ed485264bdf51d61afd0de6948e218809a26d2a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3598870
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2022-04-21 08:11:09 +00:00
Jack Franklin e25b01f6e9 Allow auto-interactionstest to take extra flags
With this change we can now run commands such as:

```
npm run auto-interactionstest -- --mocha-fgrep="data_grid"
```

And have that flag be respected.

Bug: none
Change-Id: Ibcdb8a2ecc0dbfabb8929bb91be001f0e81e7f62
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3452722
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-02-11 09:54:44 +00:00
Tim van der Lippe 800d875627 Add build script tests
You can run these tests with `npm run build-test`, while we also run
them as part of our PRESUBMIT if we make any changes to the build
folder.

R=yangguo@chromium.org
CC=tikuta@chromium.org

Bug: 1293772
Change-Id: Id3b02c83398d2346a4ec5a06f3b938d33070d4f7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3439987
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-02-04 13:25:10 +00:00
Tim van der Lippe 2ec9790ec5 Remove build_release_applications and friends
This script is now unused and fully replaced by GN. As such, this
concludes the full `module.json` migration and related scripts, which
means we can consider crbug.com/1127902 fixed.

R=jacktfranklin@chromium.org

Fixed: 1127902
Change-Id: I0fde9c4fede0cdc8649e5e455e025a70ed4d2a09
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3310869
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-12-02 12:08:02 +00:00
Tim van der Lippe 8aeee41bc7 Remove module.json schema checks
We have now removed all module.json files, so these checks are obsolete.

R=jacktfranklin@chromium.org

Bug: 1127902
Change-Id: Iefe8538474b77f78eed010b0fad9461873bad03c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3310603
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-12-02 11:28:37 +00:00
Tim van der Lippe f9e565ef89 Add new run_lint_check_js.mjs
ESLint 8 removed CLIEngine. Therefore, we need to migrate away from
CLIEngine to the main ESLint class (which already exists in ESLint 7).
However, that class is based on promises, which means we can't use them
in a CommonJS context.

Therefore, introduce a new `.mjs` version that uses ES modules (which
can do as we are on a recent version of Node) and use the promise
versions. There are no other functional changes compared to the old
`.js` script.

The reason that we first have to add this file here, is that our CQ
directly refers to the `.js` version. That means we first land this CL,
we update our CQ configuration and only then can we remove the `.js`
file from our repository.

R=jacktfranklin@chromium.org

Bug: none
Change-Id: Iad3656931ae09eb7f9f23b3e6ad7d39c8a761a31
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3268299
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2021-11-09 10:25:30 +00:00
Nancy Li 103da33916 Add (auto-)debug-interactionstest to package.json
Bug: N/A
Change-Id: I218adc8c6eba6b9d1e5d61df6e8525b97cc3a9fd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3103498
Commit-Queue: Nancy Li <nancyly@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-08-18 15:49:03 +00:00
Kriti Sapra d8fb451d04 [CSS]: panels/elements
Bug: 1106746
Change-Id: I2f0212094fd4b89e57ca1acad67cb8ede7d63d2c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3103238
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Kriti Sapra <kritisapra@google.com>
2021-08-18 15:07:01 +00:00
Jack Franklin d2a117c50f Remove lint-components-css script
Now we ban CSS in web components, this script is irrelevant as it'll
never find any issues - and we lint to ensure no style tags creep into
our Lit templates.

Bug: 1106746
Change-Id: I507193c63a1ab26901d9d3aaec2b01620717b477
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3075380
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>
2021-08-06 18:02:47 +00:00
Simon Zünd 00007bb50a [l10n] Pass directories as cmd arguments to collect-strings
This CL changes `collect-strings.js` to allow collection of UI strings
from multiple target directories and combine them into a single
<locale>.ctc.json and <locale>.json.

Please keep in mind that if more than one directory contains a
foo/bar.ts with UIStrings key 'baz', than the last directory
specified "wins".

DISABLE_THIRD_PARTY_CHECK=update script and invocation
R=tvanderlippe@chromium.org

Bug: 1163928
Change-Id: I11c36c08ff61a3beda35d354af9d57341c00c0d8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3069409
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2021-08-05 09:12:55 +00:00
Alex Rudenko fd136e001e Rename DEBUG env var to DEBUG_TEST
Currently, you cannot run tests in non-debug mode
and turn on debug logging from Puppeteer that relies
on https://www.npmjs.com/package/debug.

Running `DEBUG=puppeteer.* ...` would also start the
test runner in a debug and non headless mode. This
CL renames the DEBUG variable that DevTools test runner
relies on so that debug logging is independent from the
debug mode we have for tests.

Bug: none
Change-Id: I8b8476f7c26c07eea1db29bfae74d4fb61afd42c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2963755
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jan Scheffler <janscheffler@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2021-06-16 12:47:15 +00:00
Tim van der Lippe 727227900c Dynamically optimize svgs
Currently, we optimize our SVGs out-of-sync and have a Python
script and PRESUBMIT check to make sure that the SVGs are correctly
optimized. This means that the SVGs are duplicated in the Images
folder and requires developers to install `svgo` on their command
line, which could be using differing versions.

Instead, we can optimize the SVG images (which is computationally
cheap) during build time using the rollup-plugin-import-meta-assets
and svgo packages. The rollup plugin traverses the required SVG
image files and puts them and rewrites them to the Images/ folder
(rather than in src/), while also allowing us to optimize them
along the way.

DISABLE_THIRD_PARTY_CHECK=Removing script from package.json
R=jacktfranklin@chromium.org

Bug: 1216402
Change-Id: Ieb6932b9a81753be5ecbccd00a5d84bd0efa23f8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2939994
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-06-10 10:09:30 +00:00
Paul Lewis 05cf8ebb14 Add build scripts to package.json
I am rather fond of Cmd/Ctrl+Shift+B in VSCode to build my current
project. However, that presupposes that there is a script in the
package.json named "build" (or some variant, e.g., "build-release").
This CL adds those scripts to the package.json file.

R=jacktfranklin@chromium.org

Bug: None
Change-Id: I8e685d098b1bf3c9b6b8b1c85d1a97d693a344f7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2891843
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-05-13 08:59:49 +00:00
Jack Franklin 87fa2776a8 [TestRunner] update npm run X scripts to use run_test_suite.js
Bug: chromium:1186163
Change-Id: Ibea84f2d675c2a9cc2ba81aaf805fd08e7506757
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2810288
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-04-07 14:57:09 +00:00
Jack Franklin cb0638c044 Migrate npm run perf to new test runner
That - want to see that it all works OK and also it's not a test suite
that people run often / configure so a good low risk one to move.

Bug: chromium:1186163
Change-Id: I94cc20adca99216a3b24639dbc57c3d74bdae758
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2784720
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-03-29 11:01:21 +00:00
Philip Pfaffe 92feb60a1a Add an eslint check to prevent crbugs at the beginning of an it()
There are a handful of e2e tests which test regressions, and consequently
have a bug assiciation. This association was part of the test names in
the same way as we reference bugs for skipped tests. If such a test is
then skipped it needs to start with two crbug references. That's
confusing for the reader as well as a the skipped test lint check, for
which the regression bug references can lead to false negatives. This CL
introduces a new lint check that prevents bug references in non-skipped
tests with the same syntax as skipped tests.

Bug: none
Change-Id: Ibdf59091aba942f85424c1f12cc31160d9fe786a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2761357
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2021-03-16 14:14:54 +00:00
Jack Franklin 29bb6314ce [TestRunner] create new test runner that takes configuration file
This CL lands the initial new run_test_suite.js that can take its
configuration from a config JSON file, or from flags.

This new script is only used to run `npm run auto-interactionstest`
and nothing more; I want to roll it out slowly and ensure that
everyone is aware of it before removing the old Python script. I will
create a doc with all the various steps, and required documentation,
as I've taken the chance to rename some options to make them clearer.

Bug: chromium:1186163
Change-Id: I5a199f82ac7ab0f323988acacaa7aae2d64e6349
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2763866
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-03-16 10:35:54 +00:00
Christy Chen 5e32bcbcf7 [Loc] Un-hook presubmit scripts
The Localization presubmit steps include checking Loc V1 and V2:
V1: Done with migration, safe to remove
V2:
- check unused string in UIStrings (Moved to ESLint)
- check migrated directory (Done with migration, safe to remove)
- check the shape of API calls (Done by typescript or ESLint)

Since all checks are obsolete or moved, this CL removes the presubmit step to unhook the scripts inside scripts/localization. I will follow up a CL to remove the actual scripts.
The CL that introduced this step https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1931279


Bug: 1136655
Change-Id: If203607588896693a6331de606c873458b74cd6e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2746919
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Christy Chen <chrche@microsoft.com>
2021-03-11 03:32:57 +00:00
Sigurd Schneider a96c51065b Add npm run collect-strings which updates the localization files
This is useful when working on a CL that changes localization strings
frequently during rebuilds.

Bug: chromium:1136655
Change-Id: Id9d56728351a07d796036664a3a730184c6356c5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2744047
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2021-03-09 16:15:15 +00:00
Jack Franklin 736a4b51b0 Improve path detection in hosted-mode server
This CL improves how the hosted-mode server finds the root folder. It
also removes `npm run hosted-server`, which has been broken ever since
we migrated any source files to *.ts. People shouldn't be using it and
should instead be running the server from ./out/Target/gen/scripts/....

Bug: 1182255
Change-Id: If7a37bff0c3488679c0abd69a0ec548feda8aa22
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2735895
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-03-08 07:02:19 +00:00
Jack Franklin 6dbe837682 Lint border-color and outline usages in CSS.
Updates the use_theme_colors rule to pick out border-color rules.

Fixed:chromium:1182679
Change-Id: I0f0f9b4a30f588e901b57131c796d73f2ac73656
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2722441
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-03-02 07:20:46 +00:00
Jack Franklin d0bac676f2 Update run_test_suite to support --test-suite-path
The current test suite runner assumes the paths; you pass
--test-suite=interactions and it assumes that they live in
out/TARGET/gen/test/interactions. This CL removes that assumption by
asking people to pass --test-suite-path, which would be
out/gen/interactions.

We will remove the --test-suite flag, but for now we're keeping it
around so the bots can still run their tests. I will file a bug to ask
that the bots have their recipes updated.

Bug:1182255
Change-Id: I6d9e5d419231845047394c5f7cbd0c74ebad3a58
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2722448
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-03-01 10:24:17 +00:00
Changhao Han 5663e48217 Add override prefix to stylelint theme color logic
Bug: chromium:1171775
Change-Id: Ia63217e154009034a585e8ccbd8ac482da519fae
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2720368
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Changhao Han <changhaohan@chromium.org>
2021-02-26 11:52:44 +00:00
Jack Franklin 60cc8ba371 Upgrade DevTools Frontend to Puppeteer 7.0.4
DISABLE_THIRD_PARTY_CHECK=upgrading pptr

Bug: none
Change-Id: I3b0672d209bd6a35ab0eed7db7cc158cc40039dc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2678700
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-02-10 14:07:38 +00:00
Jack Franklin 49a9481a74 Lint color usage in background and border-* properties.
The list of CSS properties we check for colors wasn't thorough and
didn't include `border-left/right/top/bottom` or `background` on its
own. This CL fixes that and disables the rule for any current
violations.

Bug: 1152736
Change-Id: Ic732d653fdfab0462a04dc891bcece1f44e5d471
No-Presubmit: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2676157
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2021-02-05 15:39:39 +00:00
Jack Franklin 8064d3ba7a Lint against non-theme-color variables
This CL turns on the use_theme_colors stylelint rule which enforces that
any colors use variables defined in our codebase.

There are many, many violations, unsurprisingly (about 1500), so for now
I have disabled every single violation. The goal of the dark mode
migration will be in part to remove all violations of this rule.

Additionally, new code going forwards should adhere to the rule and not
add the comment to disable the warning.

Bug: 1152736
Change-Id: I51372724ea51485daef3d4f75b7d3f60a7c8016f
No-Presubmit: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2671323
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-02-03 11:02:09 +00:00
Jack Franklin 40b5fb67b3 Remove python script for generating dark mode CSS
Now devtools_paths.js exists, we can use JS and remove the Python
version completely. This unblocks further work to enforce that
`.darkmode.css` files are up to date as part of a PRESUBMIT.

Bug: chromium:1164945
Change-Id: Ie9e8fa1cd5287d8e444085d7f036a4b17c99eda9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2662976
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-02-01 14:51:37 +00:00
Simon Zünd 9c429fb138 Introduce new script to check external links
This CL introduces "npm run check-external-links". The check parses
all string literals in first party JS/TS code for Urls. All the Urls
are then "pinged" by making a HEAD request to verify they still point
to an active resource. Example output:

  $ time npm run check-external-links

  > chrome-devtools-frontend@ check-external-links /usr/local/google/home/szuend/dev/devtools/devtools-frontend
  > third_party/node/node.py --output scripts/check_external_links.js

  Collecting JS/TS source files ... 1019 files found.
  Collecting Urls from files ...248 unique Urls found.
  Sending a HEAD request to each one ...

  All Urls are accessible and point to existing resources.

  npm run check-external-links  9.21s user 0.40s system 149% cpu 6.415 total

Please note that we can't make this check part of our PRESUBMIT, as
it makes external requests.
Also note that this check can't be implemented as an ESLint rule,
as ESLint rules are not allowed to have an async workload.

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

Bug: chromium:1170310
Change-Id: I064161dd9038143d2e360c1716f8fb622dc119ee
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2659021
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-02-01 08:33:44 +00:00
Jack Franklin 5afc7fed57 Lint inline CSS inside .ts components
This CL introduces a new lint which runs CSS linting against our
TypeScript files, and changes the CSS to pass the linting.

Bug: chromium:1166108
Change-Id: Idb8dcf00d7c578f8db0e91633c89ae92ca85bcd8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2635655
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
2021-01-18 15:12:36 +00:00
Jack Franklin bc30234f61 Migrate run_lint_check_css to JS script
As part of the work to move more scripts to Node, not Python, over time,
picked this one as the starting point. I changed its API slightly to
allow more flags to be taken in, as we'll need that to do a stylelint
pass against TypeScript files, but I will do that in a subsequent CL.

I had to make quite a few changes to devtools_paths.js, but I think it's
now calculating paths correctly. It took a bit of messing to get the
equivalent of Python's path.abspath(__file__), as you'll see from the
large comment that tries to explain what's going on!

Bug: chromium:1166108, chromium:1166572
Change-Id: Ia0b19ff8956b2ede2447530be57876a88046887e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2631113
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-01-18 10:30:12 +00:00
Tim van der Lippe 1fe7f95b0e Add eslint-plugin-lit-a11y to manage_node_deps
This also adds the MPL-2.0 license as valid license to our allowed
licenses list.

R=jacktfranklin@chromium.org
DISABLE_THIRD_PARTY_CHECK=NPM update

Change-Id: I2a3bee2ffc0b328a0579ab62ab27f938bdc876c8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2593130
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2021-01-05 13:13:19 +00:00
Jack Franklin 81eb91a605 Script to generate dark mode stylesheets
This CL provides a script that generates a dark mode stylesheet for a
given sheet, just like the runtime color patching (in fact, it uses the
same code!).

The script loads up the given CSS file, imports `ThemeSupport`, and
patches it. It then takes the final CSS file and prefixes
`:host-context(.-theme-with-dark-background)` to each selector. We can
then load the lightmode and the dark mode stylesheet into DevTools.

This is non ideal because we end up loading two stylesheets, but the
alternative is to maintain the runtime color patching for ever, or
update all third party stylesheets to use our CSS variables, which is a
lot of work.

The script does rely on the hosted mode server running but I think this
is reasonable; it's only going to be run rarely on a few CSS files, so
we won't be running it automatically on CI or anything so we can keep
the process fairly manual.

Bug: 1152736
Change-Id: I707c53fbccb3e03c9fac6691f40df32bcdb17c1f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2587024
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-12-14 10:47:31 +00:00
Tim van der Lippe fd6e13bee3 Fix proxy configuration for images when debugging Karma tests
When debugging Karma tests, all network requests for /Images would
return 400 errors. It turns out that the proxypath we were redirecting
towards should include the full base url, including the target dir,
like we did for locales.

R=szuend@chromium.org

Fixed: 1153339
Change-Id: I34b39f28254f1e0011ce96a34a22f0f31468b064
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2571463
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-12-08 11:13:32 +00:00
Tim van der Lippe 8e12f92229 Use Python version bundled with depot_tools for all scripts
depot_tools ships a "vpython" binary that is added to the $PATH
for all Chromium engineers. This binary is versioned by depot_tools
which we roll in ourselves as part of `gclient sync`.

By using `vpython` instead of `python`, we are no longer depended
on the Python version installed locally and instead use the version
we pull in from DEPS.

R=liviurau@chromium.org

Change-Id: If49a54c24b6cf129ff843cd9ca1140a723a78afb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2571462
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-12-04 14:08:59 +00:00
Jack Franklin 3b3a782f3a Enable interaction tests
This CL introduces the infrastructure and first test for what we're calling
"Interaction tests". These are tests that can be used to test component
behaviour that cannot be tested via Karma unit tests but don't require an e2e
test either.

The best example here is complex user interactions: clicking and dragging a
mouse, or doing multiple tabs to navigate through the UI.

Note that the one interaction test added here for theme_colors isn't the best
example of a complex test, but it's a test that's good enough for now whilst we
get everything set up on infrastructure and make sure it runs without flaking.

Bug: 1153281
Change-Id: Ifb37639a557c459974f703b8954ae68a93d5d368
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2566808
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-12-03 10:44:22 +00:00
Jack Franklin c4492956ad Remove component bridges generation
Now Closure is gone we don't need bridges and this removes all the code
and tests for them.

All relevant checks we wanted to keep around have been moved to ESLint
rules (see attached bug).

Fixed: 1130536
Change-Id: I82a7b8e5e7b047b36f42c5c76ddb9dfbd0742d45
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2565377
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-11-30 17:33:11 +00:00
Tim van der Lippe 7104ca0b6b Cleanup package.json scripts
These scripts should have been removed as part of
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2560245

R=aerotwist@chromium.org

Bug: 1011811
Change-Id: I82c64e158fcf27d0c6adedff06e4bc97fc1fe1e8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2560250
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-11-25 13:41:37 +00:00
Tim van der Lippe 16534e267d Remove Python infrastructure for the Closure Compiler
R=aerotwist@chromium.org

Bug: 1011811
Change-Id: I2ae75adec9fc47eedc410b4f066342ed3fb0a136
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2560245
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-25 12:39:37 +00:00
Jack Franklin 5006ab2f52 Fix bad gen in npm bridges script
The gen directory doesn't exist any more, we generate to the same dir as
the source code.

Change-Id: Icf90df81c3c8cdbd849de116633c14a28b164046
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2479135
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-10-16 11:32:27 +00:00
Changhao Han 1100a6c15f Fix generate-bridge-file script path
It seems like the old "cli.js" lives inside a folder called "gen", but
this folder has been removed recently. The npm script has not been
updated. This CL updates the npm script for this.

Change-Id: If1c7e5128a0d1f14d784982e2c801b661f6e232e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2470622
Commit-Queue: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-10-14 09:01:10 +00:00
Jack Franklin 102df67838 Fix component bridges tests
A recent TS config change elsewhere had caused these tests not to
compile with the error of:

```
error TS6307: File '/Users/jacktfranklin/src/devtools/devtools-frontend/scripts/component_bridges/value_for_type_node.ts' is not listed within the file list of project '/Users/jacktfranklin/src/devtools/devtools-frontend/test/unittests/scripts/component_bridges/tsconfig.json'.
```

The fix is to mark the dependency from the unit tests as a TS project
reference, and then generate output in the same place as the source, so
that import paths don't need to change.

This isn't ideal, and we would use ts_library if doing this now, but
this code pre-dates ts_library and also is only going to be around for
the length of the TypeScriptification work, so it doesn't feel worth the
effort to restructure it.

Change-Id: I9a924bf3e2ed945dd22ce233eda2c8c15f3193c6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2466188
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2020-10-13 10:35:14 +00:00
Maksim Sadym d53ca9807f Respect additional arguments in npm targets
Make following targets respect additional arguments, so that `--chrome-binary=[LOCATION] --chrome-features=[FEATURES]` can be used.
* `auto-debug-e2etest`
* `auto-debug-unittest`
* `auto-e2etest`

Bug: 1130513
Change-Id: I416dd08cc38597355d98ec43029e639716762296
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2422946
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Maksim Sadym <sadym@chromium.org>
2020-09-22 10:24:34 +00:00
Jack Franklin d557298f36 Add npm run auto-debug-unittest
To match the npm run auto-debug-e2etest command.

Change-Id: I06b7cb4b4a92d9bd986d25faf0a72554402e512e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2409954
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-09-16 12:05:17 +00:00
Tim van der Lippe 5f83b28dd7 Update TypeScript to 4.0.2
DISABLE_THIRD_PARTY_CHECK=Updating TypeScript
R=szuend@chromium.org

Fixed: 1120303
Change-Id: I342cfacaf25c4b450bb00703454fe69db4b6f3cb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2367944
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-08-21 13:17:14 +00:00
Jack Franklin 580a4b1d52 Script to re-generate all bridges
This script will regenerate all _bridge.js files, which will be useful when we
come to fixing bugs in the generation and need to apply that across the entire
codebase.

Change-Id: Id2a12f9b134564f221ff49d7beb92861544c0dcf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2332809
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2020-08-04 22:35:39 +00:00