Commit Graph
81 Commits
Author SHA1 Message Date
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
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
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 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
Ted Meyer 7e5ebf014b Adds End2End test for the Media tab.
I had to add support for running the tests with chromium
--enable-features flags. This isn't on by default though, I'll leave
that up to you to turn on. The tests just exit early if the flag isn't
present.

Change-Id: I132ca71796d8f069a6fba0342f10f2f2b18c7b62
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2125249
Commit-Queue: Ted Meyer <tmathmeyer@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-31 16:29:03 +00:00
Tim van der Lippe d25ae40485 Remove unused scripts files
They are referenced nowhere and not used in the current workflows.

R=yangguo@chromium.org

Change-Id: Ie1dd6e8afc352aa5f30a69a863199c21bf4c99f7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2122348
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-26 16:58:20 +00:00
Paul Lewis ae5e8fb631 Adds support for e2e parallelization
Change-Id: I9af281bc40223a5ceb2a6f71ce247970beea4b02
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2116050
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-03-25 16:45:33 +00:00
Simon Zünd 3b0c540211 Rename front_end/protocol to front_end/protocol_client
This CL is part of the work to switch over to the TypeScript compiler
for type checking.

R=tvanderlippe@chromium.org

Bug: chromium:1011811
Change-Id: Ic709a193b252df7e9027c00cf20d8afe525a215a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107539
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-18 18:06:20 +00:00
Tim van der Lippe 6d51bf00ea Factor out Runtime to root/Runtime.js
front_end/Runtime.js was doing multiple things: it was instantiating
side-effecty descriptors and initializing applications, as well as
storing all state for the modules/extensions, etc...

To support proper ES Modules, we need to separate these. root/Runtime.js
contains simple classes that store the data and can be retrieved, as well
as some helper functions that will load the respective data.

The RuntimeInstantiator.js code includes the start functions used in the
entrypoints themselves. They will use an instance of the Runtime to
properly load the application.

Along the way, I also fixed various TypeScript errors, mostly around
incorrect or missing type definitions.

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

Bug: 1011811
Change-Id: If3ddea9267813691b3faeb6ea4b0cf64edbde1f4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107523
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-03-18 12:19:29 +00:00
Paul Lewis 2d7d65c5e8 [global] Remaps self.Common.settings
This CL changes references to self.Common.settings (the global
instance of SDK.Common.Settings) over to
Common.Settings.Settings.instance(). To keep both TypeScript and
Closure happy we must make a method on the Settings class itself,
since it only allows private constructors to be accessed by static
methods on the class.

Bug: 1058320
Change-Id: I04afc8caf64acf29cdda13ef03ad05cfff4786a1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2091450
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-16 22:04:07 +00:00
Tim van der Lippe 2a4ae2bdc3 Run ESLint only on affected files for regular uploads
For most of the PRESUBMIT invocations, the CL in question does not
change anything with regards to ESLint. Therefore, we can skip doing the
full check and only perform the check on relevant JavaScript and
TypeScript files.

However, if we do change the ESLint configuration (via one of the
involved build scripts/configuration files), we should run the full
check to make sure we are compliant.

`npm run check-lint` will still run the full lint check.

This saves about 15 seconds on a regular PRESUBMIT invocation, scaling
with the number of files changed.

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

Change-Id: I9c1bb055274bfa1d8cc47c9039a1196c92eba399
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2097993
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-03-12 16:18:05 +00:00
Tim van der Lippe 4a8441c385 Port license header check to ESLint
This improves the PRESUBMIT performance as we can rely on the AST
parsing of ESLint, meaning we don't have to parse AST twice.

It also allows us to use the nice `--fix` solution to insert the proper
license header in the files.

This shaves an expected 5 seconds of the presubmit time
(non-scientifically computed based on 2 uploads).

Change-Id: I5c53e9b232585f9ec46f86b36557c50bf80f7add
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2097992
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-03-12 16:08:22 +00:00
Tim van der Lippe ba26b2b503 Run ESLint on the scripts directory
We weren't running ESLint on this directory and, as it turns out, there
are quite a few linter errors in this folder.

R=jacktfranklin@chromium.org

Change-Id: Ic6cb9f6ad4858f69114e0c433a954041215b49e2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2096705
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-03-11 14:47:51 +00:00
Tim van der Lippe 333ffc2274 Cleanup linter check
- Remove duplicate handling of subprocesses
- Remove indirection of js_lint (we can simply name it main)

These cleanups allow us to later optimize the linting step by only
linting changed files.

R=aerotwist@chromium.org

Change-Id: Ifb8fdb3a25ea04a4879d434d85ff44aa17dae012
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2088091
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-03-09 10:57:07 +00:00
Tim van der Lippe b3b90761b1 Generate InspectorBackendCommands.js on presubmit
This checks in the InspectorBackendCommands in the source tree file
and ensures that it is kept in sync whenever the third_party
location has been updated.

In the process, I discovered multiple misconfigurations in the formatting
presubmit check. First of all, it was never running, because the
.eslintignore had an empty line. Second of all, it was running twice,
which is unnecessary since we now check for changed files at the end
of the presubmit. Lastly, it was only formatting JS files, while it
should check all files.

I have also updated the _CheckGeneratedFiles check to only run if it
is actually necessary. If there are no changes made to any affected of
the files, it will skip the step. This should thus reduce the presubmit
time and we will only pay the cost if we actually update any of the
files.

Lastly, it will now properly format and lint the generated files. This
makes reading the code a lot easier and makes it easier to digest the
diff when a protocol update goes through. I have verified that, in a
full build, the files are still minified. Thus, this has no impact on
the loading performance.

DISABLE_THIRD_PARTY_CHECK=Updating protocol generation

Fixed: 1056614
Change-Id: If49b0e749978ea1a7838992ec13507ee761ad76c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2087765
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-04 15:52:35 +00:00
Tim van der Lippe f664763cdf Generate SupportedCSSProperties.js on presubmit
This checks in the SupportedCSSProperties in the source tree file
and ensures that it is kept in sync whenever the third_party
location has been updated.

Bug: 1056614
Change-Id: If0ff2ba0f94f1f0eded2792922e9a917820d9772
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2087762
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-03-04 14:23:14 +00:00
Tim van der Lippe 4d004ec2b8 Generate ARIAProperties.js on presubmit
This checks in the ARIAProperties in the source tree file and ensures
that it is kept in sync whenever the third_party location has been
updated.

Bug: 1056614
Change-Id: Ic48b6cba17fe0a3c6b7d28dd3f74483ceac2969b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2085176
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-04 12:07:04 +00:00
Connor Clark 933525c2bd Audits: Roll Lighthouse to front_end/third_party
Cherry-picked https://github.com/GoogleChrome/lighthouse/pull/10036 to the 5.7.1 branch.

Bug: 772558

Change-Id: Ia363faf4789d776ddb190126df5d3cb525bd434a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1933901
Commit-Queue: Connor Clark <cjamcl@chromium.org>
Reviewed-by: John Emau <John.Emau@microsoft.com>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-28 20:18:38 +00:00
Paul Lewis 65761161be [perf] Updates boot perf test
Change-Id: I7d8f9cf62638230a1d912c7c12beca02a2883bfa
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2077658
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-02-28 10:40:09 +00:00
Tim van der Lippe 1a0338a117 Reland "Build Karma test with Ninja"
This reverts commit 01ac2b90b3.

Reason for revert: Build fixed in Chromium

Original change's description:
> Revert "Build Karma test with Ninja"
>
> This reverts commit 4b654444ed.
>
> Reason for revert: Broke the build in Chromium: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8887844056671365856/+/steps/compile__with_patch_/0/stdout
>
> Original change's description:
> > Build Karma test with Ninja
> >
> > This instructs Ninja to generate the appropriate files for the test
> > files. It adds a separate `ts_library` definition for tests.
> >
> > Some caveats:
> > - It currently hardcodes the Ninja build output name. We should fix out
> > a solution on how to make this irrespective of build name
> > - The test name has to be renamed to Color_test.ts. While I think this
> > is clearer for code navigation, it was necessary because `ts_library`
> > currently copies to `resources/inspector`, which is not necessary for
> > test files. We could therefore filter these out, based on the files that
> > end with `_test.ts`. We could also add a separate Ninja template,
> > something like `ts_test_library`. Not sure yet what is the best
> > approach.
> >
> > DISABLE_THIRD_PARTY_CHECK=Updating TypeScript configuration
> >
> > Bug: 1011811
> > Change-Id: If7448474e84a013d8d4b00a16743575a12112f58
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2064669
> > Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
> > Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
>
> TBR=aerotwist@chromium.org,tvanderlippe@chromium.org,jacktfranklin@chromium.org
>
> Change-Id: I1048a5003b5680b257586cf3720fc5eaddb435d5
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1011811
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2067061
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>

DISABLE_THIRD_PARTY_CHECK=Reland

Bug: 1011811
Change-Id: I9df8d551a18c7733fca586f504621c18262e941d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2067062
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-02-21 15:05:54 +00:00
Tim van der Lippe 01ac2b90b3 Revert "Build Karma test with Ninja"
This reverts commit 4b654444ed.

Reason for revert: Broke the build in Chromium: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8887844056671365856/+/steps/compile__with_patch_/0/stdout

Original change's description:
> Build Karma test with Ninja
> 
> This instructs Ninja to generate the appropriate files for the test
> files. It adds a separate `ts_library` definition for tests.
> 
> Some caveats:
> - It currently hardcodes the Ninja build output name. We should fix out
> a solution on how to make this irrespective of build name
> - The test name has to be renamed to Color_test.ts. While I think this
> is clearer for code navigation, it was necessary because `ts_library`
> currently copies to `resources/inspector`, which is not necessary for
> test files. We could therefore filter these out, based on the files that
> end with `_test.ts`. We could also add a separate Ninja template,
> something like `ts_test_library`. Not sure yet what is the best
> approach.
> 
> DISABLE_THIRD_PARTY_CHECK=Updating TypeScript configuration
> 
> Bug: 1011811
> Change-Id: If7448474e84a013d8d4b00a16743575a12112f58
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2064669
> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>

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

Change-Id: I1048a5003b5680b257586cf3720fc5eaddb435d5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1011811
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2067061
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-21 12:41:24 +00:00
Tim van der Lippe 4b654444ed Build Karma test with Ninja
This instructs Ninja to generate the appropriate files for the test
files. It adds a separate `ts_library` definition for tests.

Some caveats:
- It currently hardcodes the Ninja build output name. We should fix out
a solution on how to make this irrespective of build name
- The test name has to be renamed to Color_test.ts. While I think this
is clearer for code navigation, it was necessary because `ts_library`
currently copies to `resources/inspector`, which is not necessary for
test files. We could therefore filter these out, based on the files that
end with `_test.ts`. We could also add a separate Ninja template,
something like `ts_test_library`. Not sure yet what is the best
approach.

DISABLE_THIRD_PARTY_CHECK=Updating TypeScript configuration

Bug: 1011811
Change-Id: If7448474e84a013d8d4b00a16743575a12112f58
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2064669
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-21 11:49:54 +00:00
Tim van der Lippe 69ac3898ce Reland "Fix TS + Ninja integration"
This reverts commit 1ef4eb754e.

Reason for revert: The generated tsconfig now use relative paths
instead of absolute paths, thus removing the usage of the
gn build target in the path.

Original change's description:
> Revert "Fix TS + Ninja integration"
>
> This reverts commit f9aef25689.
>
> DISABLE_THIRD_PARTY_CHECK=expected third_party changes with TS fixes
>
> Reason for revert: Currently causing the deterministic bots to fail (https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8888105239366430432/+/steps/compare_build_artifacts/0/stdout). Reverting until we understand why and can fix.
>
> We don't rely on this change yet anywhere so we're fine to revert without causing problems elsewhere.
>
> Original change's description:
> > Fix TS + Ninja integration
> >
> > * Tell Closure to autogenerate bridge files
> > * Copy _bridge.js files into correct place when generating TypeScript
> > * Fix TS Ninja integration to include copied TS generated files
> >
> > DISABLE_THIRD_PARTY_CHECK=expected third_party changes with TS fixes
> >
> > Bug: 1011811
> > Change-Id: Icbd7574b6bf98b36c8de3be1cb1634b355192e77
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2060506
> > Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
> > Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
> > Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
>
> TBR=tvanderlippe@chromium.org,jacktfranklin@chromium.org
>
> Change-Id: Iedc3767deac2b6993c26a2c267ba303db0ca4af3
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1011811
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2062591
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>

DISABLE_THIRD_PARTY_CHECK=Changes to TypeScript Ninja integration

Bug: 1011811
Fixed: 1053887
Change-Id: Iccd7c93e8d628102c2f131c5769b3019040c024f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2062607
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-02-20 11:56:06 +00:00
Jack Franklin 1ef4eb754e Revert "Fix TS + Ninja integration"
This reverts commit f9aef25689.

DISABLE_THIRD_PARTY_CHECK=expected third_party changes with TS fixes

Reason for revert: Currently causing the deterministic bots to fail (https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8888105239366430432/+/steps/compare_build_artifacts/0/stdout). Reverting until we understand why and can fix.

We don't rely on this change yet anywhere so we're fine to revert without causing problems elsewhere.

Original change's description:
> Fix TS + Ninja integration
>
> * Tell Closure to autogenerate bridge files
> * Copy _bridge.js files into correct place when generating TypeScript
> * Fix TS Ninja integration to include copied TS generated files
>
> DISABLE_THIRD_PARTY_CHECK=expected third_party changes with TS fixes
>
> Bug: 1011811
> Change-Id: Icbd7574b6bf98b36c8de3be1cb1634b355192e77
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2060506
> Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>

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

Change-Id: Iedc3767deac2b6993c26a2c267ba303db0ca4af3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1011811
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2062591
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-02-19 09:08:42 +00:00
Tim van der Lippe f9aef25689 Fix TS + Ninja integration
* Tell Closure to autogenerate bridge files
* Copy _bridge.js files into correct place when generating TypeScript
* Fix TS Ninja integration to include copied TS generated files

DISABLE_THIRD_PARTY_CHECK=expected third_party changes with TS fixes

Bug: 1011811
Change-Id: Icbd7574b6bf98b36c8de3be1cb1634b355192e77
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2060506
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-02-18 11:12:17 +00:00
Connor Clark 2bc3be29be Reland "[Lighthouse] Rename Audits panel to Lighthouse"
This reverts commit 0651468562.

Reason for revert: Cause of failure has been remedied. See: https://chromium-review.googlesource.com/c/chromium/src/+/2055398

Original change's description:
> Revert "[Lighthouse] Rename Audits panel to Lighthouse"
>
> This reverts commit 2ae53ef04d.
>
> Reason for revert: This CL breaks CI: https://ci.chromium.org/p/devtools-frontend/builders/ci/DevTools%20Linux/453. It looks like the layout test expects audits not lighthouse in the name, so it's probably in need of a 3-way merge.
>
> Original change's description:
> > [Lighthouse] Rename Audits panel to Lighthouse
> >
> > Change-Id: Ia2ab175d2a3b6c8ded73aff8ff0f5582f5a8fa0c
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2044605
> > Commit-Queue: Connor Clark <cjamcl@chromium.org>
> > Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> > Reviewed-by: Paul Irish <paulirish@chromium.org>
>
> TBR=paulirish@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org,cjamcl@chromium.org
>
> Change-Id: Ia6d5f42a0e6ece4352696c51bf0de5754774cb0a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2051983
> Reviewed-by: Paul Lewis <aerotwist@chromium.org>
> Commit-Queue: Paul Lewis <aerotwist@chromium.org>

TBR=paulirish@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org,cjamcl@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1052111
Change-Id: I638ca9bd5cd94e02fb7318f2a7d7c66fca40e6c8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2056866
Reviewed-by: Connor Clark <cjamcl@chromium.org>
Reviewed-by: Paul Irish <paulirish@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Connor Clark <cjamcl@chromium.org>
2020-02-18 01:56:25 +00:00
Jack Franklin e245d1a208 Include test/e2e in ESLint checks.
It already runs on `test/unittests` but
with this change we'll lint the e2e tests too.

Change-Id: I0e39ce9a4b0128207a04b1dfd6cf1ea2f25bf213
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2054159
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-02-14 11:58:54 +00:00
Paul Lewis 25ff1d1ca4 [e2e] Deprecate e2e script and introduce screenshots script
This CL downgrades the existing e2e script to a passthru. Once the bots
use the new script, this can be deprecated entirely.

The CL also updates the paths in the package.json

Bug: 1044632
Change-Id: I4a5bda44f7c212e648a58e72e95712b9c3c6e3e9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2054552
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-02-13 15:36:56 +00:00
Paul Lewis ca8bf73527 [tests] Migrates and tidies test runner
This CL migrates shared code from e2e, screenshots, and unit to a helper
file. It also introduces a unified runner for e2e and screenshots (and
perf once that's in place). Once this has landed I will remove
run_e2e.py and use run_test_suite.py instead.

Change-Id: I590e5eb6f3e8a4692767a2aa653b55685891614b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2054547
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-02-13 14:54:08 +00:00
Paul Lewis 6b060a01eb [test] Adds 'hello world' screenshot test
This CL is the initial commit for a screenshot test. A further CL will
provide tooling for updating the goldens.

Bug: 1051458
Change-Id: Id61dd0a804ad33566451e0f56f6981e3e7bd9067
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2051984
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-13 13:57:48 +00:00
Jack Franklin 8b9aa2fca6 Prefer eslint-mocha for linting .only in tests
DISABLE_THIRD_PARTY_CHECK=new npm module causes package-lock change

We can get rid of a custom script and use ESLint for these rules.

Additionally this means editors will highlight the issue in the editor.

Change-Id: I552b52e7f07b4e7430b3f685dbc3b5fad36ffff2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2052167
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-02-12 18:12:22 +00:00
Paul Lewis a730f62726 Enable colored output from test subprocesses
R=tvanderlippe@chromium.org

Change-Id: Ia0754f892841ee9b06930da8605bb8bad33084ec
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2052165
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-02-12 18:02:03 +00:00
Paul Lewis 0651468562 Revert "[Lighthouse] Rename Audits panel to Lighthouse"
This reverts commit 2ae53ef04d.

Reason for revert: This CL breaks CI: https://ci.chromium.org/p/devtools-frontend/builders/ci/DevTools%20Linux/453. It looks like the layout test expects audits not lighthouse in the name, so it's probably in need of a 3-way merge.

Original change's description:
> [Lighthouse] Rename Audits panel to Lighthouse
> 
> Change-Id: Ia2ab175d2a3b6c8ded73aff8ff0f5582f5a8fa0c
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2044605
> Commit-Queue: Connor Clark <cjamcl@chromium.org>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Paul Irish <paulirish@chromium.org>

TBR=paulirish@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org,cjamcl@chromium.org

Change-Id: Ia6d5f42a0e6ece4352696c51bf0de5754774cb0a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2051983
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-02-12 11:06:32 +00:00
Connor Clark 2ae53ef04d [Lighthouse] Rename Audits panel to Lighthouse
Change-Id: Ia2ab175d2a3b6c8ded73aff8ff0f5582f5a8fa0c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2044605
Commit-Queue: Connor Clark <cjamcl@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Irish <paulirish@chromium.org>
2020-02-11 22:43:22 +00:00
Paul Lewis 853bb7e903 Restores .only PRESUBMIT check
TBR=tvanderlippe@chromium.org
Bug: 1009443
Change-Id: I99cd8a7526e24d57d07175c280d31420a59249fb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2046552
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-10 19:11:30 +00:00
Tim van der Lippe 90c7bd3fe9 Fix e2e typescript configuration
There were multiple issues:
1. The e2e project was accidentally recompiling the shared files again,
thus we needed to use project references for that
2. There was a difference in configuration of the root project and the
e2etests. As such, make sure to extend the root config.
3. The code was being transpiled down to es5, which is not necessary as
we run a recent version of Node. Thus, we can use `esnext` instead.
Debugging scripts should now be a lot easier, especially as
`async-await` are no longer transpiled.

For now, strict is turned off, as there are various errors that pop up.
I will clean that up in a follow-up CL.

Bug: 1044632
Change-Id: Ie0cf29a1ddd1e027bcc107d2567283eaaaa7fead
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2047183
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-10 14:44:40 +00:00
Yang Guo fa34ae8b22 chmod +x scripts/test/run_e2e.py
So that it's consistent with the other test runners.

R=aerotwist@chromium.org

Change-Id: I8be3664055d1ad398f0633ea17815d325ea0b560
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2042618
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2020-02-07 11:58:50 +00:00
Paul Lewis 96a0b3c224 [e2e] Performs cleaner shutdown
Bug: 1044632
Change-Id: I86252d31a411e82e44bbf902e65501e9f6807939
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2042090
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Liviu Rau <liviurau@chromium.org>
2020-02-06 16:08:27 +00:00
Paul Lewis bd88d7fb19 [e2e] Moves hosted mode server to JS side
Change-Id: I864dba4c988716215d18cb32b59c539d966cb9fb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2037997
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-05 17:11:13 +00:00
Paul Lewis 32473f08f9 [e2e] Moves shared logic out of e2e
We plan to have multiple suites using the same machinery that currently
runs the e2e. This CL moves that machinery out to a shared folder and
remaps the e2e code to use everything in the new locations.

Future CLs will introduce additional suites for capturing traces,
screenshots, and other artifact.

Change-Id: I452424d8f65fb03897f5a59606c592be996e91ab
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2035949
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-02-05 16:01:03 +00:00
Christy Chen 1ab87e04c9 Fixed localization presubmit command line too long error
In presubmit.py, _CheckDevtoolsLocalization() gets all the paths of affected files and pass those in as arguments when running run_localization_check.py. When a lot of files need to be scanned, it casus the issue where character number exceed the limit of CreateProcess on Windows.

This PR changes the _CheckDevtoolsLocalization() to create a temp file that contains the affected file paths, and have the validation step read the affected file paths from the temp file.


Bug: 941561
Change-Id: I698e5064287eee8a8a3aca0682e3ab3521eb63d1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2032086
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
Commit-Queue: Christy Chen <chrche@microsoft.com>
2020-01-31 23:01:04 +00:00
Brandon Goddard 53faba1c7d Reland "Add script that checks license headers of JavaScript files"
This reverts commit 27f15d113a.

Reason for revert: script is fixed on Windows

Original change's description:
> Revert "Add script that checks license headers of JavaScript files"
>
> This reverts commit 6122ebd2f9.
>
> Reason for revert: Presubmit fails on windows due to relative
> path comparison with excluded files
>
> Original change's description:
> > Add script that checks license headers of JavaScript files
> >
> > The script checks if the license header is the BSD-3 license header that
> > DevTools is licensed under. It excludes files that have license headers
> > that reference non-Google/non-Chromium authors or are third_party
> > bundles that are checked into a non-third_party folder.
> >
> > Change-Id: I35f78036b48d3d7b7dcb9db1e070691282e27a02
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016747
> > Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
> > Reviewed-by: Liviu Rau <liviurau@chromium.org>
> > Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
>
> TBR=bmeurer@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org,liviurau@chromium.org
>
> Change-Id: Idc27e9b78d5ac314176c71f8f4a7a2257da08be9
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2019019
> Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
> Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
> Commit-Queue: Brandon Goddard <brgoddar@microsoft.com>

TBR=bmeurer@chromium.org,aerotwist@chromium.org,lomitch@microsoft.com,brgoddar@microsoft.com,tvanderlippe@chromium.org,liviurau@chromium.org

Change-Id: I191665c8e3fdbee7f3c5c312b5ba00513502e080
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2019021
Reviewed-by: Fabio Rocha <fabio.rocha@microsoft.com>
Commit-Queue: Brandon Goddard <brgoddar@microsoft.com>
2020-01-24 18:16:35 +00:00
Brandon Goddard 27f15d113a Revert "Add script that checks license headers of JavaScript files"
This reverts commit 6122ebd2f9.

Reason for revert: Presubmit fails on windows due to relative
path comparison with excluded files

Original change's description:
> Add script that checks license headers of JavaScript files
> 
> The script checks if the license header is the BSD-3 license header that
> DevTools is licensed under. It excludes files that have license headers
> that reference non-Google/non-Chromium authors or are third_party
> bundles that are checked into a non-third_party folder.
> 
> Change-Id: I35f78036b48d3d7b7dcb9db1e070691282e27a02
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016747
> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Liviu Rau <liviurau@chromium.org>
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>

TBR=bmeurer@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org,liviurau@chromium.org

Change-Id: Idc27e9b78d5ac314176c71f8f4a7a2257da08be9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2019019
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
Commit-Queue: Brandon Goddard <brgoddar@microsoft.com>
2020-01-24 16:50:05 +00:00
Tim van der Lippe 6122ebd2f9 Add script that checks license headers of JavaScript files
The script checks if the license header is the BSD-3 license header that
DevTools is licensed under. It excludes files that have license headers
that reference non-Google/non-Chromium authors or are third_party
bundles that are checked into a non-third_party folder.

Change-Id: I35f78036b48d3d7b7dcb9db1e070691282e27a02
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016747
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
2020-01-24 11:51:49 +00:00
Mandy Chen 40720b1f80 Fix type checking script on windows
On windows, result of path.join() contains double back slashes, e.g.
>>> path.join('sdk', '../SupportedCSSProperties.js')
'sdk\\../SupportedCSSProperties.js'
But in run_type_check.py, it expects paths to contain forward slashes.
This CL updates the equlity checks to call path.join() as well so the
script works on windows.

Change-Id: Id2e9bca6e2f11403f5520892581eaaa8392613da
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2017917
Reviewed-by: Fabio Rocha <fabio.rocha@microsoft.com>
Reviewed-by: Brian Cui <brcui@microsoft.com>
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
2020-01-24 02:30:57 +00:00
Tim van der Lippe 4d1ddf7f73 Migrates protocol/ to ESM internally
Bug: 1006759
Change-Id: I99743fcf3d33bc1e5a3b729c2c544826e1d8e923
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2013156
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-01-23 13:19:20 +00:00
Paul Lewis b8b3801b10 Adds e2e scripts and 'Hello, World' test
Bug: 1044632
Change-Id: I1f6c75c0c03f7f03cb2e8e92e8766af0c8444057
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2007505
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-01-22 17:23:15 +00:00
Tim van der Lippe 6d1e03c598 Reland "Migrate accessibility/ to ESM internally"
This reverts commit 5a8f4d89e1.

Reason for revert: Use fix as we did for CSSProperties

Original change's description:
> Revert "Migrate accessibility/ to ESM internally"
>
> This reverts commit 785c6a4f1c.
>
> Reason for revert: Suspected to break "run_type_check.py" on the bot.
> https://ci.chromium.org/p/chromium/builders/try/linux-rel/279842
>
> Original change's description:
> > Migrate accessibility/ to ESM internally
> >
> > Bug: 1006759
> > Change-Id: I9d801349fd73a06d7f72933acfa65b103531a278
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1991511
> > Commit-Queue: Paul Lewis <aerotwist@chromium.org>
> > Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
>
> TBR=aerotwist@chromium.org,tvanderlippe@chromium.org
>
> Change-Id: Ie4fe54b84cf91cd034bfdb21c20b97eaacdb3599
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1006759
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1994960
> Commit-Queue: Simon Zünd <szuend@chromium.org>
> Reviewed-by: Simon Zünd <szuend@chromium.org>

Bug: 1006759
Change-Id: I7e3b3eafd608aa2fa7d05319a9ff0d4947a2dc88
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2013148
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-22 14:48:24 +00:00
Tim van der Lippe 9293af7230 Migrate sdk/ to ESM internally
Bug: 1006759
Change-Id: I2bb0c8eaa4fdc89edd8da2b12d9fd0e08d427174
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2003327
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-17 15:17:17 +00:00