Commit Graph
105 Commits
Author SHA1 Message Date
Sigurd Schneider 123977af32 Enforce naming convention in test/
Bug: chromium:1057042
Change-Id: Ib95f2640b1acf525cd12e377f0118377ddbe6077
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2695568
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2021-02-15 14:57:54 +00:00
Simon Zünd 5fd7506a2e [e2e] Add host resolver rules for *.test domains
This CL configures custom host resolver rules for the Chromium binary
that puppeteer is using to run e2e test.

With host resolver rules, all resources can now be loaded via
arbitrary '.test' domains while still being served from localhost.
E.g. an e2e test might navigate to 'devtools.test/foo.html' while
also including an iframe with Url 'bar.test/iframe.html', with both
files being served from localhost.

This unlocks testing for a whole class of features that was
previoulsy impossible to test.

This CL also adds a new helper 'goToResourceWithCustomHost', that
supplements the existing 'goToResource' with a modifiable host part.

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

Bug: chromium:1177676
Change-Id: I1f51aa8419619e11352989457b24cc56cfc78e52
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2692148
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-02-12 13:36:02 +00:00
Jack Franklin 5017c095f3 Bump Puppeteer to 7.1.0
Doing so lets me remove some of my hacks for previously broken types.

DISABLE_THIRD_PARTY_CHECK=upgrading puppeteer

Bug: chromium:1176642
Change-Id: I141c6eadfe258ac2c8c31fa86c80f014362ee8ce
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2692157
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-02-12 12:04:06 +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
Philip Pfaffe 543570c2ba Patch Mocha's describe to include test names
When tests fail, debugging the failure includes isolating the test
before opening it in debug mode or adding diagnostics to it. With the
current test output, opening the file is surprisingly tedious, since
there is no direct way to map test log output to the tests on the
filesystem. One has to grep the test directory for test names first.
This CL wraps Mocha's describe function to automatically include the
test filename into the test title in a format that can be copy-pasted
into the test runner's --test-file argument.

Bug: none
Change-Id: I172bd14f5026ec0041b933c64bcdcccf58536fb9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2681741
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
2021-02-08 15:49:05 +00:00
Alex Rudenko d6594130ef Report low contrast issues
This CL adds the logic to trigger contrast checks on DevTools
startup or on page load events. The check is only triggered if
the corresponding experiment (contrastIssues) is enabled.
Deduplication of the reported issues happens in the IssueManager
on the frontend since the same issue might be reported twice
if there are multiple documents on the target page.

Bug: chromium:1155460
Change-Id: Ib0d5115c527ceb9da9d2ed2dfa48cfdca6f82f60
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2573360
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2021-02-04 12:39:48 +00:00
Sigurd Schneider 1576186355 Enforce member delimiters
This CL enforces member delimiters following
https://google.github.io/styleguide/tsguide.html#member-property-declarations

Bug: chromium:1057042
Change-Id: I2553aeebb8187235cdf0e7f0585da36ea53388bb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2672032
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2021-02-04 09:03:57 +00:00
Sigurd Schneider 9c07567fdd Properly enable dangling comma conventions in TypeScript
The eslint rule 'comma-dangle' isn't enough to enforce dangling
commas in TypeScript, we must use '@typescript-eslint/comma-dangle'
instead.

Bug: chromium:1174055
Change-Id: I589e1016ab578c965b54f17da3eab7ea542a2f7a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2672028
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2021-02-03 14:01:11 +00:00
Alex Rudenko aedb3d8bf3 Capture screenshots on timeout if there are not async stacks
Bug: none
Change-Id: I7b83347597d3a3f6f2664963c4c68965648e1d5c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2665735
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2021-02-03 11:52:19 +00:00
Sigurd Schneider 286466e0c8 Reland "Show issues on SAB instantiation"
This reverts commit b3759d720b.

Reason for revert: A chrome test binary roll changed e2e test
behavior between running CQ on the CL and landing it.

Original change's description:
> Revert "Show issues on SAB instantiation"
>
> This reverts commit f366a4ca99.
>
> Reason for revert: Fails on a lot of CQ and trybots.
> E.g.: https://ci.chromium.org/ui/p/devtools-frontend/builders/ci/Stand-alone%20Linux/5128/overview
>
> Original change's description:
> > Show issues on SAB instantiation
> >
> > Bug: chromium:1051466
> > Change-Id: I39f1110d370e3d5cca801112c2b776f697875d64
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2652505
> > Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
> > Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
> > Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
>
> TBR=sigurds@chromium.org,jacktfranklin@chromium.org,wolfi@chromium.org
>
> Change-Id: I8a6a8b7aa57be0521615f9569bfdcad86463d8d0
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:1051466
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2655246
> Commit-Queue: Simon Zünd <szuend@chromium.org>
> Reviewed-by: Simon Zünd <szuend@chromium.org>

TBR=sigurds@chromium.org,szuend@chromium.org,jacktfranklin@chromium.org,wolfi@chromium.org

# Not skipping CQ checks because this is a reland.

Bug: chromium:1051466
Change-Id: Id3858c9b38d4f0dbcbc47dcc86500e8e27258305
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2655248
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2021-01-28 11:50:08 +00:00
Simon Zünd b3759d720b Revert "Show issues on SAB instantiation"
This reverts commit f366a4ca99.

Reason for revert: Fails on a lot of CQ and trybots.
E.g.: https://ci.chromium.org/ui/p/devtools-frontend/builders/ci/Stand-alone%20Linux/5128/overview

Original change's description:
> Show issues on SAB instantiation
>
> Bug: chromium:1051466
> Change-Id: I39f1110d370e3d5cca801112c2b776f697875d64
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2652505
> Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
> Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>

TBR=sigurds@chromium.org,jacktfranklin@chromium.org,wolfi@chromium.org

Change-Id: I8a6a8b7aa57be0521615f9569bfdcad86463d8d0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1051466
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2655246
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2021-01-28 10:02:18 +00:00
Sigurd Schneider f366a4ca99 Show issues on SAB instantiation
Bug: chromium:1051466
Change-Id: I39f1110d370e3d5cca801112c2b776f697875d64
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2652505
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
2021-01-28 08:52:47 +00:00
Tim van der Lippe ed61abde18 Enable no-implicit-coercion ESLint rule for test/
R=jacktfranklin@chromium.org

Bug: 1082789
Change-Id: Ibb356637e115dc811c165fb0ad33a60a99105e79
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2595267
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-12-16 15:40:04 +00:00
Alex Rudenko c9f76ea16b Capture page screenshot on e2e timeout errors
This CL adds capturing of the target page and the frontend screenshots
when a timeout occurs. The screenshots are printed to stderr as data URLs
and can be opened in a web browser directly.

Also-By: pfaffe@chromium.org
Change-Id: I58f731bd0a8d71565e1160699e1003b08361f073
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2571124
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
2020-12-03 14:39:33 +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
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
Philip Pfaffe 7426b000e3 [wasm debug] Fix propagating debug evaluate errors in language plugins
When debug evaluation hits exceptions in wasm debugging, the
LanguagePluginManager incorrectly propagated those errors, causing weird
warnings in the wrong places or warnings that are missing altogether.
This CL hooks up the plugin manager with the existing error reporting
mechanisms and includes a test to make sure the errors show up.

Drive-by: In the watch window, when evaluation failed, we previously
swallowed the actual exception. That's probably because most of the time
that exception is a reference error because variables aren't valid in
the current scope. This CL adds a tooltip that shows the exception.


Bug: chromium:1137514, chromium:1153315
Change-Id: Ia1ec81ce95598adf7abab8c4e31c3310e3669fb7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2565376
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
2020-11-30 16:34:10 +00:00
Jack Franklin 8d634c2cdf Update all enums to be const enums
We will land a rule soon that enforces const enums in the codebase. This
updates any non-const enums to be const enums and updates the tests
accordingly.

R=andoli@chromium.org

Bug: 1130536
Change-Id: I2221a948a88ec7328e7abc2b33f044d14aef73fb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2562853
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2020-11-30 15:23:42 +00:00
Jack Franklin aba88003dc [ESLint] enforce enum members are explicitly initialized
As per the DevTools style guide; this was a rule enforced previously by
the component bridges.

Bug: 1130536
Change-Id: I281f2d355a78dedd0433b7967f7b26e2e71c8791
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2562348
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-11-26 17:03:13 +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 1319aa78f5 [tests] Don't print steps except for error cases
console.log() output is not buffered during parallel testing so it's
hard to associate the step() logging output with the test that
actually caused it. If we want to log stuff like this, we should find
a way to redirect it to the test reporter properly so that it gets
buffered per-test-file and printed all at once, like the describe/
it output is.

The step output probably isn't needed anymore as we have the AsyncScope
output which gives the source-mapped file name + line number in the
test output if there is an await failure, which is even more useful
than the step output.

If people find cases where we do really need this we can add it back,
the step function still exists for now.

Bug: 1101784
Change-Id: Ia90b6532ce348b189ee7c5f2e3ed482f074a6561
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2534207
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Almothana Athamneh <almuthanna@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
2020-11-13 09:03:52 +00:00
Peter Marshall 6ab6932111 [tests] Re-export mocha functions properly in mocha-extensions
Directly re-exporting functions using the ES modules syntax is clearer.

There is also a bug in parallel mode where describe.skip does not work
in some circumstances, and this fixes it.

Bug: 1101784
Change-Id: Ia0f94f53d0846253c46f47234eefdde4ce212ec8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2532243
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
2020-11-11 14:47:19 +00:00
Johan Bay f04b99c38e Remove redundant aria labels and update tests
crrev.com/c/2039270 introduced a redundant aria-label on every context
submenu for testing purposes. Now that Puppeteer supports querying the
AOM for computed name and role, we can use that instead and remove the
labels.

Change-Id: I883cd99ab5f289e5f50907336f4638bbcea57df4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2516341
Commit-Queue: Johan Bay <jobay@google.com>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-11-04 12:50:58 +00:00
Jack Lynch d529e88005 Reland "Settings: Add e2e tests for shortcuts tab"
This reverts commit f3b391e525.

Reason for revert: Some strings are different on mac, creating a reland to investigate a fix

Original change's description:
> Revert "Settings: Add e2e tests for shortcuts tab"
>
> This reverts commit 137f0a1b84.
>
> Reason for revert: Consistently fails on Mac Bot, first failure:
> https://logs.chromium.org/logs/devtools-frontend/buildbucket/cr-buildbucket.appspot.com/8864995173425920000/+/steps/E2E_tests/0/stdout
>
> Original change's description:
> > Settings: Add e2e tests for shortcuts tab
> >
> > This CL adds several end to end tests for the shortcuts settings tab,
> > including the keyboard shortcut editor.
> >
> > Bug: 174309
> > Change-Id: I293f233f9afde298cb618fbdbb6c9b147b895daf
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2504790
> > Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> > Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com>
> > Commit-Queue: Jack Lynch <jalyn@microsoft.com>
>
> TBR=jalyn@microsoft.com,tvanderlippe@chromium.org,patrick.brosset@microsoft.com
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Bug: 174309
> Change-Id: Ie5ee124b3ad760dead6745e33591eb7578b69e88
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2512225
> Reviewed-by: Simon Zünd <szuend@chromium.org>
> Commit-Queue: Simon Zünd <szuend@chromium.org>

TBR=szuend@chromium.org,jalyn@microsoft.com,tvanderlippe@chromium.org,patrick.brosset@microsoft.com

# Not skipping CQ checks because this is a reland.

Bug: 174309
Change-Id: I8382dfab7a3e3a3dfaaa36e834d67636b33a6b9c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2512850
Reviewed-by: Jack Lynch <jalyn@microsoft.com>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
2020-11-03 19:22:47 +00:00
Johan Bay b01fc265f3 Add optional handler argument to $, $$, and waitFor
This allows us to clean up the `textContent`-related helpers a bit,
and makes it easier to use the new `aria` handler in test scripts.

Change-Id: Ifb4b5a88109223b09034ca4ed1f40e54c6e76310
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2512236
Commit-Queue: Johan Bay <jobay@google.com>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-11-03 07:59:16 +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
Simon Zünd f3b391e525 Revert "Settings: Add e2e tests for shortcuts tab"
This reverts commit 137f0a1b84.

Reason for revert: Consistently fails on Mac Bot, first failure:
https://logs.chromium.org/logs/devtools-frontend/buildbucket/cr-buildbucket.appspot.com/8864995173425920000/+/steps/E2E_tests/0/stdout

Original change's description:
> Settings: Add e2e tests for shortcuts tab
>
> This CL adds several end to end tests for the shortcuts settings tab,
> including the keyboard shortcut editor.
>
> Bug: 174309
> Change-Id: I293f233f9afde298cb618fbdbb6c9b147b895daf
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2504790
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com>
> Commit-Queue: Jack Lynch <jalyn@microsoft.com>

TBR=jalyn@microsoft.com,tvanderlippe@chromium.org,patrick.brosset@microsoft.com

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

Bug: 174309
Change-Id: Ie5ee124b3ad760dead6745e33591eb7578b69e88
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2512225
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2020-11-02 07:37:30 +00:00
Jack Lynch 137f0a1b84 Settings: Add e2e tests for shortcuts tab
This CL adds several end to end tests for the shortcuts settings tab,
including the keyboard shortcut editor.

Bug: 174309
Change-Id: I293f233f9afde298cb618fbdbb6c9b147b895daf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2504790
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com>
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
2020-10-30 17:26:39 +00:00
Philip Pfaffe 1e8f608def Add a DebuggerPaused DOM event and some tooling to await it in tests
I will use it to get rid of a timeout() in the sources panel tests, but
that will be a followup CL to simplify reverting it if necessary.

Change-Id: I4362135e1dac306d67f29474d1d6aea4ef0f1102
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2498224
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
2020-10-28 10:29:44 +00:00
Jesus David Garcia Gomez 9103d0e4fc Fix enum sending telemetry for issues panel opened resource.
This CL fix the event fired for the histogram IssuesPanelResourceOpened.

Bug: 1135327
Change-Id: Ifea9e0ed53aeda0a4017ecc17d9e82d745e62e88
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2451470
Commit-Queue: Jesus David Garcia Gomez <jegarc@microsoft.com>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com>
2020-10-12 23:07:28 +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
Jack Franklin b811a7fcc0 Make it.repeat also do it.only
If you want to run a test multiple times, it's a safe assumption that
you don't care about the rest of the test suite while you're doing that.
So by default when someone uses it.repeat we should also isolate it with
it.only.

Change-Id: I71abba82c1c87a595924b4c12a1ed7af312b4bcf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2406161
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
2020-09-14 16:03:59 +00:00
Jack Franklin f56bc382ec Migrate devtools-active-dom-objects heap layout test
Bug:  1110817
Change-Id: I38bb4d748f5f70388b7b0808090498929462928a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2406156
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-09-11 14:24:44 +00:00
Johan Bay 00fc92a773 Reland^2 "eliminate initial timeout in waitForFunction"
`waitForFunction` previously always waited 100 ms before checking if
the given function is truthy. We can improve the total e2e test suite
running time by 40-50 s by eliminating this timeout. This,
unfortunately, makes some of the tests flake since they relied on this
timeout. This CL attempts to eliminate the timeout and patch the tests
that relied on it. In the cases where a test could not be patched the
timeout is inserted in the test explicitly.
Local experiments showed that this CL reduces the total runtime from
on avg. ~309 seconds to an avg. of ~264 seconds.
This amounts to a ~45 second reduction or ~15%.

This is a reland of a26e3406c7
which was a reland of 3be2087f9d

Bug: 1112692
Change-Id: I3a5156d35553415bfbac95c0251b849ed77f4767
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2354096
Commit-Queue: Johan Bay <jobay@google.com>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-08-17 06:21:56 +00:00
Peter Marshall 4cafd236c0 tests: Add an it.repeat() helper
it.repeat() is helpful for fixing flaky tests.

Along with repeat, we also have the async tracing which is very helpful
for debugging tests that timeout due to hanging async operations. We
want to make all of these helpers available by default.

This CL introduces a new file mocha-extensions and adds both of these
customizations to the default mocha operations and then re-exports them.

In the future, all tests will import from mocha-extensions instead to
get these extensions by default. We will add lint rules to ensure that
callers don't import from mocha directly and miss out on these.

Bug: 1101782
Change-Id: I15dbb71493e60064288bfc050ac3f818a5c6821f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2339319
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
2020-08-14 09:10:47 +00:00
Simon Zünd f3cd1098d0 Revert "Reland "eliminate initial timeout in waitForFunction""
This reverts commit a26e3406c7.

Reason for revert: Still causes flakes on the Mac bot.
Example: https://ci.chromium.org/p/devtools-frontend/builders/ci/Stand-alone%20Mac/475

Original change's description:
> Reland "eliminate initial timeout in waitForFunction"
> 
> `waitForFunction` previously always waited 100 ms before checking if
> the given function is truthy. We can improve the total e2e test suite
> running time by 40-50 s by eliminating this timeout. This,
> unfortunately, makes some of the tests flake since they relied on this
> timeout. This CL attempts to eliminate the timeout and patch the tests
> that relied on it. In the cases where a test could not be patched the
> timeout is inserted in the test explicitly.
> Local experiments showed that this CL reduces the total runtime from
> on avg. 5:05 minutes to an avg. of 4:19 minutes.
> This amounts to a ~46 s reduction or ~15%.
> This is a reland of 3be2087f9d
> 
> Bug: 1112692
> Change-Id: Id92542de85920f95bb922d1b62ddfb63b83a055a
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2346366
> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
> Reviewed-by: Changhao Han <changhaohan@chromium.org>
> Reviewed-by: Mathias Bynens <mathias@chromium.org>
> Commit-Queue: Johan Bay <jobay@google.com>

TBR=mathias@chromium.org,changhaohan@chromium.org,jacktfranklin@chromium.org,jobay@google.com

Change-Id: I607b04d929ec32dd518d3b6c472747a9e2e687b3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1112692
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2352727
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2020-08-13 08:49:02 +00:00
Johan Bay a26e3406c7 Reland "eliminate initial timeout in waitForFunction"
`waitForFunction` previously always waited 100 ms before checking if
the given function is truthy. We can improve the total e2e test suite
running time by 40-50 s by eliminating this timeout. This,
unfortunately, makes some of the tests flake since they relied on this
timeout. This CL attempts to eliminate the timeout and patch the tests
that relied on it. In the cases where a test could not be patched the
timeout is inserted in the test explicitly.
Local experiments showed that this CL reduces the total runtime from
on avg. 5:05 minutes to an avg. of 4:19 minutes.
This amounts to a ~46 s reduction or ~15%.
This is a reland of 3be2087f9d

Bug: 1112692
Change-Id: Id92542de85920f95bb922d1b62ddfb63b83a055a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2346366
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Johan Bay <jobay@google.com>
2020-08-13 08:09:10 +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
Sigurd Schneider d12b93955a Revert "Eliminate initial timeout in waitForFunction"
This reverts commit 3be2087f9d.

Reason for revert: Causes a lot of flakes on the devtools waterfall,
see commit 3be2087f (this CL) and the following CLs.

This is a difficult change, because discovering all test that needs
fixing is difficult. Please do land-revert-reland cycles until we've
fixed all tests. Analyzing the redness referenced above will reveal
more tests that needs fixing.

Original change's description:
> Eliminate initial timeout in waitForFunction
>
> Bug: 1112692
> Change-Id: I28bc29b0f5c2af55d3cf54614fe4d6641b64dd76
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2336716
> Reviewed-by: Mathias Bynens <mathias@chromium.org>
> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
> Reviewed-by: Changhao Han <changhaohan@chromium.org>
> Commit-Queue: Changhao Han <changhaohan@chromium.org>
> Commit-Queue: Mathias Bynens <mathias@chromium.org>

TBR=mathias@chromium.org,changhaohan@chromium.org,jacktfranklin@chromium.org,jobay@google.com

Change-Id: Id7dd3cf313cf4a74e758c28aed5400517bc5f2a6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1112692
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2339526
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-08-06 08:24:49 +00:00
Johan Bay 3be2087f9d Eliminate initial timeout in waitForFunction
Bug: 1112692
Change-Id: I28bc29b0f5c2af55d3cf54614fe4d6641b64dd76
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2336716
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-08-05 17:24:16 +00:00
Johan Bay 504a6f1944 Let $ return null when no element is found
This CL also changes tests to favor `waitFor` over `$` per default:
In all tests where an element is expected `$` is changed to `waitFor`.
This should be uproblematic in all the cases where an element is
expected to exist immediately, but gives a bit of leeway in case the
element is slow to emerge. Typing wise, `waitFor` never returns null
since it throws if no element is found before it times out.

Change-Id: I00b722eff34df44402d9f3bf6786432c9faf1505
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2327710
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-08-04 14:43:13 +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
Philip Pfaffe 6d143ae8af [e2e] Introduce AsyncScope and remove timeout settings in test helpers
AsyncScope objects allow tracking of the current stack trace during
chains of calls to test helpers. Recording stack traces allows us to
report pending helpers when a mocha timeout occurs.

The CL also introduces an AsyncTrace help that tests use to opt into
stack tracing. Wrapping the mocha it() call is necessary to hook into the
processing of the timeout. I export the AsyncTrace helper for clarity,
but we can also wrap mocha's it() directly into our own it() wrapper to
provide a drop-in replacement. AsyncTrace's it() allows configuring the
mocha timeout locally per test. We can chose to not do that and configure
it globally, or alternatively define standard timeouts for 'fast',
'regular', or 'slow' tests.

Change-Id: I9542cdfdd78a1868a9f0fa56b8d112bd549e6f34
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2328845
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2020-08-03 13:49:07 +00:00
Paul Lewis 839037fe83 [TypeScript] disallow explicit any
This CL explicitly disallows use of the `any` keyword via eslint. This
is to make sure we don't accidentally miss typing info. This CL also
adds eslint-ignore statements for existing uses of any (mostly in tests)
as well as fixing a few cases where the types were simple enough to add
quickly.

R=jacktfranklin@chromium.org

Change-Id: Ia913a30d63c1ae3d969785af332a8dde512cc275
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2308544
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-07-21 14:31:32 +00:00
Peter Marshall c059be1548 tests: Always specify a timeout for waitFor/Function
If we use a local timeout rather than letting this timeout the whole
mocha process, we get a way better error message which includes
info about the selector/function/whatever we care about, and the
step name. Without this we just get the test file name and nothing
else.

Change-Id: Ia2882fb123a6f2b582c0dd19f3f01135b496161a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2292276
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
2020-07-20 10:26:19 +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
Jose Leal Chapa 50e7bb5309 DevTools personalization - Make Security tab closeable
To be careful of not introducing breaking changes the closeable tabs work will be staggered in different CLs.
Each CL will target one single panel and will include new e2e tests that will validate:
- the panel is open by default
- the panel exists under More tools
- Closing the tab doesn't crash the devtools
- Reopening devtools persist the newly closed tab

Gif: https://imgur.com/a/LXM0ndg

Explainer:
https://docs.google.com/document/d/1TC1FxzSgRIaXmChpjL05T7sZuduRos3IDPDG5vCS1Oc/edit?usp=sharing

Overall layout personalization explainer:
https://docs.google.com/document/d/1oYBh3QeucgEV-n8BYDU_J-2wcLA4Kg1yku4jDDMcsro/edit?usp=sharing

Bug: 1074732
Change-Id: Idf4ef206c5a8b10fa73c2369394ec1ff09976e97
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2167137
Commit-Queue: Jose Leal <joselea@microsoft.com>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
Reviewed-by: Jack Lynch <jalyn@microsoft.com>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
2020-06-19 17:34:41 +00:00
Songtao Xia 67f65da531 [e2e] Tests for dual screen emulation.
Test the experimental feature of dual screen emulation.

Test the dual screen span mode exists for a dual screen device but
not for a non-dual-screen device.

Change-Id: I72b0cb4e77bb58305f112b32fd7b040436ec42c9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2225335
Commit-Queue: Songtao Xia <soxia@microsoft.com>
Reviewed-by: John Emau <John.Emau@microsoft.com>
Reviewed-by: Jose Leal <joselea@microsoft.com>
2020-06-11 18:13:05 +00:00
Patrick Brosset 0805f4a033 Shared goToResource e2e helper to simplify tests
This introduces a new goToResource shared helper for all e2e puppeteer
tests to use.
It helps simplify a bunch of tests and other helpers in that they don't
need to replicate the `${resourcesPath}/some/file.html` part.
Because this helper also knows how to get hold of the target on its own
it also further simplifies other tests that don't need to import it
anymore.

The next step would be to create a shared helper that knows how to
navigate to panels inside the DevTools front-end as this is also
duplicated across tests.

Bug: 1091226
Change-Id: I717455a51dec30e153d796ef101eab3d42bc2da1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2230320
Commit-Queue: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Jose Leal <joselea@microsoft.com>
2020-06-11 09:52:45 +00:00