Commit Graph
38 Commits
Author SHA1 Message Date
Philip Pfaffe b0d9425083 [test runner] Allow failing fetches
When a fetch or XHR fails an error is logged on the DevTools console.
The test runner fails when unexpected errors are printed. A failing
fetch or XHR is not actually an error though (https://crbug.com/124534),
so add the error message to the list of allowed errors.

Change-Id: I9c63ffdc86c590ff8471a3682cf90aa75b5a1ae8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2601971
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-12-23 11:17:05 +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 fc495906c3 Enforce no TS non-null bang assertions
This CL bans the TS `!` operator which is used to assert not null.

Typically when we use this we are making errors harder to track down
should the value actually end up being null. Checking it takes more work
but will give nicer errors.

Fixed: 1154182
Change-Id: I11599541c199204e4ca21c9fd81a256614d70389
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2566804
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-12-02 14:46:50 +00:00
Tim van der Lippe 75c2c9cff5 Disable @typescript-eslint/no-unused-vars
The newest version of @typescript-eslint errors on declare globals.
While this is usually good to point out, we have legitimate usages
of these statements. Based on the discussion in
https://github.com/typescript-eslint/typescript-eslint/issues/2519
it seems unlikely this will be fixed anytime soon. Therefore, let's
disable these specific lines to unblock our upgrade of the linter.

R=jacktfranklin@chromium.org

Change-Id: Iee6339428eef0d5496783850a9026fed00942bcb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2566807
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>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2020-12-01 13:18:25 +00:00
Jack Franklin 086ccd5a7a Enable test_suite to take a configurable server type.
As part of the work to enable Puppeteer component tests, we need to
configure the test suite to run either the hosted mode server or the
component docs server. This CL updates it to take a flag, and makes some
updates to the component docs server, which now has to run either
directly or in the out/Default/gen directory depending on how it is run.

I suspect I'll make a follow up CL to always run the component server in
out/Default/gen, but for now enabling it to detect its context is the
quickest way to unblock running it in tests. The next CL will add a
component test suite that can run a basic test against the component doc
server, but I have manually verified locally that I can run tests
against that server.

Bug: 1153281
Change-Id: I55bda4edd0a983d03bfecff0446b0f3e3a008b52
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2562707
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-11-27 12:00:26 +00:00
Jan Scheffler f74777559c [e2etest] Move hosted mode server to https
This allows testing things that require secure connections
like thrid party cookies.

Change-Id: Id7f6dc672f8a2e701f2baad22fa035826a8d7b2a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2537951
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-18 12:58:43 +00:00
Peter Marshall ad14b033bf [tests] Run chromium before prompting during interactive e2e mode
With the prompting in the global setup fixture, we started the hosted
mode server and then paused with the user prompt. This is not how it
worked before, where we launched chrome before we paused.

Set it back to the previous behavior by moving the prompt code inside
the beforeAll hook. Debug mode is mututally exclusive with parallel
mode so the moved code will only run in serial mode, not once per
parallel process.

Bug: 1101784
Change-Id: I74c9a70652056ecf368e439ee747409742ff4ce9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2537969
Auto-Submit: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-16 11:10:44 +00:00
Peter Marshall 580bbf4bbc tests: Add final changes for parallel e2e tests
Only set the unhandled rejection handler once per process.
We run the setup and teardown multiple times per-process now.

Add clearPuppeteerState() to unset the state between runs on
a parallel test runner. This is because the port changes
between successive runs in the same process.

Remove the hasShutdown logic from mocha_hooks. Also remove the
beforeExit hook which was causing this to get called at least
twice for every process. It already gets called in the ordinary
shutdown case via the afterAll() hook. We only need to call it
in the extraordinary case which is the SIGINT case. Now that we
do the shutdown multiple times per process, we don't care if we
already shutdown on this process or not. The only issue could be
if ctrl+c is sent during the shutdown, but then we are crashing
anyway.

Right now the default # of jobs is 1, so out bots will still run
in serial mode. We want to add parallel mode as an options for
local development while we iron out any last problems with this
approach.

You can test this locally with npm run e2etests -- --jobs=8.

We make use of global setup fixtures to only run one hosted
mode server and share it between all parallel runners. Each
runner still starts its own chrome and restarts it between
files, which is a bit inefficient but still a big improvement
compared to serial mode.

Split the hosted mode server out into its own file inside
conductor as it can be dealt with entirely separately, and
its state is not per-process like the chrome state, but only
per-main-process which launches the test runner sub-processes.

Bug: 1101784
Change-Id: Ic0c9be3559708fd5403a88882b9fb93257633de9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2288694
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
2020-11-13 15:20:27 +00:00
Yang Guo ff6d2bb252 Add stack trace for assertion failures in e2e tests
R=aerotwist@chromium.org

Bug: 1132333
Change-Id: Ie196a1a3f6d31570702bac10c0938459e6c12079
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2521917
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-11-06 11:19:22 +00:00
Yang Guo bd744c4303 Introduce allow list for expected assertion failures
R=aerotwist@chromium.org

Bug: 1145969
Change-Id: I1ada0d5a4daa74c5c63c85f5ebdcd9e194c548dd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2521915
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2020-11-06 10:02:22 +00:00
Johan Bay 5a41e47b6f Use Puppeteer's built-in pierce/ handler
Puppeteer now ships with a built-in handler for piercing shadow dom.
We can therefore get rid of our custom query handler that serves the same
purpose.

Change-Id: Id481f2c083e34e9e9976df72a8a7950290f6e923
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2512234
Commit-Queue: Johan Bay <jobay@google.com>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-11-02 14:14:10 +00:00
Johan Bay f035c3a5de Roll Puppeteer from 5.3.1 to 5.4.1
DISABLE_THIRD_PARTY_CHECK=updating node_modules deps

Change-Id: I6c0d6e92cffbec8c0ee17dcad2aec9cbebdbc29c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2512232
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Johan Bay <jobay@google.com>
2020-11-02 13:25:30 +00:00
Jan Scheffler 1ba10152ed Remove verbose logging in e2e tests
Bug: chromium:1135482
Change-Id: Ibee80248603f70fad742e66a11c55a15e7b9e9c4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2491651
Auto-Submit: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2020-10-22 13:58:09 +00:00
Jan Scheffler c2aef877b2 Show stdout/stderr when e2e tests do crash
Bug: chromium:1135482
Change-Id: If1e2efb3514646ec3c04366c83956e81d28e3ada
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2452690
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
2020-10-08 14:41:37 +00:00
Yang Guo e41c35aae5 Consider console.{assert, error, exception} messages e2e test failures
R=aerotwist@chromium.org

Bug:chromium:1132333
Change-Id: I2c5046430eec006bbd950df7aebaa6ee26b98969
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2431514
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-09-29 15:28:58 +00:00
Tim van der Lippe e9b8e99658 Add component hooks to conductor
These will be used in the tests for the style component. We are checking
these helpers/infra in before landing the component, to figure out how
to hook up the tests. I expect the `component_hooks.ts` to be refactored
away, but kept it now for ease of debugging/plumbing.

Bug:1126047
Change-Id: Ia01e16e66b22c353016313636f20f7d0745aac9e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2406162
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-09-23 08:35:24 +00:00
Tim van der Lippe 1b4a02172d Fix more issues for TypeScript 4.1
A full rebuild showed additional errors that tsc 4.1.0-beta caught.

R=jacktfranklin@chromium.org

Bug: 1011811
Change-Id: I740d990bee512edebfc64402ac127110b82c9fcf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2421692
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-09-21 12:33:30 +00:00
Maksim Sadym 4d2e095852 e2e tests for Idle Emulation
Blocked by
https://bugs.chromium.org/p/chromium/issues/detail?id=1113202

Bug: 1090802
Change-Id: Icebb86770dcde77bc267470cc26426b2439f9164
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2335279
Commit-Queue: Maksim Sadym <sadym@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2020-08-06 09:24:37 +00:00
Johan Bay e8245718be Use custom query handlers to implement $ and $$ in test/shared/helper.ts
Change-Id: I7c2ea2e6250bea1d15caaf1d341c56b7b2448e9b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2317870
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-08-04 14:05:13 +00:00
Johan Bay daf18f277d Introduce custom query handlers for piercing shadow dom
Change-Id: I63e0dff50a1d59b8a4fae28480be2841173ec4c8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2308545
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-07-28 13:01:43 +00:00
Peter Marshall bb2dd57bd9 tests: Request a free port for the chrome debug port
Previously we hardcoded the port to 9222. In parallel mode we need each
chrome to have a different debug port.

We get the port from the browser websocket endpoint URL which
puppeteer helpfully exposes.

Factor out launching chrome and getting the port into functional
helpers.

Bug: 1101784
Change-Id: I18707923cee3e8f68ac81e0a2d56e53d3d946e69
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2288690
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-09 13:14:27 +00:00
Peter Marshall d74ef01edb tests: Request a free port for the hosted mode server
Rather than hardcode the port to use, use port 0 which
requests any free port from the OS. We report the port
we end up using to the caller over IPC, if an IPC
channel was opened by the caller.

We wait for the port to get reported before starting
the chrome instance.

Previously we started the hosted mode server and then
started chrome without waiting for it to start. This is
probably fine in most situations because chrome takes a
while to start and we need to do extra setup there, so
we have a long time before the server needs to respond.

For parallel test mode, we need to make sure we start
the server on a free port. This also makes the mocha
runner more robust to failures e.g. if we accidentally
leave the server running and the port is taken.

This doesn't slow down the startup time of the e2e
test runner at all, according to timing of local runs.

Bug: 1101784
Change-Id: Ibb14d5a177ba5f9e257743824770bff3d5ccb033
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2285124
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-08 14:51:06 +00:00
Peter Marshall e68a437a5e tests: Pass the ports we are using to the hosted mode server
Right now we hardcode the ports and assume that the hosted mode server
hardcodes the same ones. In the future we will have different port
numbers for different parallel test runners, so we need to pass the
correct numbers here.

env.PORT is the hosted mode server port, so it's essential we get that
right. env.REMOTE_DEBUGGING_PORT is only used in a link on the
landing page of the hosted mode server, so it being correct is not
essential for the tests to run properly but there's no reason for
it to be wrong.

Also rename envPort to chromeDebugPort to make things clearer with all
the different port numbers flying around.

Bug: 1101784
Change-Id: I58880a3543021bbcd484cf3578ff8225d3e3d81c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2284839
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-08 11:45:46 +00:00
Peter Marshall d7ab08f7f8 tests: Fix console.log passthrough to check if the URL is available
We asserted it was available with !. but this is not always the case
and was causing flakes on bots.

Change-Id: Iedc4820dd4ca74a82a16f42cbd0b2b1c9d84a8b4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2287509
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-07-08 08:56:56 +00:00
Peter Marshall c16cedd67c tests: Don't hardcode the hosted mode server port number
(...in more than one place).

Lots of tests relied on the hosted mode server using port 8090 which
is not going to be the case once we have the parallel mocha runner
working.

Add the port number to puppeteer-state and have tests use it by
going through test/shared/helper.ts.

The port number is set at runtime rather than being a module-time
constant, so some users of the port needed to be changed to get it
after the root hooks ran instead. Future users should follow this
pattern and get the port in a before() block or during the test
itself. Or just use helpers that treat the port properly already
e.g. goToResource.

We don't send this port number to the hosted mode server yet,
so we still have this hardcoded in two places. A fix is coming in
a future CL.

Bug: 1101784
Change-Id: Ib0a7aa7a25db58d06624a1cdee6fa630cdfbe362
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2284828
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-07 15:43:22 +00:00
Eric Leese 66342552ce Add helpers for debugging and snippet tests
Changes include:
 - Test server handles URLs with escaping better.
 - Logging from DevTools frontend now logged by the test.
 - Helper to turn on CDP logging - for debugging only.
 - click helper improved to allow specifying maximum distance from
   left, for when an element extends far beyond its containing
   element.
 - New pressKey helper that makes keyboard shortcuts easy.
 - Helpers to modify and save a source pane and to get the text of
   the line of code where we are stopped.

Bug: 1094436
Change-Id: I389eaa680bb0771a45104f470647f67b4fa5d1d9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2282811
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Eric Leese <leese@chromium.org>
2020-07-07 13:45:42 +00:00
Tim van der Lippe 020be5be89 Add OWNERS for test/conductor
This also adds Peter as explicit owner, as he has been making various
changes to the Mocha infrastructure underpinning e2e-tests.

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

Change-Id: If9aa9f8f1d50a54cf7c94dedbacb94b6a1ef3895
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2282519
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-07 10:27:12 +00:00
Peter Marshall 5e3ce97214 test: Use root hook plugins for Mocha
Mocha 8 introduces 'root hook plugins' which is an alternative way of
specifying root hooks, which is required for parallel mode.

This CL uses the new root hook plugins following the migration guide:
https://mochajs.org/#migrating-tests-to-use-root-hook-plugins

This CL does not make us ready for parallel mode yet, because we still
have a few assumptions that we have one instance running. These will be
dealt with in future CLs. This CL just ports the root hooks over to the
plugin system while maintaining the same behavior.

Bug: 1101784
Change-Id: I74dfc7f24decd031ebac656c7cea8ef87f9ac791
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2282346
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-06 15:23:31 +00:00
Tim van der Lippe fe75007069 Run e2e-tests on build output
The e2e-tests now use the build output in resources/inspector in
the out directory. This allows us to introduce TypeScript-authored
files in the source directory `front_end`, which will get compiled
into resourc/inspector.

After to making a change to a e2e-test or the front_end, you need
to rebuild Devtools, after which you can run `npm run e2etest` as
normal.

Since we now use the build output, this also means that you can
run the e2e-tests on the release build. In other words, if you
build DevTools with build optimizations (such as Rollup), the
e2e-tests will now use the output (and thus provide test coverage).

DISABLE_THIRD_PARTY_CHECK=Node fixes
R=aerotwist@chromium.org,jacktfranklin@chromium.org

Fixed: 1088463
Change-Id: I02ec3c2476bc3647158fede9e1d347963b3a720a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2224809
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jose Leal <joselea@microsoft.com>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-06-29 11:35:23 +00:00
Sigurd Schneider 92a1bd81d1 Be resilient againt source maps without mappings
antonin.hildebrand@gmail.com provided the reproduction source map and
the fix for this bug. We just packaged everything up in a regression
test.

This CL also modifies the test runner to fail when an unhandled
promise rejection occurs.

Bug: chromium:1043081
Change-Id: I6c145b05a20f0c98a4c0c259eb1737df766dc6d2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2247643
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2020-06-16 13:10:28 +00:00
Sigurd Schneider d9ced459c8 [docs] Add section about e2e-test debugging
Change-Id: Iccbd61a8b1e9b9d36b22519670105b9ec61c0d6b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2247640
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2020-06-16 10:38:38 +00:00
Jose Leal Chapa 1f3176b058 Devtools: Open a closed tab via quary param
Currently the query param "panel" only selects a tab if it is already open. With this change a closed tab can be opened and selected.
Gif: https://imgur.com/a/Sc8H04J


To try the Layers panel example:

Using master:
1) Start debugging a website using `npm start` and make sure Layers is closed.
2) append `&panel=layers' to the url and reload the page,
3) you should see that the panel is not opened

Apply the changes from this CL:
3) Repeat steps 1 & 2
4) Layers panel should appear.

Bug: 1094648
Change-Id: Id8f69ebc91058c89dd07488a2480fea12ceb8f79
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2244849
Commit-Queue: Jose Leal <joselea@microsoft.com>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
2020-06-15 21:19:13 +00:00
Tim van der Lippe 421827d590 Add ninja template for copying to the gen folder
We are doing this so often and the syntax for the `outputs` arg
is difficult to remember, I figured it is better to extract out
a template. This should make it easier to copy-paste from other
BUILD.gn files as well.

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

Bug: 1088463
Change-Id: Ic78ee5082ee5eae4e07f7ceeb21842f54dcbaf56
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2224807
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-06-02 10:38:50 +00:00
Tim van der Lippe d76dbd1fe3 Add node_ts_library for Node scripts
ts_library by default uses ES modules. However, Node doesn't fully
support ES modules yet, nor do our dependencies for our e2e-tests
support them fully. Therefore, transpile to commonjs for now, if
running in Node.

DISABLE_THIRD_PARTY_CHECK=Fixes to ts_library
R=aerotwist@chromium.org,jacktfranklin@chromium.org

Bug: 1088463
Change-Id: Ie6acf886417b80eb38365f9c2377799e370634fe
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2224805
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-06-02 10:24:00 +00:00
Changhao Han b7228caa92 e2e test for media query inspector; add canDock option in ReloadDevTools
Add e2e test for Device Toolbar's media query inspector, as a follow-up
to an earlier issue that media query inspector did not show media query
rules from style tag attributes.
When adding this e2e test for Device Toolbar, it's required that the
e2e test driver can reload DevTools frontend page with "can_dock=true"
parameter in its URL. This CL also adds "canDock" as an option when
reloading DevTools frontend in e2e testing.

Bug: chromium:1069467, chromium:1086159
Change-Id: Ic8685fc231fa7b01554e05a1121b3c2394fb7131
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2215857
Commit-Queue: Changhao Han <changhaohan@chromium.org>
Auto-Submit: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-05-27 12:25:00 +00:00
Philip Pfaffe e9030b8c54 [e2e] Show chrome stderr/stdout when running e2e tests in debug mode
Currently we eat all output of chrome in e2e tests. That makes debugging
crashes slightly harder. This CL dumps chrome's IO if debug mode is
enabled.

Change-Id: I3139040c4b47b808b067c2ee4418c07adea10dfb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2168092
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2020-04-27 16:35:56 +00:00
Tim van der Lippe e784d74686 Properly cleanup on process teardown when pre-emptively stopping mocha
If developers would kill the Mocha process before completion, it would
not run the `after` hook. This meant that its subprocesses (most notably
the Puppeteer process) would not properly cleanup.

To mitigate that, listen for the process exit and `SIGINT` signal (e.g.
a developer doing `ctrl + c`) and cleanup. However, if the `after` hook
ran succesfully, we shouldn't be cleaning up twice.

R=aerotwist@chromium.org

Bug: 1071369
Change-Id: I072b2b662309af1c508a7877c4b897cf915bed71
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2157039
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-04-21 13:47:07 +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